I am building a whiteboard CNC pen plotter for my classroom out of some old 3D printer parts, a Melzi board running Ramps 0.92 and Inkscape to generate the Gcode. I have the machine up and running but I need a solution to actuate the pen in and out. I want to use an electromagnet or solenoid to do this and I was thinking of running the solenoid off of the cooling fan header. I can use Gcode to turn the fan circuit off and on or control its speed via PWM. The system is a 12 volt system and I think the old 40mm fan was rated at 0.18 amps, 2 pin. I am wondering if a small solenoid could be powered by the fan circuit? If so, what ratings should I look for? Would a solenoid be a bad choice? Could I buy some magnet wire and wind my own electromagnet which could just pull the marker into the whiteboard? I don't need much movement out of the pen, just a few mm.

I know there are better solutions out there like using a servo or another stepper motor. I am avoiding the stepper motor because I am trying to keep the mass of the moving parts as low as possible. I would use a servo, but I really don't know a whole more than basic circuits. Is there an easy/cheap way to convert the two pin pwm fan signal to a servo signal?

  • 1
    \$\begingroup\$ I'd use a relay stripped down to remove the contacts and attach the pen to the armature for a little bit of movement control. But, remember this is an EE website and hobby type engineering is not going to get you direct answers without a whole load of description and numbers. What you will get are opinions and, unfortunately (or not) questions seeking opinions are closed. \$\endgroup\$
    – Andy aka
    Nov 22, 2020 at 17:26
  • \$\begingroup\$ A solenoid works slightly differently from a motor. In particular, a solenoid is like a stalled motor. Your solenoid controller should have high initial current to actuate the solenoid, but then drop to a much lower holding current. \$\endgroup\$ Nov 22, 2020 at 17:47

1 Answer 1


Looks like the power on the fan connector on the Melzi board is controlled with a RFP30N06LE power transistor...

enter image description here https://reprap.org/mediawiki/images/7/7d/Melzi-circuit.png

This is a very beefy transistor that can switch up to 30 amps...

enter image description here https://www.mouser.com/ProductDetail/ON-Semiconductor-Fairchild/RFP30N06LE?qs=mdiO5HdF0KgGbixxeJqneA%3D%3D

...so your solenoid should be no problem.

You will want to add a flyback diode across the solenoid so that it does not generate a high voltage across the transistor when the power is turned off. You can google about how that works.

enter image description here

Pick (or make) a solenoid that is rated for 12V so that it does not get too hot and burn out. You can use a lower voltage solenoid too, just do not leave it on long enough for it to get hot.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.