I was lying in bed exhausted, I found that the lights were still on, but I didn't bother to get up and switch it.
I walked into the dark room and the lights were off. I have to find the switch in dark.
Hence I wanna have a wireless switch that can help me turn on/off light.
Hardware and SoftwareRapid IoT Prototyping Kit as remote switch use OOB demo firmware.
Linkit 7697 control LED lamp. Firmware program by Arduino IDE. The keyword below.
if(name=="PAF6D"&&scanRSSI>-80)//BLE device name
{
digitalWrite(led0,HIGH);
}
When Linkit 7697 work as BLE central keep scan device. Once it find Rapid IoT Prototyping Kit (my kit device name "PAF6D") and RSSI is big enough. 7697 turn on LED lamp. While Rapid IoT Prototyping Kit turn off BLE off or leave the room 7697 turn off lamp.
Connection
Since Linkit 7697 is 3V3 device and IO drive current not enough, need transistor of MOS circuit to switch LED.
Operation video
Comments