Pololu Robotics & Electronics
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

Interface with a solenoid coil

i am attempting to interface a solenoid coil (air wound, no core) with 250’ of 22 ga. wire with about 4.2 Ohms resistance. I am using a Polou G2. The objective is to reverse polarity 2 to 4 times per second. Do I need to interface the inductive load with a capacitor across the output contacts? The battery is 12 v. The actuator works fine with a pole reversing relay, but not with the pololu. The. coil operates much hotter with the pololu


We make several different G2 boards, from our Simple Motor Controllers, Jrks, and High-Power Motor Drivers. Can you tell me what specific G2 board you are using (i.e. the product number)? Can you link me to the product page or datasheet for the relay and solenoid you are using? Are there any differences in your tests beyond switching between the G2 board and your relay? How much hotter does the coil operate using the G2 board? Does the solenoid work with it besides heating up?


Hi Tony and Thanks for your prompt response.

You have a wonderful array of drivers. I have a Pololu G2 High Power 18V25 module.

The pole reversing relay used previously is a simple ice cube 12V 4PDT relay that (importantly I think) breaks before the contacts make. It is presently manually triggered with an external momentary contact. I have also used a 555 timer circuit (with output
relay) which also works well.

The solenoid coil is about 6" diameter and 1" long and has about 5 layers of 22 ga. insulated copper magnet wire and is wound around a 3D printed spool (hence, without a core or armature). It makes a fairly strong magnetic field (about like a quarter sized
neodymium magnet) which is merely broadcast into space. When operating with the G2, the coil does alternate (reverse) the magnetic field. The G2 board is actuated with an arduino at variable hz.

I feel like the field alternates in a ‘spiky’ manner, I do not have an O-scope. The coil was only slightly warm to the touch when operated with the relay. It is now much warmer, almost to the point of worrying about warping the plastic spool (PLA), but not
too hot to touch.

Initially I powered the G2 coil energizer with a 12V 30A computer type switching power supply, and achieved these same negative results. I am now powering it with a 12V (motorcycle) battery.

Therefore I am asking if there is a good way of buffering the coil from the power source. Perhaps I need two capacitors and diodes on the outputs. sortof like a flyback diode, I would use 40V diodes.

Perhaps i went the wrong direction, I was trying to replace the noisy-mechanical contact with a silent driver, but I could have used four solid state relays (SSR’s). The Pololu H-bridge solution sounded good, but is not working out. The expense is a concern
(which is why I avoided the SSR’s) on numerous copies.

Any suggestions? Again, thanks for your help! and Have a good day


Our Pololu G2 High-Power Motor Driver 18v25 uses MOSFETs that have inherent (parasitic) diodes that act as flyback diodes. Could you tell me the inductance of your solenoid? It is possible that your 12V battery could be significantly higher than 12V when fully charged; do you still see the same heating behavior if you go back to your 12V switching power supply? Is heat across the inductor the only issue you have?


Thanks for your continued assistance Tony.

The warmer coil is just a symptom. The device I am powering has magnets that orbit freely on an axis within the hollow coil and self synchronize within the alternating magnetic field at the frequency it is set to undergo pole reversals.
It operates perfectly with the battery and pole reversing 4 pole relay. I am speculating that spikes are superimposed on the square wave, so I was asking if there are interfacing (coupling or filtering) solutions that are sometimes practiced, but I realize
this is not a typical application. I could not find any application notes on your site. The coil is 1” long and consists of about 6 layers of magnet wire with a 6” hole. ¼ pound of copper. The problem is that even though the pulse train is regular, the magnet
rotor will not synchronize. I can only ‘see’ the output waveform with a digital volt meter, which does not read quick enough to measure, I can ‘feel’ the magnetic field with a stick magnet held in my hand, and I will try an analog volt meter set to barely
deflect. It runs at 1 to 5 hz. I’m sure there is a good inductive jolt when the polarity changes. I will check with a wet finger across the coil terminals. I can send a pic of the coil if that would help.

Thanks for any suggestions, can I borrow your spare scope?


Unfortunately, it is hard to tell what is going on in your system without looking at the waveforms with an oscilloscope and we do not have any other advice to offer. If you plan to keep working with (and troubleshooting) electronics especially things like home made solenoids, it is probably a good idea to get some kind of scope.