Arduino noob needs help!!

Thanatos

Active Member
Well, I don't know if any of you guys can help me too much (or if any of you even know what an Arduino is... I know NyxCharon does, lol) but I need help.

1) What is a motor shield used for, and why would I need one?
I need to use a regular, full rotation motor with one of my projects, and I just don't know where to start. I know they must be 5v, so where could I buy a couple of these? Can you guys give me a couple links? And, how do I control it? Does it act just like an LED does when programming? Can I have some sample code?

2) How can I get my remote to work with an IR receiver I have?
I have gotten the receiver to work and to display the codes from my Dish Network remote, but every code is different, even if from the same key. So, do I need some special sort of remote? NyxCharon, if you get around to reading this, how did you do it with your project?

Basically, using a ping sensor, a remote control, a servo, and two motors, I want to make a simple, wall avoiding robot that can also be steered using the remote. It should turn out looking something like this:

2869327939_803da02f8c.jpg


So, any help, advice, and/or scolding you'd like to give me?

And, for those not familiar with the Arduino, here's the main site.
 
motor shield is used to provide drive circuitry for a motor. and I am not big on the IR unit...that something that someone else on the net may have done, might want to look at hack-a-day, they have a lot of stuff on that micro-controller. (i just know the basic ideas...no clue how to program or wire it...just its the idea i get from the naming)
 
drive circuity is anything that would push current through a device, that the controller would not otherwise be able to provide. think of it as a muscle where the micro controller is the brain
 
Hey man, just wanted to let you know I read this, I'm at work atm, so I can't pull up my code. However,I can answer your question about the motor shield. Shields in general add more functionality to the arduino. In this case, It makes managing several motors at once much easier, since the power and and controls for each are handled separately by this, and the overall shield itself is controlled by the arduino. If your only using it to control one motor, your fine since the arduino has a +5 and enough inputs to control it. But once you add multiple, you need a external power for it, etc.

Basically, it just makes the whole setup more streamlined and cleaner, and overall easier to manage.

I'll get back to you on the IR stuff later tonight.

Edit:
I forgot I made a arduino thread that has my code.
http://www.computerforum.com/208914-arduino-thread.html
You can go ahead and look though it, I'll explain it and such and throw up a link to a library later if needed.
If i remember right, the library I used only works on a older IDE, the current 1.0 doesn't work for some reason.
 
Last edited:
Can you recommend any fairly strong electric motors? Would I need any special sort of battery to run a larger motor? I've heard that a regular 9V has too much 'noise', rendering itself useless.

Sorry if I seem paranoid, I just don't want to screw anything up.
 
Can you recommend any fairly strong electric motors? Would I need any special sort of battery to run a larger motor? I've heard that a regular 9V has too much 'noise', rendering itself useless.

Sorry if I seem paranoid, I just don't want to screw anything up.

I've only worked with stepper motors so far, as I'm working on a CNC controller.
There strong, but not fast at all. So, are you looking for speed or accuracy in controlling these? Or is it one of those I need a bit of both kinds of things? :P
 
speed and power, really. Just making a basic wall avoiding robot. Do you know if these motors kinda act just like LEDs do? HIGH and LOW?
 
speed and power, really. Just making a basic wall avoiding robot. Do you know if these motors kinda act just like LEDs do? HIGH and LOW?

Stepper motors as far as the arduino is concerned is fairly basic.
Set the speed, set the number of turns and the direction to turn it. That's about it. I haven't tried normal motors yet, but I'm assuming a non-stepper motor would simply use one of the PWM inputs on the board to control the speed of it.

From that, I would imagine you could control it several ways.
1. Use a potentiometer to change these values, and have the code read it and adjust.
2.Use a IR remote to increase/decrease etc. Again, have the code read it and adjust.
3. Handle everything within the code itself. You'd have to use some other sensors to stop it from hitting everything.

Or a combination, which is what I think you're trying to achieve?
 
Yeah, I want to do three things:

1. Use photoresistors at different points on the car and have it drive towards the one sensing the most light.
2. Use a Ping sensor to make it drive continuously and avoid walls.
3. Use a remote control to set the speed, direction, and mode (photoresistor mode, wall avoiding mode, manual mode)

I hope I'm not getting myself into anything too complex. How exactly are the PWM pins different from the rest?
 
Yeah, I want to do three things:

1. Use photoresistors at different points on the car and have it drive towards the one sensing the most light.
2. Use a Ping sensor to make it drive continuously and avoid walls.
3. Use a remote control to set the speed, direction, and mode (photoresistor mode, wall avoiding mode, manual mode)

I hope I'm not getting myself into anything too complex. How exactly are the PWM pins different from the rest?

It's complex, but not impossible with a bit of learning and some solid work.
PWM:
http://en.wikipedia.org/wiki/Pulse-width_modulation

In essence, PWM allows you to control the motor speed accurately, on a consistent basis.
 
So, I could do something like this? It would take the value from the potentiometer and translate that into a speed for the motor, right? I'm probably all wrong. I was never good at programming, I suck.
Code:
void loop() {
  digitalWrite(motorpin,potentiometer)
  
}
 
5dw84l.jpg

I found an old RC car I had in the garage... The 2 motors are (I think) somewhere around 9V, because the battery pack is 9.6V. Therefore, I will need a motor shield and I will need to hook the battery pack up to the motor shield. The Arduino, surprisingly, CAN power the car just by itself, as shown in the picture, but the wheels turn extremely slow and stop if you place a finger on one.
Will I be okay if I hook the 9.6V 800MAH battery pack up to the Arduino Motor Shield?
Can I use the battery pack as an external power supply?
How am I going to be able to power these motors?
 
Last edited:
*snip*
I found an old RC car I had in the garage... The 2 motors are (I think) somewhere around 9V, because the battery pack is 9.6V. Therefore, I will need a motor shield and I will need to hook the battery pack up to the motor shield. The Arduino, surprisingly, CAN power the car just by itself, as shown in the picture, but the wheels turn extremely slow and stop if you place a finger on one.
Will I be okay if I hook the 9.6V 800MAH battery pack up to the Arduino Motor Shield?
Can I use the battery pack as an external power supply?
How am I going to be able to power these motors?

It looks like you're making good progress. :) I do however have a few suggestions.

I think you should pick yourself up a multimeter so that you can measure voltages of things (like the motors) so you don't end up burning a component that takes 5 volts because you ran 9 volts through it.

As for your shield, depends on the model, some will take external power sources, some will not. You will need to read up on the documentation that was included with your shield to understand how to properly utilize it best.

I also recommend you check out an electronics forum instead of CF so you can get some better help.
 
It looks like you're making good progress. :) I do however have a few suggestions.

I think you should pick yourself up a multimeter so that you can measure voltages of things (like the motors) so you don't end up burning a component that takes 5 volts because you ran 9 volts through it.

As for your shield, depends on the model, some will take external power sources, some will not. You will need to read up on the documentation that was included with your shield to understand how to properly utilize it best.

I also recommend you check out an electronics forum instead of CF so you can get some better help.

This is the shield I'm planning on getting: www.adafruit.com/products/81

And yeah, I really want a good quality multimeter, but being 14 money is hard to come by. :P
 
Back
Top