Re-purposing a 3D printer board to control a solenoid valve with Mcode
Hello, I'm trying to re-purpose a 3D printer board (mks gen L v1.0) to trigger a 24V 0.75A solenoid valve. My idea was to connect the leads of the solenoid valve to the connector for the extruder or hot bed. This way, I can use the Mcode that sets the temperature to turn on the valve and then set the temperature back down to zero to turn it off. Or would it be best/easiest to add/edit custom/unused Mcodes?
Comments
Other controls are M42 and Fan. But that really depends on when you need it on/off so you can select the solution with right timing. M42 is executed when the line is parsed while head is moving asynchroneously driven by a buffer of moves. So if you need it in sync with moves use laser driver or fan in extruder mode.
why not disconnect heater, put a monostable on the extruder stepper pin , or it with DIR to close the valve imediately when the extruder retract?