Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: TheChickenMaster on October 22, 2008, 12:01:00 PM

Title: Sensors with Arduino
Post by: TheChickenMaster on October 22, 2008, 12:01:00 PM
Hey guys!
I need a bit of help here. Wich kind of proximity sensor should I use to plug on a Arduino Diecimila?
The goal is to make a robot that detect eventual obstacle to avoid it.
Tks
The Chicken Master
Title: Re: Sensors with Arduino
Post by: Trumpkin on October 22, 2008, 12:03:51 PM
Sharp IR sensor http://www.societyofrobots.com/sensors_sharpirrange.shtml
Title: Re: Sensors with Arduino
Post by: TheChickenMaster on October 22, 2008, 12:16:30 PM
Thanks buddy!
Title: Re: Sensors with Arduino
Post by: ceruleanplains on October 22, 2008, 12:17:33 PM
Buy three.  Two for the robot now.  One for when you blow one of them up. :-D
Title: Re: Sensors with Arduino
Post by: TheChickenMaster on October 22, 2008, 12:28:18 PM
Lol, tks for the advice, it will probably happen.
Title: Re: Sensors with Arduino
Post by: TheChickenMaster on October 22, 2008, 12:51:46 PM
I got another question,
Building a robot is part of one of my class, and I don<t know that much about electronics. So how do I connect my motors (physically) to my board?
Here s a pic of my motors and board to help:
http://img265.imageshack.us/my.php?image=armnwires008syw8.jpg
Title: Re: Sensors with Arduino
Post by: Trumpkin on October 22, 2008, 12:52:54 PM
an H-bridge http://www.societyofrobots.com/schematics_h-bridgedes.shtml take some time to read the tutorials on the main page. Also check out this tutorial http://www.societyofrobots.com/member_tutorials/node/159
Title: Re: Sensors with Arduino
Post by: TheChickenMaster on October 22, 2008, 12:54:07 PM
Tks!
Title: Re: Sensors with Arduino
Post by: Trumpkin on October 22, 2008, 01:00:07 PM
You might want to consider using servos instead of motors.
Title: Re: Sensors with Arduino
Post by: TheChickenMaster on October 22, 2008, 01:03:34 PM
I'm a bit short in supply and time, so is it essential?
Title: Re: Sensors with Arduino
Post by: Trumpkin on October 22, 2008, 01:05:41 PM
No, it isn't essential, it's just easier to use servos then motors.
Title: Re: Sensors with Arduino
Post by: TheChickenMaster on October 22, 2008, 01:21:26 PM
How do I convert my motor wires into a hook-up wire?
Title: Re: Sensors with Arduino
Post by: Trumpkin on October 22, 2008, 01:33:25 PM
The motor wires ARE hookup wires  ;D. Solder on some solid core wire to your motor wires to make them easier to connect to you motor driver.
Title: Re: Sensors with Arduino
Post by: TheChickenMaster on October 22, 2008, 01:37:54 PM
Is there anyway to do it without soldering, I<m in class right now and I don't have all my equipment. I just want to run some test on my motors.
Title: Re: Sensors with Arduino
Post by: Trumpkin on October 22, 2008, 01:45:50 PM
You cannot connect the motors directly to the arduino, you need an H-bridge. If you make the H-bridge you will need either a soldering iron or a breadboard. You could also just buy an H-bridge. Scratch what I said about soldering on solid core wire, that kinda depends on you motor driver.
Title: Re: Sensors with Arduino
Post by: TheChickenMaster on October 22, 2008, 02:34:12 PM
Wich kind of H-bridge should I buy?
Title: Re: Sensors with Arduino
Post by: bens on October 22, 2008, 05:13:57 PM
That will all depend on your particular motors.  First you should figure out how much current they draw when stalled at the voltage you plan on running them, which will in turn tell you how beefy of a motor driver you need.  Then consider buying a motor driver (http://www.pololu.com/catalog/category/11) (usually an H-bridge or dual H-bridge that requires low-level command signals such as PWM and direction from a microcontroller) or a motor controller (http://www.pololu.com/catalog/category/10) (a motor driver with an integrated microcontroller that is preprogrammed to generate the low-level control signals in response to higher-level commands from your microcontroller, such as serial packets, RC pulses, or analog voltages).  Motor controllers are typically easier to use, but they are also more expensive.

- Ben
Title: Re: Sensors with Arduino
Post by: TheChickenMaster on October 27, 2008, 02:56:20 PM
does this one could do the job?
http://www.robotshop.ca/home/products/robot-parts/microcontrollers/pololu-microcontroller-en/pololu-baby-orangutan-mega168-controller.html
Title: Re: Sensors with Arduino
Post by: MaltiK on October 27, 2008, 04:27:40 PM
Thats an overkill, just buy a L293D, for $2.00
Title: Re: Sensors with Arduino
Post by: TheChickenMaster on October 28, 2008, 12:27:07 PM
The motor controller prob as been fixed, and I got my sensors. How can I plug them into my arduino?
Title: Re: Sensors with Arduino
Post by: Trumpkin on October 28, 2008, 08:13:46 PM
Connect the signal wire of the sensor to an ADC port of the microcontroller connect positve to regulated 5v and ground to ground.
Title: Re: Sensors with Arduino
Post by: TheChickenMaster on October 29, 2008, 11:10:44 AM
That's part of the deal, no wires, just pins. I read that I could solder wires on my pins, but it seems not a got idea at all. What should I do?
Title: Re: Sensors with Arduino
Post by: Trumpkin on October 29, 2008, 12:10:28 PM
What do you mean?? Soldering wires to pins sounds fine to me.
Title: Re: Sensors with Arduino
Post by: TheChickenMaster on October 29, 2008, 04:04:23 PM
Well you'r probably right, it was just a feeling I got.
Title: Re: Sensors with Arduino
Post by: TheChickenMaster on October 29, 2008, 04:49:06 PM
I'm looking at the sensors manual right now and I have to admit that i'm a bit lost. I'm french and not a pro in electronic, both make it hard to understand wich pins are what.  :-\
here's the link for the manual, if somebody could take a look and give a hand.
Title: Re: Sensors with Arduino
Post by: Admin on October 30, 2008, 11:13:30 PM
errrr you forgot to post the link :P

also, you didn't say what you were trying to do with the sensor and what part was confusing ;)
Title: Re: Sensors with Arduino
Post by: TheChickenMaster on November 03, 2008, 04:05:08 PM
Woops, sorry about that.
heres the link: http://www.robotshop.ca/PDF/gp2y0d340k-manual.pdf

I'm confused by the pins, wich ones do what?
Title: Re: Sensors with Arduino
Post by: Admin on November 06, 2008, 02:44:50 AM
I can see how this is a little confusing (it took me a bit to understand myself). In the datasheet on the bottom right of the first page you will see a schematic. Wire your sensor just like you see.

1) Vcc is your regulated input voltage (5V).

3) Vo is the output voltage that goes to your mcu ADC.

4) GND for ground

(the schematic tells you where the other pins go)