Guidance on schematic to control 4 solenoids

Hey,
Note, I have absolutely no plan about electronics, that's why I'm asking you to have a look at my build before I burn my house down :slight_smile:

I want to control up to 4 solenoids with a single power source. The schematics is in the attachment. My idea was to use NPN transistors to control my solenoids. Each solenoid has 12V DC and 14W. The idea therefore is that I use a 12V 4A power source. (is that possible?) I saw that I need a resistor of 1kΩ in front of every transistor. I planed in a diode to protect my Arduino from the currents produced by the solenoid. The arduino is powered by USB because I control the solenoids from the computer.

Could my setup work or is there a big mistake? And what transistors and diodes do I need for my setup?

Thank you!

Note, I have absolutely no plan about electronics, that's why I'm asking you to have a look at my build before I burn my house down :slight_smile:

It is said "Knowledge is power..."

however , it should also be said "One should have knowledge before messing with power.. "

FYI, your schematic is useless without the transistor part number.

raschemmel:
It is said "Knowledge is power..."

however , it should also be said "One should have knowledge before messing with power.. "

And that's why I'm here. For the past several days, I read trough similar projects than mine, looked at their setup and experiences and came up with my design. I'm pretty confident that it should work, because every choice I made in the "design" is based on something I read. Now I'm here to seek confirmation of my plan, correction if I made mistakes, and general advice.

How else should I gain the knowledge if no one corrects me when I'm asking for advice? Ditching the project and hoping to get all the necessary knowledge from the stars won't really work I think...

I’m pretty confident that it should work, because every choice I made in the “design” is based on something I read. Now I’m here to seek confirmation of my plan, correction if I made mistakes, and general advice.

