Hello, I seem to be struggling with what should be a simple project. I am new to Arduino and programming; just a hobbyist trying to get started. Please be gentle with me ;).
The problem I am having is when my relay board activates, the contact does not engage either the NO or NC contacts. I can move the D8 signal to any channel on my relay board and the fault follows the enable signal. I have tried using a different identical relay board; no change. I have loaded the same program on a second Arduino board; no change. I've tried powering the coil from the Arduino itself, utilizing the jumper on the relay board between VCC & JD-VCC; no change. I can only conclude the issue is with my code. I have posted it below. Admittedly, I do not know how to program. I used AI to generate this code. If anyone has any insight what my problem is, please help!! I have been stuck on this for a few days. Thank you.
`#define RELAY1 8
// Active-low relay
#define RELAY_ON LOW
#define RELAY_OFF HIGH
void setup()
{
// Set Relay 1 as an output
pinMode(RELAY1, OUTPUT);
// Make sure the relay starts OFF
digitalWrite(RELAY1, RELAY_OFF);
// Wait 3 seconds
delay(3000);
// Turn Relay 1 ON
// It will remain ON continuously.
digitalWrite(RELAY1, RELAY_ON);
}
void loop()
{
// Nothing happens here.
//
// Relay 1 remains ON continuously.
}`
When the relay is energized, I have no continuity between the common and the NO, nor the common and NC. Its as if the common is getting stuck. Once I deenergize the board, I get continuity between the common and NC again. Again, I have tried another identical relay board and same behavior.
Yes, I am using a meter to measure continuity between the common and the NO, and common and NC. Please don't think me arrogant for saying, but, although I am new to Arduino and coding, I have worked with electronics for 20 years. I am confident that I am using my meter correctly and am checking the relays correctly.
We've all had moments (in our 20 to 60 years) when a second set of eyes was all that was needed after staring at the same "simple" problem all day. At least I have. No one is questioning your ability. The questions are to deduce the error from what exists and what does not. It could be the relay board, but that is to be discovered.
With the relay board disconnected from power and microcontroller... does each RELAY COM and RELAY NC have continuity?
And if you just connect GND and VCC to (depending on your JD-VCC jumper) to the board, do you hear the relays energize in any form (normal "clack" or quiet "click" sound)?
Yes, I can hear the relay's click when I apply power to the coil side. I have powered the coil both with jumpering between VCC/JD-VCC, and have also tried by removing the jumper and applying 5V directly to JD-VCC & taking 5V from the Arduino board to VCC. The LED on the relay board lights as well.
From the product description-
" * Power Module: MB-102 breadboard DC voltage-stabilized source module, compatible with 5V, 3.3V; Input Voltage: DC 6.5-12V or USB power supply, Output 700 ma (MAX), two way independent control, can switch 0V / 3.3V / 5V."
If the linear regulator on the MB102 is dropping 12V to 5V (7V), it may be able to supply only about 160mA before overheating, each relay coil draws 72mA.