Go Down

Topic: Troubles when using my first transistor (Read 756 times) previous topic - next topic

xberg

Hello,

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
                                                    -----Flash 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 :)

XBerg

xberg

EDIT: the 1K transistor is no silver bullet. After a few flashes the LCD starts to become garbled as well... If I don't trigger the flash it can run forever :)

jmknapp

I wonder if the flash discharge current is way over the rating the transistor. Wouldn't it be hundreds of amps? Sounds like developed voltages are feeding back into your base lead.

Joe

pwillard

I agree... Some flash units present very high voltages at the shoe.

xberg

Hi,

This is a modern flash - so low voltage. Not sure about current as this is not often discussed in photographers' forums. How would I measure that as the flash takes place so quickly? (I have a multimeter - that's it, and when I connect the multimeter the flash immediately fires, displays 2 mA and then I cannot fire it again as the circuit stays closed.)

rgds,

XBerg

MarkT

I'd assume its high voltage compared to 5V, it might not be electric-shock high, but I doubt its a logic signal. 

But another issue is interference, a flash discharge involves high voltage high current spike, this could be coupling to the Arduino pin and overloading it.  Opto isolator is a wise precaution, and use twisted pair between it and the Arduino.
[ I won't respond to messages, use the forum please ]

xberg


Opto isolator is a wise precaution, and use twisted pair between it and the Arduino.


Thanks for the reply. What do you mean by twisted pair?

thanks

dc42

If you immediately get a garbled screen when using a 100K resistor from the Arduino pin to base, then I suspect there is something wrong with your wiring or the software. If the flash device really needs just 2mA to trigger it, then 100K should work.

Is the flash unit powered independently from the Arduino, preferably from its own battery and isolated from ground apart from where you connect it to the transistor?
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Grumpy_Mike

You can't measure the current with a meter because the spike is way too fast. You need to use an oscilloscope. If you haven't got one then you need one.
It sounds like voltage is feeding back through the grounds and upsetting the arduino. You need an opto isolated transistor or better still an opto isolated FET.

Go Up