Arduino: motion activated lights

0

This is a fun and quick demo on how to use one Mikroe 4×4 RGB click and one Motion click to create some motion activated lights. Besides these two click boards the project requires one Arduino Uno Click Shield and one Seeeduino Mega.


Warning: Use of undefined constant ICL_LANGUAGE_CODE - assumed 'ICL_LANGUAGE_CODE' (this will throw an Error in a future version of PHP) in /home/teodorc8/public_html/wp-content/plugins/insert-php/includes/class.execute.snippet.php(456) : eval()'d code on line 19

Warning: Use of undefined constant ICL_LANGUAGE_CODE - assumed 'ICL_LANGUAGE_CODE' (this will throw an Error in a future version of PHP) in /home/teodorc8/public_html/wp-content/plugins/insert-php/includes/class.execute.snippet.php(456) : eval()'d code on line 22

As in other projects that use 3.3V only clicks, the Seeeduino Mega is mandatory, as it’s one of the few Arduino boards that can be configured for 3.3V operation with the flip of a switch.

The hardware doesn’t need much explanations. Just configure the Seeeduino Mega for 3.3V operation, place the Motion click is slot #1 of the Arduino Click Shield and place the (3.3V configured) 4×4 RGB click in slot #2 of the Arduino Click Shield. That’s it.

Arduino code for motion controlled lights

The code relies on the Adafruit NeoPixel library to turn on the blue LEDs when motion is detected, then after a short delay it slowly fades the light off. Of course, many light effects can be implemented, the only limit being your imagination.

For a 9V power supply the project takes 39mA when all LEDs are off, and 90mA when the blue LEDs are on. It’s worth mentioning here that the Seeeduino Mega itself needs 28mA. So, if you plan to run this project on a battery (think Halloween pranks) don’t expect that battery to last for long.

Share.

Comments are closed.

error: