How to activate a 9V solenoid from my microcontroller's pin which supply only 5V?

Discussion in 'General Electronics Chat' started by Vincenzo1309, Jan 12, 2009.

1. Vincenzo1309 Thread Starter Active Member

Dec 28, 2008
57
0
Dear all,

I am now working on my final year project. Now I have a problem, I need to activate a 9V solenoid from my microcontroller's (Basic Stamp 2) pin which supplies only 5V. How can I do it?

One idea is to connect the pin to a transistor, so the transistor can turn on the solenoid for me. Will it work? If it works, what kind of transistor can I buy?

Thanks alot!!!

2. mik3 Senior Member

Feb 4, 2008
4,846
63
Of course you need to use a transistor because the uC can't supply enough current to drive the coil. You can use either a BJT or a MOS transistor. What is the maximum current the coil draws?
Note that if the coil needs AC you have to use a relay too.

3. Vincenzo1309 Thread Starter Active Member

Dec 28, 2008
57
0
Hi, the solenoid is DC-based, so we don't have to worry about using a relay.

I do not really know how much current the coil draws. Is that crucial? As it is a 9V solenoid, can we roughly guess the current rating?

BJT or MOS transistor, is there any serial number I can refer to?

So sorry for inconvenience caused.

4. mik3 Senior Member

Feb 4, 2008
4,846
63
Take a multimeter and measure the resistance of the coil.

5. Vincenzo1309 Thread Starter Active Member

Dec 28, 2008
57
0
Hi, I have just measured the resistance of the solenoid, and it is 8 Ohms.
Is that correct for the resistance of a solenoid?

Since R = 8 Ohms, and Voltage = 9V, therefore I = 9/8 = 1.125A

Is that correct?

6. Alberto Active Member

Nov 7, 2008
169
36
Vincenzo1309, you can use a BD679 which can stand up to 4 A, but in this case you will need a thermal dissipator.

Such a low resistance could indicate that your relay is 9V ac not dc.

A 9 V dc relay will not draw so much current anyway.

Use the schematic attached if you have problem on how to wire the transitor.

Alberto

Last edited: Jan 12, 2009
7. Vincenzo1309 Thread Starter Active Member

Dec 28, 2008
57
0
Hi, but I have tried to activate the solenoid by using 9V dc, and it works perfectly.

Or the way I measured the resistance is wrong?
I just measure the 2 wires that are coming out of the solenoid without activating it, is that right?

I can confirm that the solenoid is a DC type, as its stated by the shop.
Then why does it draw so much current?

By the way, does the relay in your schematic means the solenoid?

8. mik3 Senior Member

Feb 4, 2008
4,846
63
Yes, you have measured the resistance correct. If you want you can power it with 9V and measure the current.

9. thingmaker3 Retired Moderator

May 16, 2005
5,072
6
Solenoids often draw more current than relays. Not much mass to move in a rely, but who knows what a solenoid might have to push or pull on. More mechanical power requires more electrical power.

10. Vincenzo1309 Thread Starter Active Member

Dec 28, 2008
57
0
Gosh!! So my solenoid do need 1.125A to activate.
Is that normal for a DC solenoid?
A resistance of 8 Ohms for a solenoid, is that normal?

11. mik3 Senior Member

Feb 4, 2008
4,846
63
Maybe it needs much current as to create the force it needs to pull the thing. What is the job of this coil?

12. Vincenzo1309 Thread Starter Active Member

Dec 28, 2008
57
0
Well, the coil is actually used to "kick" a small rubber ball. I will be attaching a plastic round piece to move the ball around.

My project is to build a wheeled soccer robot.

Seems like I have bought the wrong solenoid.

13. Vincenzo1309 Thread Starter Active Member

Dec 28, 2008
57
0
Hi Alberto, for your schematic circuit provided, may I know the purpose of the diode 1N4004? For protection purpose??

As there are a lot of part number for it, which one should I buy?

1N4004-A, 1N4004-B and 1N4004-T?

14. Alberto Active Member

Nov 7, 2008
169
36
Yes the diodes is there to protect the transistor. Any one of will suite your need. Remember to connect the white band of the diode, toward the positive.

Even if the coil will be activated for few seconds (As I understand) I suggest you to use a minimum thermal dissipator with the transistor.

I didn't read correctly your post#1, so I thought it was a relay. A solenoid will normally use a lot of current to create the necessary magnetic field.

Alberto

Last edited: Jan 12, 2009
15. mik3 Senior Member

Feb 4, 2008
4,846
63
You buy another solenoid which will need less current but with more turns to produce the same force.

16. Vincenzo1309 Thread Starter Active Member

Dec 28, 2008
57
0

Really appreciate them...........

17. Vincenzo1309 Thread Starter Active Member

Dec 28, 2008
57
0
Hi,

By putting the 1K resistor between the base and the Pin, is it to limit the current supplied to the base? If not, what is the purpose of the resistor?

So since I am using a solenoid, I can just connect the solenoid instead of the relay right (as the diagram shows a relay)?

If I don't use the thermal dissipator, what will happen to the transistor? Damaged?

18. mik3 Senior Member

Feb 4, 2008
4,846
63
If you transistor is capable of passing the current the coil needs you don't need a relay. I suggest you to buy transistors able to drive the coil directly because the response time of a relay is quite slow.

19. Audioguru New Member

Dec 20, 2007
9,411
896
The BD679 darlington transistor has a 2.5V max voltage loss when its collector current is 1.5A and its base current is 30mA. The 1k resistor in the circuit limits the base current to only about 2.9mA. Reduce the value of the 1k resistor to 120 ohms for a base current of 20mA then any BD679 will work. The max allowed continuous current from a PIC output pin is 25mA.

20. Vincenzo1309 Thread Starter Active Member

Dec 28, 2008
57
0
Dear all, thanks lot for your replies.

Is this transistor BD679 sold world wide? I lived in Singapore, and I sometimes encounter parts which are not sold here at all.

So if unfortunately, there is no such transistor sold here, how can I look for another suitable one?

Just choose any one which can supply up to 4A of current?