Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Part requirements for a DC solenoid project

Status
Not open for further replies.

JJ2430

Member
Part requirements for a DC solenoid project

Good day all,

I'm looking for an expert advice on a solenoid project and the parts required in order to use it safely.

Project description:
2 push-pull solenoids have to be activated instantaneously by a left mouse click. The same left mouse click will also trigger an action in a program on a pc such as a sound and a visual effect. The software part is already built and ready to use.

Parts already owned:
1- 2x 12VDC 2.5amp solenoids
2- 1x 12VDC power supply 450 watts
3- 1x solderless diy breadboard and accessories
4- Mouse with a wire attached to left mouse button for solenoid activation
5- PC

Parts that need to be acquired
1- 2 NPN transistors or relays to close from a mouse the solenoids DC circuit
2- 2 diodes to protect circuitry from solenoids potential emf return

What I need to know
Many people recommended the use of NPN transistors such as Darlington TIP120 with an added heatsink since these chips can handle high current, they are fast and reliable. Other recommended relays since they can handle higher current but they are slower and more subject to wear over time. My main requirement is to have an instantaneous reaction from the solenoids when the left mouse button is pressed so they are in perfect sync with the pc program. My main concern is that all the examples I've seen were showing lower-power solenoids with NPN transistors. At 2.5 amp each, the force of my solenoids is quite high and I want to make sure that the transistors can handle that power without frying. An other major concern is that I want to make sure that the 12VDC current from the power supply cannot find a way back to my pc through the 5V USB circuit. Should I place a diode on the USB circuit as well to limit the flow to one direction?

Schematic
20190411_solenoid.jpg

Any recommendation from the community would be appreciated.

Thank you!
 
My preference where possible is to use Mosfet in this application, logic level gate versions if needed.
IRL540 etc.
Max.
 
Monitoring the USB data between the mouse and PC, interpreting the left button code, and triggering the solenoid driver circuit might be too much delay. That leaves two ways for your mouse to control both the solenoids and a program:

1. Part of the PC program is to output a bit to an external port such as a parallel printer port or a control line of a serial port. However, the PC you are using might not have either of these, and the later Windows versions do not support direct hardware interaction.

2. Open the mouse, pick off the signal from the left button, and run it outside the mouse to the solenoid driver circuit.

What is your skill set for either of these options?

Also, the circuit to drive the solenoids probably will be more complex than one transistor and one resistor each. Please post a schematic rather than a wiring diagram. To figure out the circuit details, a schematic conveys much more information.

ak
 
Thanks a lot AK

I just updated my wiring diagram based on MaxHeadRoom's suggestions and from other communities. I also modified the USB 5vdc wiring portion to show the external switch that triggers the LMB function and closes the 5 volt loop. Sorry for not having provided a blueprint schematic instead. I will for sure soon.

I chose the option 2 in your comment a while back by soldering two wires directly onto the mouse's lmb terminals. These wires are then connected to a small switch button that would close the loop between the mouse and solenoids' transistors.

Do you think that an optoisolator is required with a Mosfet to avoid current getting back to mobo? I'm also thinking about using a wireless mouse but I'm not sure if the mouse batteries will have enough power to open the transistor's gate. Is a wireless mouse power automatically 5v? I'm not sure.
20190412_solenoid_v02.jpg
 
Last edited:
The average breadboard is not designed to handle 2.5A through its contacts. PCB construction would be better.
 
Thanks alec_t. The picture of the wiring diagram on breadboard was for visual demo and brainstorming purpose. I will do direct soldering with the parts once the final wiring solution is implemented. All the connections will be sealed with thermoplastic tubes. But thanks for underlining that point!
 
Last edited:
Update on the project

My solenoid project is almost completed but I'm struggling with an issue. I hooked up the gate pin of the MOSFET IRL540N to the digital pin 23 of my ESP32 (Wemos D1) but unfortunately the gate is not receiving enough voltage to trigger the circuit. Multimeter shows 2.7 volts on pin 23. IRL540 N-logic MOSFET seems to require at least 3.6 volts. I tested it with 3 AA 1.2 volts batteries and it works. Therefore 1 more volt is required on pin 23 to work. ESP32 is powered by a 5 volt rechargeable battery. The ESP32 mcu requires 2 to 3 volts to operate and send a bluetooth signal to my computer each time I activate a switch on pin 18. That leaves 2 -3 volts for the digital pins. That might be why I can't get the 3.6 volts required on port 23. I think a regular Arduino with no incorporated bluetooth component is able to output 3.6 volt on digi pins but I need bluetooth.

What I tested so far:
- Send the signal of 2 digital pins (23 and 25) at the same time on the gate: not working, still 2.7 volts
- Send PWM signal (100% modulation) from pins 23 and 25 instead of digital signal: not working, still 2.7 volts
- Send voltage to the gate from an external 1.2v battery on top of the signal coming from pin 23: not working

What I didn't test yet:
- Use a pnp transistor on MOSFET gate to get extra voltage: I have one. Need help on how to make it work.
- Use a gate driver on MOSFET gate to trigger the circuit: Don't have one. Need help on how to make it work.
- Use a 1K or 5K pulldown resistor on the gate instead of 10K: I don't think it would make a big difference.

I included a PDF of my latest schematic.

Any advice would be appreciated. Thanks for all your help
20190829-BTController.PNG
 

Attachments

  • 20190829-BTController.pdf
    22.5 KB · Views: 176
Last edited:
What is the nature of the output?
It may need a pull-up (10k) resistor from 23 to 5v.
Or at least some conditioning of the output.
Max.
 
The pinMode(23, OUTPUT) function is used to configure the pin 23 as an output. The digitalWrite(Low or High) function is used to send voltage to the pin. I will add a 10k resistor between pin 23 and the 5 volt. To do so, can I simply hook the resistor from one of ESP32's two 5v pins or do I have to hook the resistor directly to the 5v source? See attached. Thx Max.
WemosD1_WResistor10k.jpg
 
Max, are you sure that there's no risk of damaging the pin23 by hooking it up directly to a 5 volt source since the internal circuit protection of the board will no longer be protecting the pin?
 
If you use a 1k pullup from gate to 12V and a diode with anode to gate/resistor junction and cathode to ESP then it will default to on but will switch off when the pin is pulled low. The switching will be slow but I'm assuming that won't matter.

Mike.
Edit, Note that the motor will turn on during programming and for a short time when reset.
 
Thanks Mike. Can I get your help on how to properly hook up the driver to MOSFET gate+power+GPIO? I've never done it and I can't find an example for my specific hardware.

I also tried to run 5 volts through a 10k resistor, hook it to the gate to give it some extra voltage, and hook the gate to my pin 23 but the gate won't trigger. The 2.7 volts from pin 23 doesn't add up to the 5 volts/resistor. It stays at 2.7 volts. Any reason for that?
 
If you download the datasheet for the microchip TC1427 - dual mosfet driver. The supply should be the 12V and GNG. The ESP pin goes to IN_A and OUT_A goes to the gate. If unused, connect IN_B to GND.

Mike.
Edit, the pullup won't work because the output will pull it down to 3V hence why I suggested the diode - however, that will only allow it to reach 3.7V which may not be enough. Two or three diodes in series MAY work but better to use a driver.
 
Take note of section 3.1 of the datasheet - supply bypassing. These capacitors are important and need to be as close to the chip as possible.

Mike.
 
They should all work and are probably different specs - EG military. I'd just go for the cheapest assuming you need through hole.

Mike.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top