The design is incomplete without the transistor part number. and just for the record, no one here on the forum would recommend using transistors. That’s old school. It will work but why use them when the mosfet technology has advanced so much ? The standing recommendation on the forum is use low RDSON mosfets. The reason is based on Ohm’s Law. P = I * V., thus power dissipation of the transistor is the current through the device times the voltage drop across the device. Since Ohm’s Law states that the voltage drop “V” = I * R | where “R” = RDrain-Source, (or RCollector-Emitterthen the power dissipation of the transistor (or mosfet) is P = I2 * R.
Thus, low R, = low power dissipation and often no heatsink necessary.
ie:
Let RDrain-Source = 8 mohms,
Let I = 10A
P = 102 * 0.008 = 0.8 W (800 mW)
Point ? This device could power a 10A load with no heatsink.

Offhand , I don’t know any 3A mosfet part numbers but I am sure someone here can recommend one.

As far as the schematic, my preference would be that it conform to standard schematic format, meaning the solenoids(and diodes) are drawn vertically (going UP, NOT DOWN) (not as shown in all
of these schematics. The load is shown above the transistor , vertically with the power at the top.
Google Search : "driving solenoid with transistor)

Solenoid Tutorial

Have you ever done with even one solenoid before?
My suggestion is that you get one going right and then build up, scale up.
I have modified your drawing with the addition of a connection that so many “with no plan about electronics” do not take into account.

I have modified your drawing with the addition of a connection that so many “with no plan about electronics” do not take into account.

As stated, this is a very common omission.
The solenoid tutorial linked in the previous post shows a way to isolate the arduino from the power/load side of the circuit using an optocoupler. (schematic attached). This is one of the oldest and most often used types of interfaces between microprocessors and the equipment they control. It is not usually necessary for hobbyist projects but is recommended for any commercial or field installed equipment.
Note that the input connector for the opto is simply a connection from a GPIO pin (JP2-1)and arduino GND (JP2-2), while the power side has it’s own separate , isolated GND. Most hobbyists do not use optoisolators but forget (as you did) to connect the transistor circuit GND (the emitter) to the arduino GND.

solenoid-1.png

@OP
Check out your 12 volt connector, the center is usually +

.

Scaling down a bit and keeping a single solenoid in combination with the information you gave me, I did a new schematic. I tried to stay "conform" and rotated my elements, and now looked all the pieces up an included their serial numbers, but I'm not sure if it's the way it should be. I only looked up pieces which are available near me.

As the linked project suggests, I used an optocoupler (KB 817-M) to protect the arduino from any backward current. Then, instead of the old-fashioned transistors, I used an MOSFET (IRLB8748PbF) to control the current. I used an 1kΩ resistor to protect the transistor (is it still called transistor?) and used a diode (1N4001) around my solenoid to protect my circuit against the backward current, once again. As an input source, it's a standard 12V 1A for the solenoid, and the arduino will be powered by USB.

You have no gate drive to the MOSFET at all.

With +12v on one side of the solonoid and -12 on the other side the solonoid will always be energized.

.

Excuse me, that was obliviously not the plan. I updated it:

As noted, you forgot the pullup resistor on the mosfet gate. Without it, it is useless. Go back and look at the schemaitc I posted. The resistor turns the mosfet ON when the INPUT of the opto is OFF , and OFF when the INPUT of tge opto is ON . It is up to you to make sure your coxe takes this into account.

Thank you, I wondered what that part would do in your schematic. I found a nice tutorial on sparkfun which explains the pullup resistor.

If you prefer the solenoid to be normally OFF, then just trade locations of the opto coupler and resistor. That way the solenoid will be OFF if disconnected from the Uno or when the Uno is powered down.

You're missing a series resistor to the IRLED, 220Ω would work well.

I didn't see OP ask for an opto isolated design.

Downside from that design is that the solenoids are ON by default (when the Arduino is off or booting).

The diagram from post#0 (plus ground) is perfectly ok for ~1Amp solenoids and e.g. TIP120 darlingtons.
Supply can be increased to ~13.5volt if you want the full 12volt on the solenoids
(darlingtons have a high-ish saturation voltage).
Four logic level mosfets, 220ohm gate resistors, and 10k pin to ground bleed resistors would be the best option.
Almost the full 12volt available for the solenoids, and no hot transistors.
Leo..

dlloyd:
If you prefer the solenoid to be normally OFF, then just trade locations of the opto coupler and resistor. That way the solenoid will be OFF if disconnected from the Uno or when the Uno is powered down.

You're missing a series resistor to the IRLED, 220Ω would work well.

I changed my schematic accordingly (hopefully) so that the solenoid is turned off by default, and the arduino signal turns it on. I don't understand where I'm missing a resistor (and why).

Wawa:
I didn't see OP ask for an opto isolated design.

Downside from that design is that the solenoids are ON by default (when the Arduino is off or booting).

The diagram from post#0 (plus ground) is perfectly ok for ~1Amp solenoids and e.g. TIP120 darlingtons.
Supply can be increased to ~13.5volt if you want the full 12volt on the solenoids
(darlingtons have a high-ish saturation voltage).
Four logic level mosfets, 220ohm gate resistors, and 10k pin to ground bleed resistors would be the best option.
Almost the full 12volt available for the solenoids, and no hot transistors.
Leo..

You're right, initially I didn't ask for a new design with an optocoupler, just a check if my topological design is correct, and advice on how to chose the right components. As this is my first project, I didn't knew of optocoupler before, so It's no shame that I got introduced to this idea and learn how I can protect my arduino with one. It's nice to be reassured from someone, that my initial work isn't flawed, and that all this extra stuff isn't needed to make it work... Thank you!

The newest schema (with a pull-down resistor?):

Don’t forget to add a series resistor (~220 ohms) to the output pin of the controller.

No LED current limiting resistor could fry the pin.

The "solenoid example" from this site uses 100ohm.
That's 30-35mA pin current for a 1.2volt opto LED and some internal pin resistance.
Bit high for a pin, and likely not needed for a 1k gate pull up/down resistor.
So yes, I agree with a value of 220ohm.
Leo..

So if I now want to use up to 4 solenoids, I can simply increase the amps of my power source and use the same setup for each one?

So now the one " with no plan for electronics" is making a plan ?

The answer to your question is "yes" but FYI , in electronics we say " so now all I have to do is increase the current rating ( capacity) of my source". ( "amps" is a unit of measurement. You would say " increase the voltage" or "increase the current". You wouldn't say " increase the volts" or " increase the amps" , even though someone would understand you either way, for the same reason you would say "turn up the light" instead of "increase the photons".