Showing posts with label WS2812b. Show all posts
Showing posts with label WS2812b. Show all posts

Monday, April 13, 2020

You don't know how to use the 3 seashells?



Into

Since the Corona virus (Covid-19) caused a worldwide pandemic, we became aware how important it is to wash our hands properly. You should wash your hands for at least 20 seconds with soap. How to measure it? You can use your wet hands to start the stopwatch on your smartphone - not ideal. Or you can sing "Happy Birthday" twice. Well, this might be a little awkward. And if you are in hurry, you can sing the song much faster. I managed to sing two times "Happy Birthday" within 12 seconds. It would be nice to have a timer, that you can start touch-less. But it must look cool somehow. I remembered the classic SiFi movie Demolition Man (1993). Which takes place in 2032 and instead of toilet paper the people are using the three seashells. This would make a nice timer.


The parts

Most of the parts are somehow leftovers. The plastic box was a box containing chocolate sweets. I used three Neopixels from an old strip. The plastic seashells where also a sweet I know from my younger days. In German it is called "Schleckmuschel" or simply "Leckmuschel". Which both can hardly translated into English. Literally it would be "Seashell to suck" or "Seashell to lick". But I think the closest would be "Toffee in a Seashell". It was on sale as a retro campaign. A cheap IR proximity sensor and all of this controlled by an Arduino Nano.

The build

To remove the candy from the seashells, I could licked them, till they are clean. But first of all this would have taken ages and it tasted not as good, as when I was a kid. So I soaked them in warm water for quite a while until the toffee was vanished into the water. I needed a box for the controller, the sensor and the three seashells to fit on top of it. An empty box of candy will do. Just cut a hole for the sensor to reach though. The controller, the sensor and the connection for the Neopixel get their own PCB prototype board. Now gluing the Neopixels and the seashells on the top of the box and connecting everything. I choose to power everything with a small USB powerbank, which is connected to the USB port of the Nano. Usually I would connect the power rails of the Neopixel stripe directly to the power source. But since this are only three pixels, I have no hard feelings about connecting it to the 5V output pin of the Arduino.

Video



Gallery









Parts

Neopixels 30 px/m
Arduino Nano
"Schleckmuschel" - Toffee in a seashell
Proximity sensor
PCB prototype boards
 Neopixel connectors

Demolition Man (1993)

Code

Code @ bitbucket

Monday, March 16, 2020

The Glowing Heart



Intro

Friends of mine are about to celebrate their 50th anniversary. And both love colorful, blinking LEDs like I do. So I decided to make a glowing heart for them. Since I'm only creative but not an artist, I never wasted a thought about creating the heart shaped form for myself. After hours of research, I found a heart made of wooden branches, that fits my needs.

The build

I used a 60 LEDs / meter Neopixel strip. I figured out that if I placed them on the inner side of the heart, I'll need about 48-49 Pixels. Well, with a little overlap I can make it 50 to honor the 50th anniversary. Since the strip's adhesive tape won't stick on the wooden surface, I additionally fixed it with some thread. That took about 10 minutes. I put the controller in one of those electrical installation boxes.

The Programming

I thought about using an ESP as a controller, but it shouldn't be too fancy. So I used an Arduino Nano. That limits the program to a few kbs. So I made ten different animations. Tried to be very efficient and flexible. The animation, I'm most proud of is the beating heart. I tried to use real heartbeat timings for this. And since the 50th anniversary is also called the golden wedding, I made three modes with only golden colors. And to change the modes, I implemented a push-button.
One of the modes is quite special. I made an animation, that simulates a heartbeat. For this I investigated how the correct timing for the heartbeat is and tried to implement it as accurately, as I can. Which worked out pretty well.


Video



The parts

Wooden heart (a similar one)
60 LED/m Neopixel strip
Electrical installation box
Arduino Nano
Push-Button
PCB prototyping board

 

Links

Source Code


Epilogue

The couple is quite happy with the present. In fact, after three month they are still enjoying it - which is longer than most of my relationships last.


Monday, July 9, 2018

Sunrise Simulator


Intro

For an event, I needed something special. How about a simulated sunrise. And it would be nice, if I could be able to remote control it and put it anywhere in the room. And of course it should be low cost. So the magic words for this are: NodeMCU, Neopixels, LiPo battery and a MQTT broker.


Wiring


Nothing fancy here. The battery is connected to GND and the 3.3 Volts on the NodeMcu and also on GND and the 5 Volt input of the Neopixel stripe. Yes, we power a 5V Neopixel stripe with a 3.7V battery. When fully charged, it will work for some time. The Neopixel stripe mustn't be too long. I used just five pixels, and it works fine.


Video




 

Algorithm


Sunrise



To simulate the sunrise, I'm setting one color at a time. So I divided the given time in three equal parts (one for each color). Within the first third of the time span, I raise the color value of the red LED from 0 to 255. Then I start with the green color. Blue at last. When all three colors are at max, you'll get a white glowing LED stripe.

ToDo

I want to add a sunset algorithm and a full cycle of a sunrise, sunshine and a sunset. Just check the Git repository from time to time.

Links

Git repository

https://bitbucket.org/Remnis/sunrise-simulator/src/master/

Amazon

NodeMCU
Neopixels 60 LEDs/m
Electrical box
LiPo battery





Tuesday, March 20, 2018

Ultrasonic Reactive Light Bar




Intro

Well, I needed an eye catcher for the Maker Faire Ruhr 2018. Moving lights always gain the interest of people. Which includes me as well. The idea behind it: a LED stripe that changes color in response how close you get to it. The distance can be easily determined by a ultrasonic sensor. And with a Neopixel stripe I could easily change the color. But wait! With the Neopixels I can control each pixel individually. So instead of using one ultrasonic sensor, I'm using five. Each of the sensors triggers a different piece of the LED stripe.

Problem

If you want to measure the time the sound takes to  travel towards an object and back, you would usually use the puleIn-function. The problem is, that while the micro controller measures the time it does nothing else. So you would have to wait for the signal to return, before you can trigger another ultrasonic sensor. But we want to be able to operate several sensors simultaneously. I was about to imagine a proper algorithm, when I found out, that I wasn't the first to encounter this problem. And I'm not the first to find a solution for it. The library handles this issue.

The Build

I've found a wooden plank from a slatted frame with a length of 135cm. Perfect! I'm using one meter in the middle for placing the Neopixel stripe and five ultrasonic sensors.
The diameter of the ultrasonic sender and receiver tubes are close to 16mm. This is a drill size I had to purchase. I predrilled the holes with a 3mm drill, before using the 16mm one.
First I tried to glue the Neopixel stripe on to it, but that wouldn't hold. I fixed them with zip-ties.
I used an Arduino Nano as the controller, soldered a custom PCB and glued it on the back side of the lath.
I wanted the build to be robust. So I soldered wires from every sensor to the PCB. So that nothing will accidentally disconnect though the transport.

The Algorithm

The original design was that all LEDs were lit white when the maximum distance of three meters is detected. Technical speaking the values of all three colors are set to 254. The value of green and blue is now determined though the distance of an object to the sensors. Well it looked quite unspectacular, but it worked.

Video



Wiring 

The power from the Arduino will not be enough to power all sensors and the LED stripe. So you need to add an external power line (5V).

Links

Arduino Nano @ amazon
HC-SR04 Ultrasonic sensor @ amazon
Neopixels @ amazon
NewPing Libriary
Ultrasonic Lght Bar Code