Build 1 - Please Review!

Hi all, I'm an 18 year old from South Africa interested in all aspects of technology! I hope to enter a Bsc in Computer Science next year at UCT in Cape Town. I am even thinking of going further and doing more afterwards for some crazy reason but thats later.. anyways!

Right so this will basically be my first build from scratch, my own design etc. Being my first build I want to keep it as simple as possible so please comment on anything, I don't mind.

Skills:

  • Have experience in RC not vast amounts, but I know the basics I'd say.
  • Able to program in Java and know basic logic and arithmetics etc.
  • Willing to put in effort to learn, and put it to practice!
What I have:
  • Charger: Swallow AC/DC2 Digital Peak Charger.
  • JR Spektrum DX6 (not sure if I will need it at all).
  • Batteries: (7.4V 800 mAh 2-cell Li-Po) x 2, (7.4V 300/340 mAh Li-Po) x 2, (11.1V 800 mAh Li-Po) x 1
  • Servos: JR Servo (ES 539) x2 (not sure if I can use these).
The Idea:
Basically I want to make a robot that just avoids walls, obstacles etc. I have this in mind. Two wheels and a little guide wheel with the IR Range finder on a servo.
Questions:
  • I have no experience with microcontrollers, does the Arduino Duemilanove have all the features I would need for controlling the motor, servos, IR range finder etc?
  • When looking for motors is there anything to be aware of? Should I use geared motors or not?
  • What connectors and wires will I need? Heat shrink?
  • Have I left anything out?
  • Suggestions?
Please review this list and add information that maybe I have left out or am not aware of, comment, etc on anything. I'd like to get a lot of input if possible! In terms of motors, wheels, wires etc am I looking in the right direction, or do i need guidance?
Many thanks
Sync.

 

 

Quick question, would
Quick question, would getting a different type of Arduino controller allow me to skip the H-Bridge part or is it always needed, and say I choose to use the Duemilanove how do I go about connecting the H-Bridge to it? I’d guess a guide is on google somewhere I will check!

I just saw on the tutorial
I just saw on the tutorial that one can control 2 motors. /slap self!

Hint!
I prefer ultrasonic rangefinders, as they use sound, not light. Therefore, you can use them in direct sunlight, not to mention the fact that they give a serial input, not an analog one. For a beginner, I’d heavily reccomend the PING))) By parallax. YOu can pick it up in your local radioshack.

Unless your robot will be in
Unless your robot will be in the living room and encounter objects like a soft couch or a pillow, which will negativly affect the ultrasonic rangefinder :wink: They both have their plusses and minuses.

An option

If you wanna make things easier and are prepared to spend a little more you could get a MOTOR SHIELD for the Arduino. They are boards that plug into the Arduino and provides a “plug and play” interface for motors. Like this one:

adafruit-motor-shield-kit-arduino.jpg

H-bridge
What about hacking the servo’s you already have for continous rotation, that way you don’t need an H-bridge ?

Thanks for the comments

 

Thanks for the comments please keep them coming! <o:p></o:p>

@Benbo231 - I was thinking of doing that at one stage. That could be a new question - I want to use this bot mainly indoors of course, but I am worried about the sunlight issue. Any suggestions as to which would be better for indoor that won’t be affected by sunlight etc.<o:p></o:p>

@butra - I would consider hacking the servos to use them as motors but I think it would be a better learning experiment to use DC motors etc, as you can see I need to know what is going on ^^.<o:p></o:p>

@Aniss1001 - That option is looking good at the moment, I’m just wondering would that complicate the coding side at all? Or is it something that I would just need to wrestle with etc. Another thing, if I used that shield where would I connect my Range finder/Ultrasonic sensor. Let me check quick maybe I can see.<o:p></o:p>

Summary:<o:p></o:p>

  • Ultrasonic or IR?<o:p></o:p>
  • Arduino + Motor shield - where do I connect the Ultrasonic/IR (no space or am I wrong)?<o:p></o:p>

Edit: <o:p></o:p>

  • I’m actually not sure what path to take at the moment in terms of the microcontroller and the controlling of the motor.<o:p></o:p>
  • What are your suggestions on using an Arduino against maybe making my own microcontroller or such?<o:p></o:p>
  • The one thing that is giving me a headache at the moment is I don’t see any space for any other I/O devices when the motor shield is on. <o:p></o:p>

Any help on these topics is appreciated!

 

Thanks
Sync. <o:p></o:p>

 

