Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:03 08 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Linear Solenoid (push-pull) - PicoMite

     Page 1 of 2    
Author Message
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 419
Posted: 12:09pm 30 May 2025
Copy link to clipboard 
Print this post

Morning all

Looking for "advice" or a change of plan.

I am looking to make a handheld device that pushes a "stylus" at no more than 5Hz for a couple of seconds.  As this needs to be handheld, I was looking at mini solenoids.

As I understand it, something like this:



should do the trick.

It needs 7-12V to drive it.  But, my granted limited, understanding of these is that current is the more essential component - possibly 500mA - 1A.

To drive this I assume I need a transistor and separate power supply for the solenoid.

My questions:

(1) Is operating a solenoid like this on-off-on etc at 5Hz going to kill it?
(2) Is there an alternative to generate in-out motion available (without gears to change rotary to linear -- due to my size constraints)?
(3) My use of a Pico (probably a Zero) would be to have selectable frequencies and duty cycles of the solenoid (but appreciate there are non microcontroller ways to do this)  (0.2s push, release, 0.3s push kind of thing)

Think something the size of an electric toothbrush -- ideally battery powered (9V?).

The "push" cycle needs to have some force - 50-60g of pressure (roughly the same as to activate a mechanical keyboard).
Entropy is not what it used to be
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2530
Posted: 01:29pm 30 May 2025
Copy link to clipboard 
Print this post

as a kid I got a relay and the supply went through a nc contact so when it energised it turned it self off then started again. more than 5Hz though
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1346
Posted: 01:29pm 30 May 2025
Copy link to clipboard 
Print this post

Solenoid is a great way to go and no, you won't kill it.

Is it energize-push and spring-return?

I have done some neat things with solenoid valves where I used half a H-bridge to drive them.
Edited 2025-05-30 23:40 by PhenixRising
 
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 419
Posted: 01:31pm 30 May 2025
Copy link to clipboard 
Print this post

  PhenixRising said  Solenoid is a great way to go and no, you won't kill it.

Is it energize-push and spring-return?


Yes ^^^ this exactly.

So for me -- energise for 0.2s - return, pause 0.3s, push again.
Entropy is not what it used to be
 
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 419
Posted: 01:38pm 30 May 2025
Copy link to clipboard 
Print this post

  stanleyella said  as a kid I got a relay and the supply went through a nc contact so when it energised it turned it self off then started again. more than 5Hz though


Yea - had thought of a relay but was concerned that the lifespan (say 300,000 cycles) would give a "lifespan" of 16hrs continous use at 5Hz -- granted that the device would only be used for a couple of minutes at a time.

All the above said, it now looks like 10million is a commonly stated lifespan for relays.

Will investigate both.

Thanks
Entropy is not what it used to be
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2434
Posted: 01:50pm 30 May 2025
Copy link to clipboard 
Print this post

hi Nimue,
   what sort of travel distance do you need?

i have seen small electric motors with a small 'hammer' attached directly to the shaft used to activate the release catch on a commercial cat door. apply power of one polarity and the hammer swings around 180 degrees and hits the catch that is released and held open; apply power of the opposite polarity and the hammer swings back allowing the catch to return to the 'locked' position via a weak return spring.

with the motor only ever turning 1/2 a turn i'd say you could achieve 5 activation cycles per second.


cheers,
rob   :-)
Edited 2025-05-30 23:54 by robert.rozee
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1346
Posted: 01:51pm 30 May 2025
Copy link to clipboard 
Print this post

I would go with a microcontroller because you can have more control/flexibility using PWM.
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1346
Posted: 01:55pm 30 May 2025
Copy link to clipboard 
Print this post

Where did the 0.5 to 1 amp come from?

I use 2A solenoid valves and to manually push the spool requires serious force.
 
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 419
Posted: 01:57pm 30 May 2025
Copy link to clipboard 
Print this post

  robert.rozee said  hi Nimue,
   what sort of travel distance do you need?

i have seen small electric motors with a small 'hammer' attached directly to the shaft used to activate the release catch on a commercial cat door.

cheers,
rob   :-)


5mm max.

The motor with hammer was my initial thought - but need this all in one axis so it can be hand held and pushed vertically and the in/out in the same axis as the device.

Solenoid prototype pending once the bits arrive.

N
Entropy is not what it used to be
 
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 419
Posted: 01:58pm 30 May 2025
Copy link to clipboard 
Print this post

  PhenixRising said  Where did the 0.5 to 1 amp come from?

I use 2A solenoid valves and to manually push the spool requires serious force.


Guesstimeate of what a small energized solenoid would use ;-)
Entropy is not what it used to be
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1346
Posted: 02:25pm 30 May 2025
Copy link to clipboard 
Print this post

Pretty sure that PWM into a ULN2003 would more than handle it.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7844
Posted: 02:58pm 30 May 2025
Copy link to clipboard 
Print this post

