I want to trigger a photo flash (speedlight) on an event. Triggering the flash is simple in real life: just connect + and ground - FLASH! No external power involved. I've measured and there's a continuous current of 2 mA and a voltage of 3.2V when the flash is idle and waiting between + and ground.
I've decided to use a NPN 2N3904 transistor as a switch:http://www.datasheetcatalog.org/datasheet/fairchild/2N3904.pdf
An optoisolator would probably have been a better choice - but I did not have any (...well any that worked).
So - I need to send it some current to activate it right? I connected Digital Pin 6 to a 470 ohm resistor. Why 470 ohm? Well - I read the following in the datasheet:
Base-Emitter Saturation Voltage
IC = 10 mA, IB = 1.0 mA
IC = 50 mA, IB = 5.0 mA
I really don't know why I have 4 selections, so I chose the first one, 10 mA
Feeding the arduino's 5V, R = 5 / 10 mA = 500 ohm.
Resistor connected to the transistor's base, emitter connected to ground of the arduino and the ground of flash and collector connected to the + of the flash.
Works very well - a few seconds... After that the other components on my arduino (LCD Screen) start misbehaving very badly (the flash still triggers - no problem). I remove the flash from the circuit and everything behaves normally.
So clearly there is something I really did not understand about transistors. I'm sure it's not too happy that the flash is emitting 3.2V but what should I do about that? Let me try to draw my circuit:
Pin 6 --- 470 ohm resistor --- Base
Emitter ---- Arduino Ground
collector ---- Flash +
And if I replace the 470 ohm resistor "randomly" by a 1K ohm, then all works perfectly.
Where did I go wrong? I probably mis-read the "saturation" line and should instead be thinking "whatever current I put in I can get x times more on the other side... and because the other side (Current-Emitter) only needs 2 mA I only need to feed it a fraction of a mA?"
Yes, but I did the maths again. To get a 2mA current on the base I need a 5/0.002 = 2500 ohm resistor. But I don't need it on the base - I need it on collector-emitter where there's a 40x gain, so if I put a 100K (2.5K * 40) then I'm good right? Wrong. When I tried connecting a 100K resistor I immediately got a garbled LCD screen. So 1K seems to be the sweet spot, but I have no idea why - nor why the other values contaminate my whole circuit...
I randomly got it working which is not a great thing
Sorry for the long winded message... and thanks for any help