Skip to main content

Posts

Showing posts with the label wireless relay

InduinoX and wireless relays: Part II

In my last post , I played a bit with the wireless relays to turn on a light. In this post I will show how to use LDR to detect when to turn on the light depending on the ambient light. Lets dive into the code quickly #define TRUE  1 #define FALSE 0 int LIGHT_PIN = 7; int SLEEP_TIME = 100; int LDR_PIN = 3; int LDR_THRESHOLD_FOR_DARK = 350; int MAX_COUNT_BEFORE_TOGGLE = 10; int isLightOn = FALSE; int toggleCount = 0; void setup() {   turnOffDevice(LIGHT_PIN);   digitalWrite(LIGHT_PIN, LOW);   Serial.begin(115200); } void turnOffDevice(int pin) {   pinMode(pin, INPUT); } void turnOnDevice(int pin) {   pinMode(pin, OUTPUT); } void toggleLight() {   if (isLightOn) {     turnOffDevice(LIGHT_PIN);     isLightOn = FALSE;   } else {     turnOnDevice(LIGHT_PIN);     isLightOn = TRUE;   } } void toggleLightIfNecessary(int input, int t...

Purchase experience with Probot

I have recently posted my purchase experience with Simple Labs . This post is the continuation of that. That same day I ordered these components from www.probots.co.in 4 channel wireless relay board Power supply for relay Power supply for transmitter The 4 port relay board will turn on/off any lights and fans connected to them. And the on/off state of these relays is controlled from the transmitter. The transmitter and receiver talk over a 433 MHz frequency in their own protocol. The transmitter controls the relays by the way of 4 physical buttons or by a micro controller like the arduino board. There are 5 pins on the transmitter (one for each of the relays and one ground) which should be connected to the arduino board. When a relay pin is connected to ground, the relay on the receiver turns on. When the relay pin is open, the relay is off. The relay requires a 12V DC supply and the transmitter requires a 5V DC supply, which also I purchased. Make sure the power ...