Pages: [1]   Go Down
Author Topic: Troubles when using my first transistor  (Read 561 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley

Sorry for the long winded message... and thanks for any help smiley

XBerg
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley
Logged

Columbus, Ohio USA
Offline Offline
Full Member
***
Karma: 1
Posts: 110
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Cumming, GA
Offline Offline
Edison Member
*
Karma: 18
Posts: 1628
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Online Online
Shannon Member
****
Karma: 162
Posts: 10513
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

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.

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 514
Posts: 31554
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: