Pages: 1 2 [3] 4 5   Go Down
Author Topic: 3 wire solenoid  (Read 6840 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 1
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I got the transistors, I got the 222A npn and KSP2907A pnp, I assembled the gates, so I have 2 "gates" , connected to the arduino, but still the arduino cant drive them.

the VDD is external new 9v battery, when I take the Input and connect it to the vdd it drives the relay, but when I connect it to the arduino it wont drive it.

do you have any idea why?

Your solenoid is akin to "common cathode" LED arrays.

The ground connection goes to ground (the cathode) and the two positive connections (anodes) get switched on and off.

This is known as "high side switching" and should really be done using PNP transistors, not NPN as you have.

Using PNP you basically end up with the original source schematic, but upside-down.  Also, note that the switching is also inverted - writing a "HIGH" will turn off the transistor, and a "LOW" will turn it on.

I usually couple an NPN with each PNP to act as an inverter (in fact, I usually use MOSFETs, not BJTs, but that's just me).



Logged

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You do have the external and arduino grounds connected, don't you?
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Offline Offline
Jr. Member
**
Karma: 1
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You do have the external and arduino grounds connected, don't you?

I feel so stupid right now smiley
Logged

Offline Offline
Jr. Member
**
Karma: 1
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

works perfectly..

how much time do you think a circuit like that could hold on a 9v battery?
If i'd use mos instead of npn it should not waste energy when its not used right?
Logged

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Either BJT or FET will have some leakage current, so neither will last for ever.

It will last for quite some time when not actively driving the coils though.
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Offline Offline
Jr. Member
**
Karma: 1
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I guess its more like weeks/months than years right?
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6593
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

works perfectly..

how much time do you think a circuit like that could hold on a 9v battery?
If i'd use mos instead of npn it should not waste energy when its not used right?

The leakage current of those transistors should be negligible, well under 1uA, so there should be no significant loss of battery capacity when the transistors are off.

Did you remember to include a resistor in series with Q1 collector, as per my earlier post?
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.

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Depends on the battery, and how many times you fire the solenoids.
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Offline Offline
Jr. Member
**
Karma: 1
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

works perfectly..

how much time do you think a circuit like that could hold on a 9v battery?
If i'd use mos instead of npn it should not waste energy when its not used right?

The leakage current of those transistors should be negligible, well under 1uA, so there should be no significant loss of battery capacity when the transistors are off.

Did you remember to include a resistor in series with Q1 collector, as per my earlier post?

Actually I didn't remember, today I added a resistor between Q1 and Q2, at first 10k, didnt work, 1k, didnt work, 330m, didnt work. removed all resistors, worked...

I guess I misunderstood you? (Although I dont see anywhere else and the resistor between Q1 and Q2 makes sense..)
Logged

SW Scotland
Online Online
Edison Member
*
Karma: 17
Posts: 1378
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How long will the battery last
Measure the current, look up your battery AH rating, divide AH by current and there is your answer +- 50%
You don't have a meter ?  then why are you playing with electronics ?
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6593
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

Actually I didn't remember, today I added a resistor between Q1 and Q2, at first 10k, didnt work, 1k, didnt work, 330m, didnt work. removed all resistors, worked...

I guess I misunderstood you? (Although I dont see anywhere else and the resistor between Q1 and Q2 makes sense..)

You need a resistor between the collector of Q1, and the junction of Q2 base and R2, to limit the collector current and power dissipation of Q1. A suitable value would be between 10 and 20 times the resistance of the solenoid.
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.

Offline Offline
Jr. Member
**
Karma: 1
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Actually I didn't remember, today I added a resistor between Q1 and Q2, at first 10k, didnt work, 1k, didnt work, 330m, didnt work. removed all resistors, worked...

I guess I misunderstood you? (Although I dont see anywhere else and the resistor between Q1 and Q2 makes sense..)

You need a resistor between the collector of Q1, and the junction of Q2 base and R2, to limit the collector current and power dissipation of Q1. A suitable value would be between 10 and 20 times the resistance of the solenoid.

Yes, I did connect it there. didn't work, how come It needs to be 10 to 20 times the resistance of the solenoid? to my knowledge the only reason to put the resistor there is to, as you said, limit the collector's current, what does the solenoid has to do with that?

Logged

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Actually, is a resistor really needed?

You say it's to "limit the collector current and power dissipation of Q1", but the collector current is coming down through R2, not coming out of the base of Q2.  Q1 is acting to pull the base of Q2 low - a resistor in there will form a voltage divider with R2 and not pull the base down enough.

The current through Q1 is controlled by the base current, which is limited by R1.  The current through Q2 is whatever L1 requires.

I don't see what benefit an extra resistor would have, and I can see how it would stop it working.
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6593
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

Actually, is a resistor really needed?

Without a resistor there, you need to get R1 just right. Too low and Q1 will overheat; too high and Q1 will not supply enough base current to Q2. The problem is, the ideal value of R1 (in the absence of a resistor in series with the collector of Q1) depends on the hfe of Q1, which can vary widely between different transistors having the same part number.

You say it's to "limit the collector current and power dissipation of Q1", but the collector current is coming down through R2, not coming out of the base of Q2.

No, it's mostly coming out of the base of Q2.

 Q1 is acting to pull the base of Q2 low - a resistor in there will form a voltage divider with R2 and not pull the base down enough.

Only if the ratio of R3 (the new resistor) to R2 is too high.

The current through Q1 is controlled by the base current, which is limited by R1.

True; but the collector current of Q1 is the base current times the hfe, and the hfe can vary widely between different transistors of the same type.

 The current through Q2 is whatever L1 requires.

The collector current through Q2 is whatever L1 requires, provided that Q2 has sufficient base current.

I don't see what benefit an extra resistor would have, and I can see how it would stop it working.

The purpose of the resistor R3 is to ensure that Q2 gets enough base current to saturate, but not so much that Q1 overheats. Including R3 will only stop the circuit working if the ratio R3:R2 is too high.

You should choose R3 so that the base current into Q2 is around 1/10 to 1/20 of the current through L1 (hence R3 is 10 to 20 times the resistance of L1, because the voltages across L1 and R3 are very similar, and most of the current through R3 comes from the base of Q2). Then choose R1 so that the base current is at least about 1/50 of the chosen Q2 base current (I am assuming that Q1 has an hfe of at least 50). I would choose R2 to be about the same as R3.
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.

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, so which way should it be connected?



* which.png (20.76 KB, 800x600 - viewed 79 times.)
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Pages: 1 2 [3] 4 5   Go Up
Jump to: