Go Down

Topic: Guidance on schematic to control 4 solenoids (Read 1 time) previous topic - next topic

lyinch

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 :)

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!

raschemmel

#1
Aug 06, 2016, 06:44 pm Last Edit: Aug 06, 2016, 06:55 pm by raschemmel
Quote
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 :)  
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.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

lyinch

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...

raschemmel

#3
Aug 06, 2016, 06:59 pm Last Edit: Aug 06, 2016, 07:19 pm by raschemmel
Quote
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
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

runaway_pancake

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.
"Who is like unto the beast? who is able to make war with him?"
When all else fails, check your wiring!

raschemmel

#5
Aug 06, 2016, 08:08 pm Last Edit: Aug 06, 2016, 08:10 pm by raschemmel
Quote
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.

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

larryd

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

.
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

lyinch

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.


MarkT

You have no gate drive to the MOSFET at all.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

larryd

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


.
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

lyinch

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




raschemmel

#11
Aug 07, 2016, 12:00 am Last Edit: Aug 07, 2016, 12:01 am by raschemmel
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.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

lyinch

#12
Aug 07, 2016, 12:20 am Last Edit: Aug 07, 2016, 12:26 am by lyinch
Thank you, I wondered what that part would do in your schematic. I found a nice tutorial on sparkfun which explains the pullup resistor.


dlloyd

#13
Aug 07, 2016, 12:34 am Last Edit: Aug 07, 2016, 12:37 am by 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.

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..

Go Up