Automated light controller
Inside this recipe, we are going to continue exploring M2M communications with the Arduino MKR1000 board, this time by creating an automated light controller based on Arduino. A first module will be in charge of detecting the ambient light level, and then sending alerts to a second module, which will switch a light on or off, depending on the received alert.
Getting ready
To control a lamp in this project, we are going to use a very convenient component called the PowerSwitch Tail:
These components allow us to easily control devices powered by the mains electricity from an Arduino board, as you can just plug it into the mains electricity and then plug your device into it as well.
This is the list of the components that will be required for this recipe:
PowerSwitch Tail (https://www.adafruit.com/products/268)
Photocell (https://www.sparkfun.com/products/9088)
10K Ohm resistor (https://www.sparkfun.com/products/8374)
Let's now assemble the hardware for this recipe. We are...