Go Down

Topic: can I safely ground 12v (vcc) to digitalWrite(pin, LOW); (Read 424 times) previous topic - next topic

jeanpaulsc

I would like to ground an NPN emitter to the pin adjacent to it's base. Is this a bad idea? The NPN's function is to open a 12v solenoid.

avr_fred

Bad idea? That impossible to say as this statement:
Quote
I would like to ground an NPN emitter to the pin adjacent to it's base.
makes no sense. While it is correct that that you ground the emitter in a typical npn switch circuit, what pin and base are you referring to?

Perhaps a photo to explain?

Wawa

I think OP is asking if you can use a digital output pin as ground pin for the emitter of an NPN transistor that drives a solenoid.
The answer to that is NO.
Because all the solenoid current will then flow through the Arduino pin, which has an absolute limit of 40mA.
Leo..

ReverseEMF

It sounds like you might be talking about this:


And if so, then the way to language this is: The Arduino Digital Output, tied to the Base of the NPN Transistor, through a series [current limiting] resistor, Grounds the 12V connected mystery thing, when D? is HIGH, and un-grounds it when D? is LOW.  D? can be any of the Arduino Digital Outputs. 

A Bipolar Transistor is a Current Amplifier.  In other words, a small current flowing from the Base to the Emitter, controls a larger current flowing from the Collector to the Emitter.

You need the transistor because the Arduino Output mustn't go higher than 0.5V more than VCC.  If the Arduino has a VCC of 5.0V, then the output pins mustn't go higher than 5.5V.  If an output is connected to something that goes to 12V, then, when the output is HIGH, there is the danger of that 12V source pulling the output higher than 5.5V

Also, Transistor selection depends on what it is that you want to switch.  How much current will it draw?  Is it just going to 12V or is there more to the circuit?  We very much need more information to properly answer this question, so if you can provide a schematic or good photo or something that would allow us to know what it is you are trying to do, that would be a BIG help ;)

UPDATE:  I missed that the "Mystery Device" is actually a solenoid, so I added a protection diode to the schematic diagram (above).

Also, if that solenoid draws more than 200mA Max, use a MOSFET.
"It's a big galaxy, Mr. Scott"

| Please DON'T Private Message to me, what should be part of the Public Conversation -- especially if it's to correct a mistake, or contradict a statement!  Let it ALL hang out!! |

RIN67630

I would like to ground an NPN emitter to the pin adjacent to it's base. Is this a bad idea? The NPN's function is to open a 12v solenoid.
Yes, that IS a bad idea.
If you ask, then you probably have got no experience with DC solenoids, which are is one of the weirdest thing in electronics.

If you don't know how to drive them, go for the safe way and use a relay shield.

Southpark

I would like to ground an NPN emitter to the pin adjacent to it's base. Is this a bad idea? The NPN's function is to open a 12v solenoid.
Draw a circuit diagram for clarity. Draw the transistor, and add some text and arrow to point to the terminal that you want to 'ground'. The title of your post is unclear. In general, we want to avoid connecting 'Vcc' to 'ground'.

jeanpaulsc

This is what I had in mind:

(my image was here, but I cannot seem to attach to an edit. Image in 5 min)

It certainly can't draw power from the pin, though it draws very little, but my question was really can I safely ground to a pin set to LOW.

I don't see why not. If not, is there a danger grounding to a GND pin?

Wawa

Image doesn't work.

Setting a pin HIGH connects the pin internally to VCC (5volt) with a mosfet switch with an absolute max current rating of 40mA.

Setting a pin LOW connects the pin internally to GND with a mosfet switch with an absolute max current rating of 40mA.

So you can't 'drain' more than 40mA to ground through an output pin.
Leo..

jeanpaulsc

This is the image (attached).
(Not intuitive. Do I really have to upload it to an arbitrary site?)

Regarding the current limits, does the GND pin have the same limit?

Wawa

The full solenoid current would flow from collector to emitter through the pin to ground, likely blowing the pin.

The base of an NPN transistor NEEDS a current limiting resistor.
Base current for full saturation of the 'switch' should be 5-10% of the collector current, depending on the transistor.
If that's more than ~20mA, then you should switch to a darlington or mosfet.
Leo..

jeanpaulsc

The base of an NPN transistor NEEDS a current limiting resistor.
Base current for full saturation of the 'switch' should be 5-10% of the collector current, depending on the transistor.
If that's more than ~20mA, then you should switch to a darlington or mosfet.
Enlightening. Thank you.

Wawa

A TIP120 is a good choice for a solenoid.
It still needs a base resistor, but base current for that darlington is 1:250 for saturation.
Note the higher BE voltage (~1.5volt) when you calculate the base resistor.
Don't forget the back-EMF diode across the solenoid.
Leo..

ReverseEMF

A TIP120 is a good choice for a solenoid.
It still needs a base resistor, but base current for that darlington is 1:250 for saturation.
Note the higher BE voltage (~1.5volt) when you calculate the base resistor.
Don't forget the back-EMF diode across the solenoid.
Leo..
The thing about a Darlington Transistor is the fairly high Emitter Collector saturation voltage.  A MOSFET is a much better choice.
"It's a big galaxy, Mr. Scott"

| Please DON'T Private Message to me, what should be part of the Public Conversation -- especially if it's to correct a mistake, or contradict a statement!  Let it ALL hang out!! |

Wawa

The thing about a Darlington Transistor is the fairly high Emitter Collector saturation voltage.  A MOSFET is a much better choice.
Not much difference if you power a solenoid with 11.25volt (darlington) or 11.95volt (fet).

Different story if you switch a LED strip.
Then a 1volt drop could have a light power reduction of 40%.
Leo..

ReverseEMF

Not much difference if you power a solenoid with 11.25volt (darlington) or 11.95volt (fet).

Different story if you switch a LED strip.
Then a 1volt drop could have a light power reduction of 40%.
Leo..
Try more like 10.8V, but I get your point -- it's probably a trivial difference [though, with the right MOSFET, that voltage could be closer to 12V -- not sure where you get 11.95 -- but even so, still, probably, trivial], BUT, there is another parameter to consider: Power Dissipation.  With a higher voltage drop across the switch, there will be greater Power Dissipation.  Whereas, with a MOSFET, the Power Dissipation can be nil in all but the most extreme cases.  There is no way to get the Emitter-Collector voltage down on a Darlington -- it will always be at least 1.2V, and probably more like 2V for higher currents.
"It's a big galaxy, Mr. Scott"

| Please DON'T Private Message to me, what should be part of the Public Conversation -- especially if it's to correct a mistake, or contradict a statement!  Let it ALL hang out!! |

Go Up