Making holiday lights that turn on when someone is nearby using an ultrasonic (and later PIR) sensor
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
Fairy_Lights_Ultrasonic.inoV1 connected to fairy lights from the dollar tree, using an ultrasonic distance sensor to activate the lights and a cooldown timer to keep them on for awhile.ino - 1.66 kB - 12/23/2018 at 21:19 |
|
|
Ultrasonic_Sensor.inoSketch to drive a strip of 150 neopixels, using a diode to wire the first 2 neopixels to convert the voltage from the NodeMCU in a way that allows you to drive the pixels without any additional hardware.ino - 1.72 kB - 12/23/2018 at 21:14 |
|
Using fairy lights from the dollar tree, I'm having a hard time trying to drive 5v to them using a darlington pair, it's barley brighter than the 3.3v signal from the D1 mini I'm using. I'm changing this so that v2 can drive a neopixel animation on a long strip rather than trying to drive 5v with the 3.3v signal. I'm hoping driving 5v through the neopixel strip using an idea with a diode I found on hackaday will make it easier for this to be flashier.
Individually addressable LED’s, often referred to as neopixels, allow precise control over individual lights in a string, allowing you to program animations and other interesting effects. Because you can control the red, green, and blue value of any LED individually, the variety of colors, patterns, and animations is up to your imagination.
An ESP8266 based device like a D1 Mini or NodeMCU can’t normally control neopixels without a level shifter, but thanks to a clever hack using a diode, we can get around this shortcoming. The reason this problem happens is that the lights take 5 volts of power, and the signal pin from the D1 Mini can only output 3.3 volts.
Because a neopixel will not react until the signal voltage is at least 70% of the supply voltage, we can use a diode to drop the supply voltage down to 4.5, which is low enough to be successfully controlled with the 3.3 volt signal.
Wiring diagram and examples:
The V2 neopixel version is done, it now races red and green animations as someone walks by. Ultrasonic distance sensor accuracy is seriously reduced thanks to driving 153 LED's with a NodeMCU. Going to see if the PIR works better tomorrow so I can enclose the whole thing.
Create an account to leave a comment. Already have an account? Log In.
Become a member to follow this project and never miss any updates
By using our website and services, you expressly agree to the placement of our performance, functionality, and advertising cookies. Learn More