Appearance
Dark Light
Did You Know?
Conventional farmers use around 300 different pesticides to grow foods that are sold in supermarkets everyday.
The relay
The relay has 5 pins:
You can test the relay using a multimeter; when the relay is switched on, the resistance reading drops to near zero on the multimeter. You can also hear the relay "clicking" as the switch opens/closes. The LED shows the open/closed state.
int ledPin = 8;
int relaySwitchPin = 7;
void setup() {
pinMode(relaySwitchPin, OUTPUT);
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(relaySwitchPin, HIGH);
digitalWrite(ledPin, HIGH);
delay(5000);
digitalWrite(relaySwitchPin, LOW);
digitalWrite(ledPin, LOW);
delay(5000);
}