Hi everybody, my project is an anti-mosquito plant with pumps, tanks and electrovalves.
Everything works properly with exception of relays.
I'm using a 8 relay module "ELEGOO 8 Channel DC 5V Modulo Relay con Accoppiatore Ottico per UNO R3 Mega 1280 DSP Arm PIC AVR Raspberry Pi" bought on amazon.
It should work with AC250V 10A or DC30V 10A.
But happens the following: if there is no load it works properly closing and opening correctly; as soon as I attach the load (I mean I attach 220V Pump or even 12V pump) it does not work. It seems that it closes the circuit but immediately also reopens it again.
Is there any solution?
Thank you so much,
Alessandro
You started a topic in the Uncategorised category of the forum when its description explicitly tells you not to
Your topic has been moved to a relevant category. Please be careful in future when deciding where to start new topics
I nees also to add that the 8 module always work with 1 relay only at the same time.
Please post you sketch, using code tags when you do
#include <Wire.h>
#define PCF8574_ADDR 0x20
byte EXP_RELAY, relayState;
void setup() {
Serial.begin(9600);
Wire.begin();
Wire.beginTransmission(PCF8574_ADDR);
Wire.write(0xFF); // Imposto tutti i pin come output (HIGH)
Wire.endTransmission();
}
void loop() {
EXP_RELAY = 6;
Wire.beginTransmission(PCF8574_ADDR);
Wire.write(~(1 << EXP_RELAY)); // Attiva il pin specifico (bit LOW)
Wire.endTransmission();
delay(5000);
Wire.requestFrom(PCF8574_ADDR, 1);
relayState = Wire.read();
relayState |= (1 << EXP_RELAY); // Imposta il bit corrispondente a HIGH (spegnendo il relay)
Wire.beginTransmission(PCF8574_ADDR); // Invia il nuovo stato al PCF8574
Wire.write(relayState);
Wire.endTransmission();
delay(5000);
}
I'm using the module through i2c bus
Does the program start over from the beginning when this happens? It sounds like some power issue. How are things connected? Is the power supply inadequate?
The program continues properly, it simply close ed immediately reopens the relay without waiting 5 sec as in the program
could it be that i'm using I2C to pilot the relay?
Hi, @alecocca
Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.
Can you post some images of your project?
So we can see your component layout.
What model Arduino are you using?
Thanks.. Tom..
![]()
I'm using Arduino GIGA R1
There are 4 elctrovalvese 220V, 1 main pump 220V, 2 small pumps 12V
Hi, @alecocca
Thanks for the images.
You need to keep your 220Vac wiring well away from any low voltage or control wires.
Your problem could possibly be the mains current interfering with your controller when ever the relays switch ON or OFF.
Tom..
![]()
could it work if i bring relays out of th box wehere they are now (together with arduino board)?
If this happen only when you connect the load this should point to a disturbance caused by the activation of the load ( it may happen also on deactivation, but in your case once deactivated.. it stays deactivated ).
- you could try adding a 'subber circuit' on the load ( one of those 100nf + 100ohm should do )
- as noted in your setup power/loads cables runs near other signal cables, so putting the relay board in another box is a good idea
- if your main board has an eeprom is a good idea putting a 'reset counter' in it, a counter that is incremented each time the board is reset ( the setup is executed ), and show the counter in some status/debug page, if it increments 'abnormally' there something wrong happening.
Thank you all! I finally found the problem was the I2C bus, I just removed I2C for relay and used directly board pins to activate each relay and it worked!
Thank you for your support.
Ale

