Controling a Relay
I have an E3D toolchanger and I connected an 5V Relay to a GPIO Pin 1 on my duex board.
This is the configuration in the config.g file.
M950 P10 C"duex.gp1" ; Load GPIO 1 Pint to output P10 M42 P10 S0 ; Switch off output P10
I then switch the Relay on and off via a macro with the command
M42 P10 S1 ; Switch on output P10
M42 P10 S0 ; Switch off output P10
this works fine.
But when I'm printing and the relay is connected, I get this error messages:
Another problem I have is that during longer prints and if the relay is connected the fans (T2 and T3) connected to the Duex stop working and the relay is also not working anymore. Only after a power off and Power on, the duex operates normally.
The relay I'm using is rated for 5VDC and 71mA SRD-05VDC-SL-C-Datasheet.pdf
The 5V power supply and the GND I also took from the GPIO pin "Bar".
What could be the reason that the Duex board stops working and why I get this error messages.
alankilian last edited by alankilian
@alankilian Thanks a lot for the link. I think that could the problem, I do not found any information how much high the current of the 5V output of the Duex GPIO pins is rated.
But as mentioned in your linked thread, I could try to grab 5V from the "main board".
Some People also used spare fan outputs. But I think the GPIO are the correct way of doing it, and in the future I might need the fan outputs.
rjenkinsgb last edited by rjenkinsgb
71mA is not a lot in general terms, but it is when direct from a microcontroller I/O pin; they are more typically rated in the 5 - 25mA range, depending on the exact device.
A fan (or heater) output would be far more appropriate for such a load, and it would not cause overheating.
As is is, you could slowly be destroying the MCU on the duex.
Also, do you have a flywheel diode connected across the relay coil?
If not, it may be causing a high voltage spike when you switch it off.
@rjenkinsgb The load is not on the GPIO pin. It is on the 5V power supply of the GPIO pin bar, but I guess that power supply is also not strong enough. I did not come around to try it jet, connecting it to main 5V power supply.
I know I can still use the fan output. But I try to avoid it, because I might need them later.