I built my first arduino
I built my first arduino robot using the arduino in combination with the adafruit motor shield and I can assure you that it does not complicate the software side whatsoever. The motorshield does not use digital pin 2 nor the analog pins of your arduino, just solder some conectors to these free pins and you can hook up extra I/O to the free pins. My paralax ping sensor is connect to the pin 2. The analog pins can be switched to digital mode via software.

Arduinos and motors

Motor shield: I also think it’s odd that they didn’t include the headers for the other I/O pins on the motor shield. I think the idea is that you can put them yourself. Which may be an advantage since you can choose what kind of connectors you wanna use. Besides I’m not sure if they even come assembled or you have to solder ALL of the components yourself, which frankly doesn’t seem that easy to me. I just mentioned it as an option. Personally I’m making my own motor controller circuit based on an L293D chip to go with my Arduino board :wink:

Microcontroller: There are TONS of manuals and info on making your own Arduino boards. Basically a standalone Atmega168 or 328 chip can be used as an Arduino, as long as it has the Arduino bootloader. Allthough it is recommended to add as a minimum a resetbutton and a 16Mhz crystal or resonator. The nice things about the boards are that they come assembled and ready to use. Plus they have all sorts of safety feaetures. It’s somewhat easier to fry the homemade boards I’ve seen. Besides you’ll still need a FTDI cable (for interfacing with your PC) if you make your own board. Unfortunately the FTDI chips do not come in DIP form, so you’ll need a breakout board and suddenly the homemade solution becomes more expensive and quite a bit of a hassle. These are build into the boards so you just plug’em into your USB and you’re good to go.

SO… It all comes down to how easy/complicated you wanna make things for yourself. And off course how much money you wanna spend. I would definately recommend getting an Arduino board (I’ve seen the Diecimila as low as us$20). Once you have the board it’s easier to understand how it all works and then for future project you could DIY. Plus if you buy an Arduino you can later on use this to program OTHER Atmega chips (unless you get the Seeeduino clones that has the smaller chips!!).

Hmmm…

"The motorshield does not use digital pin 2 nor the analog pins of your arduino"

Does that mean that it uses ALL the other digital pins? 13 of of them? I just don’t see why? 2 for servos, and seemingly 11 for motor control?

Anyway this option is looking less and less attrictive to me…

** I’m actually studying for**

I’m actually studying for finals at the moment so a quick response.

@pt3r - That sounds like a great plan.<o:p></o:p>

@Aniss1001 - I don’t know if this is correct but maybe the fact that it takes up so many pins is because it can control 4 DC motors and 2 Stepper motors as well as the 1 Servo? I think that would be sufficient amount of motors for us! I think I will be going for the Arduino board and Shield for my first bot, then I may try build my own microcontroller from that experience as you stated for future projects! I’m so excited to do more research and stuff but I need to study a bit more first, maybe I will have an hour tonight!

I think I will go ahead and draw up a sketch of how things are looking in my mind for you guys to compare in case I am off course!<o:p></o:p>

Back to studying IT…<o:p></o:p>

Keep the info rolling, thanks!
Sync.

Update @ Rudolph. Thanks

 

@ Rudolph - Thanks for the help thus far! I found 2 guides for the H-bridge:

 

 

The guides say it can reverse the direction of the motor, so if I have two motors would that mean I need two H-bridges in order to have differential drive?

Thanks
Sync.

 

The motorshield can drive 4

The motorshield can drive 4 motors at the same time + 2 servos or 2 servos and 2 steppers. You have to solder it yoursef but it is not that complicated if you can use a soldering iron (a skill which is almost mandatory if you want to build robots IMO). The building instructions are very detailed and thorough.

 

more info regarding used pins (www.adafruit.com):

What pins are not used on the motor shield?

