Electric magnet on/off
Hello i want to turn a electric magnet on/off by gcode
i guse i can use some free pins and by gcode turn the magnet(24v) on/off
can some one help me find the right pins and the gcode
If you have a spare fan output and the solenoid draws no more than 1.5A then you can connect it to the fan output, but you must connect a flyback diode in parallel with the solenoid (cathode to the VFAN pin) to protect the fan mosfet.
Or if you have a spare heater output you can use that (up to about 5A), but again you need the flyback diode.
Hello thank you for a fast answer
i do have a spare heater output on the extension ports
i was thinking of using nr8 pin but its only one what do i use for the other ? ground ?
elmoret last edited by
The expansion port heater outputs cannot drive high current, you need a mosfet to do that. Could pick up a Duex2, Duex5, or possibly a Duet Expansion Board. Not sure what the current limit is on the Duet Expansion Board.
aha ok thanks
i will use a fan port then
the magnet uses 125 mA so i guse its safe
do i use a normal fan gcode to start/stop it ?
sorry for being a newbie
but putting a " flyback diode in parallel"
is that one diode on each cable ?
did some googeling and think i found out how to do it
please see the picture and let me know if its correct
i have a S3G diode i can use from a old component
(SMB/SMC Rectifier diode 3A 400V S3G)
Thank for the help
This wikipedia page has a good explanation:
The diode should be between the -'ve and +'ve terminals of the fan connector as you have shown, with the cathode on the +'ve (VFAN) side.
The simplest option is to use the M106 code to command it. You could also send a command to disable its use as a fan port and then control it using M42 as described at https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins.
Thank you for the help
Sorry Tony but the wiki is way to complex form me
im just a happy amateur learning on the way
i will do as the picture i posted and hold my finger crossed
simple is good i will use the m106
The data sheet for the diode you mention:
Shows it with a "cathode band" to make witch side is the cathode. (see page 3)
So you need it oriented so that marking is towards the VFAN pin. From you picture I could not see which way round you had it. Dont connect it the other way around.
ok thanks Tony