Best way to control solenoids?

Thread Starter

Jagerneu

Joined Aug 8, 2017
12
So in my current project, I have two 12 volt solenoids that I need a way of controlling. I need to be able to;
-control when they fire
-in what order they fire
-how long they stay open

This would all happen in sequence, off of a microswitch. The solenoids themselves would be running off a 14.8 volt Lipo battery, so the controller would have to be able to either take that voltage, or have a separate power source. What would be the best way to do this?

I'm looking for something I don't have to run or start up, it simply does the action when the microswitch is pressed. I'm also not working with a lot of room, so I can't cram a full-size raspberry pi in there. I know there are toys it there like airsoft gun that use fire control units, basically little circuit boards, to accomplish this. I would look into it, but I have no idea on how to program a board, or if I would be able to adjust them afterwords. Any thoughts?
 

MaxHeadRoom

Joined Jul 18, 2013
28,619
It should be simple to do it with a small Micro.
Rather than a 5v regulator, it may be better to use a separate small supply for the μP as it would be very low consumption.
Switch the solenoids with logic level Mosfets.
Anything else in the way of discrete logic or hard wired and relay logic will most likely be need more real estate.
Max.
 

Thread Starter

Jagerneu

Joined Aug 8, 2017
12
It should be simple to do it with a small Micro.
Rather than a 5v regulator, it may be better to use a separate small supply for the μP as it would be very low consumption.
Switch the solenoids with logic level Mosfets.
Anything else in the way of discrete logic or hard wired and relay logic will most likely be need more real estate.
Max.
How would I add the delay between solenoids, as well as control how long they are open, with a simple MOSFET? Wouldn't they burn out from the incredibly high voltage? Maybe I could incorporate an Arduino Teensy to control the MOSFETs, which would in turn control the solenoids?
 
Last edited:

crutschow

Joined Mar 14, 2008
34,285
How would I add the delay between solenoids, as well as control how long they are open, with a simple MOSFET?
You could use 555 timer circuits to control the MOSFETs and provide the delay and ON times.
Wouldn't they burn out from the incredibly high voltage?
You must add inductive transient suppressors, such as a diode across each solenoid coil.
Maybe I could incorporate an Arduino Teensy to control the MOSFETs, which would in turn control the solenoids?
That is certainly a good option.
 

djsfantasi

Joined Apr 11, 2010
9,156
I believe that's intent of the original poster. The MOSFET's are their to control the solenoids. The micro computer drives the solenoids.

Read MaxHeadroom 's response in his reply in Post #2
 

Thread Starter

Jagerneu

Joined Aug 8, 2017
12
You could use 555 timer circuits to control the MOSFETs and provide the delay and ON times.
You must add inductive transient suppressors, such as a diode across each solenoid coil.
That is certainly a good option.
So I found a rather simplified wiring diagram for a 12V solenoid to Arduino using a RFP30N06LE mosfet:


But I have a few questions.
1: The Arduino Teensy can take a maximum of 5V for power, so it wouldn't be able to run off the 14.8V lipo. If I'm running the ground of the lipo through the MOSFET, and that mosfet's ground is being ran through the board, if it not going to fry my board?

2: I assume if I wanted to hook up a second solenoid I would just wire it to a different output than the first one?

I really appreciate the help, I'm a tad rusty on my electrical engineering haha.

The board in question:
https://store.arduino.cc/teensy-3-2-usb-development-board#
 

crutschow

Joined Mar 14, 2008
34,285
1: The Arduino Teensy can take a maximum of 5V for power, so it wouldn't be able to run off the 14.8V lipo. If I'm running the ground of the lipo through the MOSFET, and that mosfet's ground is being ran through the board, if it not going to fry my board?
Yes, you need to be careful of that, so you run the MOSFET ground directly to the battery, not through the board ground.
2: I assume if I wanted to hook up a second solenoid I would just wire it to a different output than the first one?
The sounds correct.
 

MaxHeadRoom

Joined Jul 18, 2013
28,619
How would I add the delay between solenoids, as well as control how long they are open, with a simple MOSFET? Wouldn't they burn out from the incredibly high voltage? Maybe I could incorporate an Arduino Teensy to control the MOSFETs, which would in turn control the solenoids?
The delay produced in the micro program.
What incredibly high voltage are you referring to?
Max.
 

Thread Starter

Jagerneu

Joined Aug 8, 2017
12
The delay produced in the micro program.
What incredibly high voltage are you referring to?
Max.
For I looked further into mosfet's, I had thought that jamming 14.8 volts through then would burth them out, then I found some that can take 60 volts no sweat. I should have done more research before replying to that one haha.
 

jayanthd

Joined Jul 4, 2015
945
Still doing the project ?

Need any help ?

I am interested in Providing a C Code for PIC18F1240 (8 pin PIC) with full circuit which uses LM7805 regulator which drops 14.8V off battery to 5V for PIC12F. Solenoid will get direct 14.8V (not a problem for it). A Power MOSFET (Logic Gate) will drive the Solenoid.

Additionally I can provide an Led which shows the status of solenoid valve.
 

Thread Starter

Jagerneu

Joined Aug 8, 2017
12
Still doing the project ?

Need any help ?

I am interested in Providing a C Code for PIC18F1240 (8 pin PIC) with full circuit which uses LM7805 regulator which drops 14.8V off battery to 5V for PIC12F. Solenoid will get direct 14.8V (not a problem for it). A Power MOSFET (Logic Gate) will drive the Solenoid.

Additionally I can provide an Led which shows the status of solenoid valve.
That sounds great, but there's actually two different solenoids in play, and the timing between each one and how long they stay open needs to be adjustable. Any way you can make that work?
 

jayanthd

Joined Jul 4, 2015
945
That sounds great, but there's actually two different solenoids in play, and the timing between each one and how long they stay open needs to be adjustable. Any way you can make that work?
Yes, I can easily make it with PIC12F1840 or any other PIC microcontroller you choose.

Just tell me in what orders you want to control the solenoids, what delays you want and any other thing you want it to be implemented in the code.

My choice of PIC is PIC18F26K22 (20 pin) or PIC18F46K22 (40 pin, SMD version can be used if needed)

I am here. Just provide the details and also tell me if you want to use a 16x2 or 20x4 LCD to show status of valves, etc...

Another option is to use RTC and LCD and a keypad to program the valve(s) ON and OFF times.


Alternately I can provide two Potentiometers which can be used to set ON and OFF times. ADC will be used to read the POTS and the raw values are converted to say minutes (say max 180 minutes). You can adjust the POTS to get desigred ON and OFF delays for the valves. A button will provide option to select for which valve the POTS will set the delays.
 
Last edited:
Top