I will be using this to switch 230V solenoid valves, but I have an Arduino Nano ESP32, which is a 3.3V MCU, and this relay needs 5V. I just want to make sure my wiring is correct:
Relay VCC - ESP32 VCC
Relay GND - ESP32 GND
IN1-IN4 - ESP32 GPIO
(Remove jumper between COM-GND)
COM - External 5V supply
GND - shared GND between 5V supply GND and ESP32 GND
The ESP32 GPIO are connected to S8050 transistors, which I will be using to drive the relays IN pins.
Does this seem correct?
EDIT: ChatGPT is confusing me a lot with this- it keeps contradicting itself and forgetting the schematic, which is why I said relay VCC - ESP32 VCC (ChatGPT said to do this), which is most likely wrong
The part number of the relays (SRD-12VDC-SL-C) indicate that they are 12V relays.
Are these what is fitted to your relay module?
If so then you will need a 12V supply which you would connect to VCC and GND.
The schematic is from Whadda or Velleman.
Velleman quote " * control input voltage: 5 – 12 VDC" and the operating manual also gives 5V DC as the module input voltage.
Confusingly, there are images of the module showing 5V and 12V relays.
I would agree, if I saw 12VDC printed on a relay, I would be using 12V. Chances are, it might work at 5V DC.
That optocoupler circuit doesn't leave much room for guessing. You connect ESP gpio-pins to IN and ESP gnd to COM.
Only doubt is if 3.3V is sufficient to turn on the optocoupler (at ~2mA). It's safe to try .
I got it working, I just needed to add 5.1K pull-up resistors for each external S8050 to 5V. Ran into another fun issue after that (one of the transistors was faulty but was fine in diode testing etc). Thanks for confirming that the wiring was incorrect!
I'm using my own S8050's to switch the relays. It says 12V there for some reason but they are 5V (it says on the actual relay SRD-05VDC-SL-C).
But how do you deal with this? Solenoid is definitely inductive load.
I'm using 8W solenoid valves, which means (at 230V) they are about 35mA each. I'm staggering the relay switching so I'm not switching all 3 at the same time, and I have an RC snubber on each relay contact. I have a 2A anti-surge fuse in my mains plug too. Max inrush I'll get is about 350mA per solenoid.