The relay is turned LED as Red. The relay is turned LED on as Red - What is that imply?
On or off?
The relay is turned LED as Red. The relay is turned LED on as Red - What is that imply?
On or off?
More details please
An LED on a relay module that turns on and off when the relay operates would normally be connected such that it is on when the relay is on, but it does not have to be
Note that many relay modules are "active LOW", ie they need a LOW signal on their input pin to turn them, not a HIGH signal as you might think
int analogPin = A3;
int Rawval ; // variable to store the value read
int Scaleval ;
int RELAY_pin = 10; // Relay is connected to pin D10
void setup()
{
Serial.begin(9600); // setup serial
pinMode(RELAY_pin, OUTPUT);
}
void loop()
{
int Rawval = analogRead(analogPin);
Serial.print("Rawvalue from Analog input =");
Serial.print(Rawval);
// For 3V3 input to read 100%, 3V3 of 5V ref = (3.3 / 5) * 1023 = 675
Scaleval = map(Rawval, 0, 675, 0, 20);
Serial.print(" Scaled Value =");
Serial.println(Scaleval);
/// === RELAY code ===
// raw value 675 correspond to 20%, so for 5% we will get 169
if ( Rawval < 169) digitalWrite(RELAY_pin,HIGH);
else digitalWrite(RELAY_pin, LOW);
}
This is the code - What it is denoted
It is impossible to tell from your code. In fact you don't need any code
Connect relay 5V to 5V on the Arduino
Connect relay GND to GND on the Arduino
Connect relay input to 5V on the Arduino
Does the relay click and the LED come on ?
Connect relay input to GND on the Arduino
Does the relay click and the LED come on ?
Sorry, but I have no idea what you are telling me or what the picture is showing me
Please answer the questions in my previous reply
Presumably the relays are going to turn something on and off so it will be easy for you to tell whether the LED being on indicates that the relay is on, ie Normally Open connections closed or not because the connected device will be powered or not
Do you have a multimeter and if not, get yourself one. Cheap and cheerful is OK for what you need
I have uploaded this code
My questions do not involve the code
You do not need any code to discover that the state of the LED means
What devices will be turned on and off by the relays ?
A 12V Device.
Does the device turn on and off when the relay LED turns on and off ?
Please post a drawing of your project circuit showing how the relays are connected, how the device is connected and how the whole thing is powered
Do you understand the difference between a Normally Open and Normally Closed relay contact and what the Common relay contact does ?
I am still interested in having answers to my questions in reply #4
Hi,
The relays on that assembly have 12V coils.
Can you please post a circuit diagram of how you have the assembly connected to your Arduino?
Please include power supplies, component names and pin labels.
What model Arduino are you using?
The RED LEDs indicate the relay "STATE".
If the LED is OFF, then the relay is not activated, there is no current flowing through the relay coil.
If it is ON, then the relay is activated, there is current flowing through the relay coil.
Tom....
@TomGeorge welcome to the party