My background: I have years of programming experience and have always tinkered. I own lots of components and have built many a circuit using various arduino microcontrollers (love them because I can program them with a C-like language!) - but most of the circuits I've built are because I've read a tutorial, and followed directions, without ever understanding the "why's" of most parts I've used.
I understand the concept of a relay - powering a relay to switch a higher load power on and off (basically).
I also understand that transistors can be used in the same manner, although to a much much lower degree. I've used them in the past, again, following online instructions or guidance.
This time, I'm trying to go off script and build something of my own, and I'm at the limit of my knowledge and googling has stopped giving me any help. So, asking some experts here to help me understand the how and why of it.
I'm building a toy for my cat, which uses an accelerometer to detect when it's moving, and after it stops moving for a bit, it is to jump/move/shake/etc. I'm doing this by mounting a shaft inside a cylinder, and using a tiny DC motor, spinning the guts of the toy around the shaft, in essence, turning the entire thing into a large vibro motor, but with much more force.
The motor pulls 60mA of power, more than my Arduino can supply on one pin. So it needs to be switched. Enter my transistor.
The code runs, the toy "works" but the motor never turns on. No tools to build a schematic so here's a simple text breakdown of the circuit.
Powered by 2 LR44 button batteries, about 3.1v total. Battery + goes to power arduino, and splits off into the collector of the NPN 2222 transistor.
The emitter of the transistor connects to the motor. The other lead of the motor to the battery ground.
Arduino pin 3 connects to the base of the transistor, with a 560ohm resistor in between. I found that value using an online calculator.
When the arduino turns on pin 3, testing with my multimeter, this is what I find:
Voltage into collector from battery is about 3v
Voltage into the resistor leading to the transistor base is about 3v.
Voltage out the resistor into the transistor base is about 1v, which seems right given the numbers the calculator was showing me and the saturation voltage for the transistor.
Voltage out of the emitter to the motor? I see it peak at about .3 volts or so. The motor is only on for short bursts (half a second) so its hard to say, but it's obviously nowhere near enough to run the motor.
What am I doing wrong? I'm obviously fundamentally misunderstanding something and either have something wired wrong, or... I don't know?
Thanks for any input.