electrolock not being switched by transistor BD911

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everyone!

 

I've just created a PCB, it's soldered and everything. Its main goal is to switch an electrolock on and off. The problem is - it doesn't do its job. I replaced an electrolock with an LED (I connect them as an external device - by cables, you can see that on schematics) and the LED was being turned on and off every 1 second (that is what my code was meant to do). I guess there is some current limitation problem - I'm quite new to transistors, this would be my first project where I use one.

 

My transistor is an NPN transistor BD911 , it's most important features are:

  • Vcbo = 100V
  • Vceo = 100V
  • Vebo = 5V
  • Ie, Ic = 15A
  • Ib = 5A
  • hfe should be sth around 35

 

My electrolock draws up to 900mA.

The 7805TV you can see in the schematics is actually a LM1117 (3.3V regulator).

 

In the schematics you can see 300R resistor going to the base of the transistor - but that's a miscalculation. Let me count the actual value here, maybe I'm just doing some mistake:

The supply voltage is U1. The 3.3V voltage coming out of LM1117 is U2.

U1 = 12V

U2 = 3.3V

Ice = 0.9A

hFE = 35

Ib = 0.9 / 35 = 0.026A

Rb = (3.3V - 0.7V) / 0.026A = 100R

 

So putting a 100R resistor between the ATmega pin and transistor's base should be good. I tried resistors less than 100R but the electrolock did not work.

 

What's interesting I created a breadboard solution without a uC and it worked. I just put LM1117 with capacitors, a transistor with a 10R (yes, 10R, not 100R) resistor and it all worked (I was switching the electrolock on and off by putting the transistor's base cable to GND or 3.3V). The only problem here is that all current goes through the LM1117 - which is a bad idea because it gets reaaally hot (I melted my carpet haha :D).

 

Questions:

  1. What am I doing wrong on the PCB?
  2. How to avoid routing all the current through the linear regulator?

 

Kind regards,

Daniel

Attachment(s): 

Last Edited: Wed. Dec 13, 2017 - 05:35 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

With an Hfe of 35 and a load current of 900mA, the base has to be driven with at least 900mA/35 = 25mA. The 100 ohms that you compute depends on the MCU output pin being at 3.3V. But, it is NOT because it has its own internal resistance of about 100 ohms. 

 

You COULD solve this with another transistor, but that adds a lot of complexity if you are not familiar with transistor circuits. I suggest that you replace your transistor with either (1) a Darlington-type transistor, or (2) an N-channel MOSFET (logic level input).

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

West Coast Jim beat me to the same analysis and conclusions, I would pick #2, use an n-fet to do the switching.

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for your comments! I will use your advice, @ka7ehk (I will have to read about both solutions, and will decide then; I will of course take your advice about picking the second suggestion, @ki0bk). I have just one question right now - I really don't understand what the problem is. Could you please describe it in a few more words? I'm not an electronic engineer, barely a hobbist but as a programmer I live from googling stuff so eventually I'll understand what you meant if you are so kind and describe the problem a bit more :).

Last Edited: Wed. Dec 13, 2017 - 06:33 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Where is your schematic??? There is a poor drawing that lacks any wires...if you can't draw one, just use a spreadsheet with pin numbers.  What you provided is ridiculous piece of ****, like some bad joke. 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You probably need a catch diode across the ‘electrolock’

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I see nothing wrong with that schematic. It takes a moment to mentally connect things, but everything that the OP described is there.

 

The fundamental problem is this: you need about 25mA of base current to generate 900mA of collector current from an hfe of 35. You showed that you need a series base resistance of about 100 ohms if that base current is coming from a 3.3V source. So far, you were right on.

 

The part you are missing is that a microcontroller logic output pin does NOT have zero source resistance. For AVR Mega devices at 3.3V, that internal series resistance is around 100 ohms. So, to get the base current you need, you COULD eliminate the discrete 100 ohm resistor that you added. That would work, but I do not like the idea of a high logic output being pulled down to 0.7V every time it turns on. It will tolerate it, it IS within specs, but I just don't like it. This is one choice, but one I do not personally like.

 

Choice 2 to use a Darlington type transistor; these commonly have hfe values approaching 1000. Choice 3 is to use a good logic input power FET; if you get one with Rds(ON) around 0.1 ohms, the voltage drop when the FET is conducting will be around 90mV and the dissipated power will be around 80mW (nice and cool). 

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It takes a moment to mentally connect things

The schematic is supposed to draw out how things are connected together. One should not have to make the connections in their head---that's a recipe to overlook things & gives a lack of clarity. A tech should be able to grab a scope probe & immediately visualize what's connected to what. Unless we were about to be buried under 100's of intertwined, hard to follow connections, why on earth would anyone leave them out?   Otherwise it's creating more of a netlist, not a schematic.  Maybe our super cost-cutting mentality has lead us to this sad state. 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Thu. Dec 14, 2017 - 03:22 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

From the schematic in the OP the 7805 is connected backwards.

 

I missed the text about the regulator....damned smartphone screen is too small

East coast Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

Last Edited: Thu. Dec 14, 2017 - 05:21 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But the OP has explained that in his text. (I also fell for that before reading his text and after I had drafted a long exposee (which thankfully I did not post)

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You should not expect Hfe as 35. It is very unstable non-constant parameter. BD911 datasheet says it fluctuate somewhere between 5 - 250 dependenig on Ib, Ice, Vce, temperature, tranzistore age .... To get Ice ~1A you need to drive it with about 50 - 100mA to be on the safe side. This too much for any MCU. Even your 25mA is just a lot. For switching application is much better use some MOSFET.

However if you have PCB finished, replace BD911 with something like TIP120/122. It is darlington power transistor with hfe at least 1000. So MCU can drive it without any problem. Also seems to be pin compatible and in the same TO-220 package. BUT expect higher Vce saturation voltage ~2V!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for your interest in my question!

 

I now understand the issue and have solutions, I will probably use the one proposed by @the_mios because as he guessed correctly - I finished my PCB and I'd like to avoid doing that again.

I am sorry for the 7805 linear regulator in my schematics - I couldn't have found LM1117 and decided to go with 7805 element, as this was just schematics. I also understand your point, @avrcandies, but why are you so impolite? Did I hurt you or something? I used to create schematics the way you describe them but then I tried this label approach and it suits me better - unless it's unreadable (for me or people willing to help), I'm going to do it this way.

 

I will try changing the transistor tomorrow so if I run into problems, I'll ask here again, I don't expect any issues though  :).

 

Thank you again, have a great day!

Daniel

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

and it suits me better

I'm probably grouchy, since I rcvd a much bigger "schematic" made like this really with just parts all scrambled randomly around & someone asks what's wrong...takes quit a while to find a missed connection, since there is nothing to "see" (which is why it is easy to miss the connections in the first place).  Who wants to wire together 100 parts in their head?

 

Why do you believe this style is better suited?

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I do not believe "this style is better suited". I just wrote that I did not see it as bad or wrong. I did not like it but it had the necessary information. I see no point in turning this into a "conversation/argument" about schematic styles. 

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!