Let's Make Robots!

"First Robot" Problems!

Hi everyone, 

I made my first robot according to the instructions from HERE : http://communityofrobots.com/tutorial/kawal/how-make-your-first-robot-using-arduino

After constructing the body and circuit of the robot, I put in the servo program, and that works fine so thats good

then i put in the sensor program, and when i upload it and it starts, i can see all the values come in on the serial monitor, but it doesnt vary much even if i put stuff in front of it (the number is supposed to get larger right?) but its stays within the range of like (0-200) and only when i use my finger to completely cover one of the lenses then all the numbers just become 00000000000
Then i tried putting in the motor program (for the wheels) and like the motors like completely just dont run at all, even if i set both to 'HIGH' and everything, i checked the circuits multiple times, and im pretty sure that i got it all right... but yeah, im not sure why it just like doesnt seem to be working, Oh and i'm not sure if this is supposed to happen, but when i take out one battery and put it back in for the 6V battery pack, the servo turns a bit (like, im not sure if thats supposed to happen) 
(also just a note, i used a H-Bridge motor driver IA instead of a L293D motor driver, because the person i bought it from said it could be substituted pin for pin)
Yup so i was just wondering what could be wrong, because i spent the whole of yesterday trying to figure it out and i couldnt, it would be great if you could help, Thanks!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Calculon added another picture to his post above. He thinks this might be your problem.

Ok. i followed your diagram and played around a bit and i have come up with this

As you can hopefully see, the 6v now goes directly to the voltage rail (36), and the connection to the servo red wire is on 38, and the connection to the sensor red wire is on 32. Ok, so what happens now is, when the USB is connected, everything is fine and dandy, (the servo works and so does the sensor) when the USB is disconected however, the servo makes these really weak pathetic lethargic attempts at movement (like its not getting enough power) and i don't know if the sensor works because i cant monitor the readings

for whatever reason, the servo is relying on the 5v coming from your computer instead of the battery

im answering before reading but...

have you made sure you put pauses after each servo command to allow it to reach its position?

Ok great, i used the voltmeter to check my 9 volt battery and it was only giving like 8 volts so i went out and bought a new battery and replaced it, now it works fine.

On to the Motor! hahaha (i really appreciate all the time and effort you guys are putting into helping me by the way, this is the first time i'm using a forum and i must say i did not expect people to be so helpful)

we can be grumpy too

it must be a thursday thing

Ok, i got someone to look at it, and we finally realised that the problem is that the stupid bread board Voltage rail does not run all the way through! thats it! i just shifted all my stuff up a bit and now its works great! Thank you for all your help :)