I am playing with an animatronic toy I got from a thrift shop. Before I started trying to hack it, there was a rocker switch that when pressed in one direction, made the head turn left, and when pressed in the other direction, made the head turn right. I have hooked this up to my arduino by replacing the switch with transistors, but the head now will only turn right. Without knowing exactly how the circuit board inside the toy works, is there enough information to figure out what I'm doing wrong?
is an attempt to map out what the wiring looked like before I started fiddling with it. I'm pretty sure the motor is a motor rather than a servo, as there are only two wires going to it (with a resistor and a bunch of capacitors on each).
I don't really know what the circuit board does, but I don't want to disconnect it and control the motor directly, because (a) I have no other motor drivers and (b) the circuit board also makes the dinosaur roar and its eyes flash when its head turns. Those are on separate wires coming off the circuit board that have no direct interaction with the motor/switch thing, so I haven't represented them in my diagram.
is what I've done to replace the switch with my arduino (i.e it equates to just the left side of the previous diagram). I'm kind of just guessing that this is the correct approach, so please tell me if it is laughable. In case my drawing is hard to interpret, I snipped the green, red and white wires off the switch. I then put a PN2222A transistor between the green wire and the red wire, and another one between the white wire and the (same) red wire. I connected a 1k resistor to the middle leg of each transistor, and then connected them each to a different arduino pin. I put another wire connecting each of the green wire and the white wire to the common ground pin of the arduino.
I also have no idea about the specs of the motor or anything, so I'm kind of just guessing at what would be appropriate resistors and transistors and so on. Please let me know if I've chosen stupidly.
The problem is that when I send a "HIGH" signal to either
pin of the arduino, the motor turns the same direction. I would have expected it to turn one direction when I send HIGH to one pin, and the other direction when I send HIGH to the other pin.
If we assume that I have wired everything up correctly (i.e. no short circuits, the transistors the right way around, and it does actually match what I've sketched out here), am I doing something else obviously wrong?
I know about the arduino forums, by the way, but I don't think this is an arduino-specific problem, necessarily, so I thought I'd try here first.