PDA

View Full Version : Ahh Help! IR+Ping+Servo



danielcho88
11-20-2009, 12:47 PM
I'm trying to get a PING mounted on a standard parallax servo to look left, front, and right (in a loop) and see if there are objects ahead. There are IR sensors also mounted, and the loop goes as such using subroutines:

Look Forward
Ping with Ultrasonic sensor to see objects (if yes, vibrate buzzer)
Check IR sensor for objects (if yes, vibrate beeper)
Look Left
Ping with Ultrasonic sensor to see objects (if yes, vibrate buzzer)
Check IR sensor for objects (if yes, vibrate beeper)
Look Forward
Ping with Ultrasonic sensor to see objects (if yes, vibrate buzzer)
Check IR sensor for objects (if yes, vibrate beeper)
Look Right
Ping with Ultrasonic sensor to see objects (if yes, vibrate buzzer)
Check IR sensor for objects (if yes, vibrate beeper)

and so on and so forth:

SOMETIMES I would turn on the system and everything will work, but then by surprise I find that my servo twitches and stays "stuck" but the ultrasonic sensor picks up things and the IR sensor picks up things. And then I will return to the circuit a couple hours later after giving up, and everything will work again. Then the next morning, things are back to twitching servo and stuck servo :(

any ideas as to what is happening? This is urgent!

Mike Green
11-20-2009, 01:29 PM
It's a power supply problem. Your Stamp is resetting because the power supply voltage is dropping too low for the Stamp to work properly. Typically this happens as the servo motor is trying to move and its current drain goes way up briefly. If you're using batteries, replace them or (if rechargable) recharge them. If you're running off a power supply, get a bigger one or put a big electrolytic capacitor across it (like a couple of 1000uFs at a suitable voltage).

Mike Green
11-20-2009, 09:38 PM
It is against forum rules to cross-post (post the same or similar message in more than one forum). Please delete your duplicate message in the Sensors forum. Use the "X" icon in the upper right corner of the message to delete it.