If it's spring return then it's possible to control it using PWM. If the frequency is fairly high it will be quite smooth. However, it won't be linear because springs aren't linear. As an output stage from a Pico I'd use a 270R series resistor and a 10K pull down resistor into the gate of a N-channel MOSFET such as a IRF540. This has a very low "on" resistance and a high surge current. Probably a bit overkill but cheap. :)  You'll need a diode across the solenoid as if it was a relay. It has a similar sort of back-EMF.

Note - if the PWM frequency is below 10kHz or so you might hear it "sing". :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1346
Posted: 03:24pm 30 May 2025
Copy link to clipboard 
Print this post

IRF540  

Bristol Watch is good for this sort of thing.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7844
Posted: 04:31pm 30 May 2025
Copy link to clipboard 
Print this post

Good site!
Bookmarked.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5041
Posted: 07:28am 31 May 2025
Copy link to clipboard 
Print this post

It needs to fit in a toothbrush size housing. It needs 7 to 12v to drive the solenoid. Yes, peak currents can be 1A. So i would suggest 2 small lipo cells in series=8v. Then a logic level fet that can handle 2A minimum, directly driven from a pico. Don,t forget the flyback diode. In the final application, that is quite simple, you could use  attiny45. I know peter ported mmbasic to it, and it is smaller than a zero.

5hz can be done on such solenoid, but not with 5mm swing. It all depends on the mass you add to the moving part of the solenoid. Simple math, energy avalable, efficiency of electromagnet, mass to be moved over what velocity.

I would start with the esseentials. Can the solenoid, spring return, generate 50 gram force in the application. When not, you need to push pull drive it. There are small push pull drivers for these powers, like used for printers, where they control paper feed motors.

Volhout
Edited 2025-05-31 17:36 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10223
Posted: 07:42am 31 May 2025
Copy link to clipboard 
Print this post

IRF540  

You need a logic level FET. Choose one starting IRL



   IRLZ44N, IRL540N, IRL530N :: older parts ("L" in means logic-level, "F" parts have 10V gates)

   IRLB8314, IRLB8721, IRLB4132, IRLB8748, IRLB8743, IRLB3813, IRLB4030, IRL2203, STP105N3LL, FQP30N06L, RX3G07CGN :: newer part numbers
 
dddns
Guru

Joined: 20/09/2024
Location: Germany
Posts: 485
Posted: 08:03am 31 May 2025
Copy link to clipboard 
Print this post

Look for low Rds(on) like <= 20mOhm and you won't need a cooler.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7844
Posted: 09:27am 31 May 2025
Copy link to clipboard 
Print this post

Yes Peter, I wanted IRL but my usual supplier doesn't have them (or any logic level for that matter :( ). VGS(th) for the IRF540N is 2-4V and they will usually work after a fashion at 3V3 but you won't get good results at that.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3354
Posted: 11:47am 31 May 2025
Copy link to clipboard 
Print this post

  matherp said  IRLZ44N, IRL540N, IRL530N :: older parts ("L" in means logic-level, "F" parts have 10V gates)


I have found that for PWM, IRLZ44N seems to work more reliably with 3V3 than IRL540N, and is satisfactory for the uses I have attempted.

Better is IRLB8743PBF.
~
Edited 2025-05-31 22:02 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 419
Posted: 11:53am 31 May 2025
Copy link to clipboard 
Print this post

  matherp said  IRF540  

You need a logic level FET. Choose one starting IRL

   IRLZ44N


Perfect - was going to start with TIP120 as I have a few to hand - but on looking the heat dissipation managed to find a friend with IRLZ44N on hand, so will switch to that.

Couple of days for the solenoid to arrive and will prototype.  Assuming it works

Thanks all.

Use case:  am working with a local manufacturing company on a set of industrial keyboards they use in their plant - but the units are "sealed" due to the dust ingress. The dust tends to be rubber particles, often with carbon added - so possibly slightly conductive. The manufacturer resists my request to take the keyboard out for cleaning - and insist on a cost prohibitive rebuild -- plus it puts the machine out of action as there is no option for alternative keyboard.

Blasting round the failing key with air works temporarily - but the best solution seems to be contact cleaner and manually pressing the keys repeatedly.   Keys "fixed" like this seem to then continue to work.  So the idea is to make a handheld gizmo that pushes the keys without manually banging them - in theory allowing the whole keyboard to be cleaned quicker and more finger friendly than manually.

This came about as the owner said words to the effect of "my son has a tattoo gun......" - which oddly and horrifyingly worked but the needle end damaged both the tattoo gun and the keycap.  (They did that not me).

Amazing how much small businesses are both held together with spit and string AND how they are at the mercy of "official" servicing.

So if I can make this work I will investigate fitting into a housing similar to an electric toothbrush (3D print probably).


N
Entropy is not what it used to be
 
     Page 1 of 2    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025