Stamp resets when relay is energized to drive dc motor...help
Sarek
Posts: 3
I purchased a stamp II about 10 years ago and before i even opened the package I decided to drop the project I was going to use it on. So, this week I wanted to use it for a simple task. I wanted the Stamp to have an input that would be used as a start button and an output to drive a small 9vdc motor (Toy).
My output circuit is as follows. The output goes through a 390 ohm resister to the base of a 2n2222 transistor. The emitter goes to ground and the collector goes to a one side of a coil of a relay. The other side of the relay goes to +Vdc which is 9 volts (There is a diode across the relay coil). The relay contacts switch 9Vdc (seperate battery source) to the small 9vdc motor.
The program uses a loop to watch the status of the input via a Button command. When the button is pressed, it jumps to code that makes the output go high, then a pause command for 10 seconds and then a Low command to stop the output. It then goes back to the loop to wait for a button press.
I can run this all day without any problems if i don't hook the motor to the relay. The relay will click on at button press and then turn off 10 seconds later.
The problem is when i hook the motor in. What happens is randomely but very often, when the relay is pulled in, the Stamp will reboot. I tried to isolate the signals a little more by having the first relay drive a second relay, but the same thing happens.
What am i doing wrong or what can i add to the circuit to not allow the stamp to reset.
Any help would be appriciated.
Joe
My output circuit is as follows. The output goes through a 390 ohm resister to the base of a 2n2222 transistor. The emitter goes to ground and the collector goes to a one side of a coil of a relay. The other side of the relay goes to +Vdc which is 9 volts (There is a diode across the relay coil). The relay contacts switch 9Vdc (seperate battery source) to the small 9vdc motor.
The program uses a loop to watch the status of the input via a Button command. When the button is pressed, it jumps to code that makes the output go high, then a pause command for 10 seconds and then a Low command to stop the output. It then goes back to the loop to wait for a button press.
I can run this all day without any problems if i don't hook the motor to the relay. The relay will click on at button press and then turn off 10 seconds later.
The problem is when i hook the motor in. What happens is randomely but very often, when the relay is pulled in, the Stamp will reboot. I tried to isolate the signals a little more by having the first relay drive a second relay, but the same thing happens.
What am i doing wrong or what can i add to the circuit to not allow the stamp to reset.
Any help would be appriciated.
Joe
Comments
1) Your 9V power supply for the Stamp is marginal and sometimes, the extra drain of the relay coil causes the supply voltage to the Stamp to drop too low.
2) You've got a ground loop and noise from the motor is coupling to the Stamp supply voltage. If everything has a common ground, try separating the motor's ground from the rest of the circuit.
3) The motor's wiring runs parallel to some wiring in the Stamp side of the circuit and noise is coupling there. Try separating that. Use a twisted pair to connect the motor to the relay and the motor to its power source.
1. At some point during my fustrations, i replaced all batteries with new ones. Same thing continued to happen.
2. I believe it is a ground loop and noise problem but everything i tried did not help. I rewired the circuit so many times. I tried common grounds and seperate grounds... no help.
3. I thought the same thing, that is why i added a second relay which was isolated (not on circuit board) from the other relays and the power for the motor was not wired near the board as well. I did not use a Twisted pair....something for me to try!!!! Thanks.
-Phil
Do you have any filter caps on your motor?
Post a photo of your setup if possible.