All 6 analog input pins are available. They can also be used as digital pins (pins #14 thru 19)

Digital pin 2, and 13 are not used.

Digital pin 11: DC Motor #1 / Stepper #1 (activation/speed control)
Digital pin 3: DC Motor #2 / Stepper #1 (activation/speed control)
Digital pin 5: DC Motor #3 / Stepper #2 (activation/speed control)
Digital pin 6: DC Motor #4 / Stepper #2 (activation/speed control)
These pins are in use only if the DC/Stepper noted is in use

Digital pin 4, 7, 8 and 12 are used to drive the DC/Stepper motors via the 74HC595 serial-to-parallel latch
These pins are in use if any DC/steppers are used

Digitals pin 9: Servo #1 control
Digital pin 10: Servo #2 control
These pins are used only if that particular servo is in use

 

 

Hmmm…

Still can’t make sense of it. It uses a 74HC595 shift register which to my knowledge uses 3 I/O pins and provides 8 outputs. These 8 outputs should be enough to control 4 dc motors + the 4 PWM pins. That’s 7 I/O’s in total. 7 plus 2 (servos) makes 9. So you should be able to control 4 dc motors and 2 servos and still have 5 I/O pins left?!

Anyway unless you truly NEED 4 dc motors (or 2 steppers) I don’t see the point of the board. Since you have to solder it anyway yourself I don’t see a lot of advantages compared to buying an L293D chip and going at it yourself. I just bought one today for ~3-4$ and got it up and running in a matter of minutes. I also bought a few 74HC595 chips for ~0.30$ each.

The ONLY advantage I see is that it plugs into the Arduino. For some reason the Arduino designers decided to put ½ a pin spacing between I/O pin 7 and 8. Therefore you can’t make your own shields using standard protoboards :frowning: The most annoying thing about Arduino I can think of.

And yeah soldering is mandatory if you wanna build robots. But for me the soldering is the most boring, frustrating and difficult part of it all so I prefer to keep it to a minimum. Especially these premade PCB’s where everything is put close together, and your margin of error is rather small. For some reason it’s easier on a protoboard (?).

So all in all if you’re planning to use only 2 dc motors I’d actually recommend just buying a protoboard and a chip and go at it yourself.

Here is a video that explains how an L293D chip works in a way that even noobs (like me) can’t possibly misunderstand. Plus the accent is GREAT :smiley:

dev.emcelettronica.com/microcontroller-motor-interface

H-Bridge versus NPN Transistor

If you don’t have an H-bridge IC, would an NPN transistor work as an amplifier? I’ve played around with DC motors that I would not drive off the Arduino, using an NPN when I had no H-bridge IC. Part of the fun of experimentation is improvising, and substituting an NPN might be good enough.

-John

e.g. https://www.robotshop.com/letsmakerobots/node/340 has some NPN amplifier instructions.

H bridge

To make an H-bridge yourself you typically need 2 NPN and 2 PNP transistors.

Take a look at this thread where some circuits are posted:

letsmakerobots.com/node/11772

oops, I wanted to add:

I also wanted to post this link (from Adafruit):

http://oomlout.com/products/ARDX/ARDX-experimenters-guide-WEB.pdf is part of an Arduino kit that controls a motor with a transistor. See page 12 of the booklet.

Also, that’s a neat way to build an h-bridge when L298’s don’t ship cheaply! (node/11772) I don’t fully understand the benefits of the H-bridge, so I need to do some research.

More H-brigde

This pretty much covers it (you use an H-bridge to change DIRECTION of a motor):

www.mcmanis.com/chuck/robotics/tutorial/h-bridge/index.html

Great to see input on the

Great to see input on the H-bridge side of things thank you all for the contributions!

My head needs a little help in catching up to the technical side of things.

I have a few points that maybe you all can elaborate on:

  • I haven’t yet made a circuit myself and I hope i won’t solder it really bad. So if I do take the L293D route I would need some kind of step by step instruction on first making it, then hooking up to the Arduino. Everything seems a bit foreign to me at the moment I have looked for some guides on the H-bridge but none seem to be really in depth and I’m worried I 1. Forget to order some part that I need. 2. Connect it wrong and blow it. So my option here would be make my own H-bridge to control 2 DC motors. I’m just worried about how I’m going to go about getting the parts and knowing that I have them all for it to work, as well as having some guide or helping hand in the process if I don’t know whats going on!

  • The other option would be getting the Motor Shield by Adafruit. Now I have some questions about it. First of all say I wanted to use it later on for 4 DC motors it would probably be the best buy I’m guessing. The real thing I’m worried about is that I saw the shield outputs 0.6A. Will this be enough for a small DC motor such as (http://www.hobbyengineering.com/H1415.html) specifically (or would you suggest something else). It says it uses 670mA at stall and 73.2mA free running @ 5V. So I’m kind of in the dark here! I saw on one H-bridge guide the motor uses 12V or something (11.1V). I can’t seem to grasp the concept of the voltages on motors and how the relate to other things like the H-bridge. I need some clarity on the workings of the circuit or maybe a buddy to show me how this works.

  • I was thinking maybe someone who is interested with helping me out could MSN with me or post some guides/info to enlighten this darkened mind here.

    MSN: [email protected]
If any of you could please compile a list of links to useful information or something to that effect or add me to MSN so we can work this out… or me actually, I really want to grasp these concepts. I understand how the H-bridge works I just don’t know the technical side, the resistors, Voltage regulators, pins etc. that is where I’m falling down.
Any help will be appreciated!
Thanks
Sync the new dude.