Connecting relay with arduino



  • Hi everyone, first of all this is a great community and thanks a lot for sharing so much knowledge. For 2 years i'm using a duet 2 wifi. First i build a corexy printer from scratch. After a year i changed it to cartesian. For powering my system i'm using mixed voltage. For duet, motors, heated bed and extruder heater i use 24v and for my fans and leds i use 12v power supply. They are using common ground connection. Other than that i use an arduino (which is connected to 12v supply) to control other stuffs separately. So i put a button and a relay in my case to power on/off my system. I used the relay to cut 24v (+) wire. Then the poblem starts. When i push the button the relay activates but my paneldue starts to flicker and all 12v fans starts to work. The duet doesn't close. Does anyone has an opinion what causes this or how can i fix?
    PS. I dont want to disconnect the main power with relay because i want my arduiono powered.

    Thanks. And sorry if i make any grammer mistake(s). English is not my native language.



  • Any suggestion?



  • @denizbazzz It's difficult to understand how you exactly wired the things. Can you make a wiring diagram or a good image where one sees the wiring? And I did not understand when you push the button: is it to turn on the Duet or to turn it off?
    ("The duet doesn't close" - did Duet run at this moment?)



  • duet schem.jpg



  • Ok i tried to draw on photoshop 🙂 The problem starts when i hit the button which cuts the relay that connects Duet 2 wifi 24Vin. When i push the button the leds on duet 2 wifi flickers and the wifi restarts, all the extruder fans start to run. I can't understand how is it possible if i cut the 24v (+) cable that powers duet2wifi and can run all the 12v parts and some leds on duet 2 wifi



  • @denizbazzz is the relais of type SRD-05VDC? (printed on the blue relais boxes last line)

    as FelixH say please check the wiring to the 3 connections every relais has.



  • @denizbazzz said in Connecting relay with arduino:

    Ok i tried to draw on photoshop 🙂 The problem starts when i hit the button which cuts the relay that connects Duet 2 wifi 24Vin. When i push the button the leds on duet 2 wifi flickers and the wifi restarts, all the extruder fans start to run. I can't understand how is it possible if i cut the 24v (+) cable that powers duet2wifi and can run all the 12v parts and some leds on duet 2 wifi

    Are you sure you have done the connections right? Relays have NO and NC terminals, maybe you swapped them?

    Other than that... this is one of the most overcomplicated setups I've seen. Why would you use a separate PSU to power the fans? they should be firmware/Gcode controlled. It'd be much easier to replace the fans on your printer... 🤷

    EDIT: now that I think of it, how have you programmed your arduino? Are all the PIN declarations done correctly?



  • @denizbazzz maybe the problem is in the Arduino code. If you show it here, we can discuss whether it is ok. Please give information at which pins the buttons and relais are connected.


Log in to reply