091117_2101_TinkeringTu3.jpg

Tinkering Tuesday – Playmobil Stage – LED Rings

Past posts of this series:

Tinkering Tuesday – Playmobil Stage – Einführung

Tinkering Tuesday – Playmobil Stage – Introduction

Tinkering Tuesday – Playmobil Stage – Playmobil parts

Tinkering Tuesday – Playmobil Stage – LED Stage Lights

Tinkering Tuesday – Playmobil Stage – Disco Ball with stepper motor


This one will be a rather short post to describe the LED rings that I used for the background effect.

They are very cheap WS2812B based LED rings from ebay. I bought 3 different ones, 7 LEDs (1,10 EUR), 16 LEDs (2,29 EUR) and 24 LEDs (3,69 EUR). The wiring is very easy, the WS2812B is addressable and requires only 5V, GND and one control pin from the Arduino. They are even chainable so I connected the control pins of all three rings to only require one singel Arduino pin.

In the following picture you can see the wiring. Yellow is the control pin chained from the biggest to the smallest ring. The black ground wire is also chained. I decided to provide the 5V to every ring on its own to avoid a loss of brightness (but I guess with only 47 LEDs that was not really necessary). I even made a professional looking schematic, see the small orange paper in the pic?!

Soldered and chained rings

In the next picture you see the solder pads in a closeup.. Here is the smallest ring only connecting the input side (black=GND, red=5V, yellow=control pin). As you saw above I secured everything with hot glue.

Solder pad closeup

Here it is already glued to the back of the stage:

Glued to the background

As a beginning I searched for an easy to use library and found FastLED. They are also compatible with Adafruits NeoPixel. So go have a look there. They have great guides.

The most simple program using it is:

#include "FastLED.h"
CRGB leds[1];
void setup() { FastLED.addLeds<NEOPIXEL, 6>(leds, 1); }
void loop() {
leds[0] = CRGB::White; FastLED.show(); delay(30);
leds[0] = CRGB::Black; FastLED.show(); delay(30);
}

This only blinks the first LED. There are some more great examples in the download from Github and the basics are very easy.

Here is a small test video switching all LEDs one after another from red to yellow to blue:

I wanted to use something with a little more effects than just blinking like with the LED spots so I chose one of the bigger examples, the NoisePlusPallette which can be found at: https://github.com/FastLED/FastLED/blob/master/examples/NoisePlusPalette/NoisePlusPalette.ino

This is using readymade color palettes and combines that with a random noise generator. You can influence the parameters (e.g. with the sound input) and so make this you own. I didn’t have so much time so I just fed in some parameters from my sound input and adapted it to the number of LEDs. The result will later be described in my Software wrapup.

I used acrylic glass that I sanded so it is not clear but milky to make the effect more outstanding. That will be seen later in the woodworking part. In my demonstration video you can see the rings in action (here directly starting at 0:11):

090317_0848_TinkeringTu5.jpg

Tinkering Tuesday – Playmobil Stage – Disco Ball with stepper motor

Past posts of this series:

Tinkering Tuesday – Playmobil Stage – Einführung
Tinkering Tuesday – Playmobil Stage – Introduction
Tinkering Tuesday – Playmobil Stage – Playmobil parts
Tinkering Tuesday – Playmobil Stage – LED Stage Lights


 

As already written on my last post I bought a disco mirror ball (5cm diameter) from Conrad:

I had some cheap stepper motors lying around so I decided to use one of those to drive the ball. Those are 28BYJ-48 motors with a ULN2003APG based driver board:

The motor was mounted using two simple screws:

View from above the stage
View from inside the stage

With a small drill bit I was able to make a small hole into the shaft and with some „Tüdeldraht“ and hot glue the ball was mounted onto it.

Final assembly

For the software part the following website http://www.eprojectszone.com/2016/11/19/arduino-and-uln2003apg/ was very helpful in understanding the ULN2003APG and using it together with an Arduino.

//http://www.eprojectszone.com/2016/11/19/arduino-and-uln2003apg/

int motorpin1 = 10;

int motorpin2 = 9;

int motorpin3 = 8;

int motorpin4 = 5;

int t =2;

void setup() {

pinMode(motorpin1, OUTPUT);

pinMode(motorpin2, OUTPUT);

pinMode(motorpin3, OUTPUT);

pinMode(motorpin4, OUTPUT);

}

void loop() {

digitalWrite(motorpin1, HIGH);

digitalWrite(motorpin2, LOW);

digitalWrite(motorpin3, LOW);

digitalWrite(motorpin4, LOW);

delay(t);

digitalWrite(motorpin1, LOW);

digitalWrite(motorpin2, HIGH);

digitalWrite(motorpin3, LOW);

digitalWrite(motorpin4, LOW);

delay(t);

digitalWrite(motorpin1, LOW);

digitalWrite(motorpin2, LOW);

digitalWrite(motorpin3, HIGH);

digitalWrite(motorpin4, LOW);

delay(t);

digitalWrite(motorpin1, LOW);

digitalWrite(motorpin2, LOW);

digitalWrite(motorpin3, LOW);

digitalWrite(motorpin4, HIGH);

delay(t);

}

This is not the most beautiful way to use a stepper motor in your code, so I just switched over to the stepper library (https://www.arduino.cc/en/Reference/Stepper). This reduces the code mostly to the following:

#include <Stepper.h>

#define motorpin1 7

#define motorpin2 8

#define motorpin3 12

#define motorpin4 13

#define STEPS 4096

Stepper stepper(STEPS, motorpin1, motorpin2, motorpin3, motorpin4);

void setup() {

stepper.setSpeed(2);

}

void loop() {

stepper.step(1);

}

This on its own worked great. But I had to learn that this is working just as the first code and is blocking the Arduino / slowing it down so much that everything else is not working as I was expecting it to be (especially the Audio analysis). Also together with the LED rings it was not really working out. It also produces interferences in the power lines. I used one single power source (5V 3A). But this led to so much interferences in using the stepper motor in the Audio output that I had to come up with another solution. More on that in a later part 😉

In the video there is the disco ball in action (starting at 0:48):

082617_0857_TinkeringTu23.jpg

Tinkering Tuesday – Playmobil Stage – LED Stage Lights

Past posts of this series:

Tinkering Tuesday – Playmobil Stage – Einführung

Tinkering Tuesday – Playmobil Stage – Introduction
Tinkering Tuesday – Playmobil Stage – Playmobil parts


 

I bought some stage lights from Playmobil (see also my post on the Playmobil parts):

They have a diameter of 1cm inside. So I thought „why not buy big LEDs that fit in there?“. I measured and looked through the online shop of http://www.conrad.de. I figured out that the 10mm LEDs will not fit because they have a slightly wider ring on the bottom. The 8mm LEDs also have this ring but this one is about 10mm so fit perfectly.

I bought 9 of these in the colors red, yellow and green (after the guy at the parts counter wanted to also sell me white ones. Right before going to the checkout I saw that they cost 4.95 EUR each. He nearly got me. Now I know I always have to ask for the price of all parts, even if they seem nearly the same…).

Back home I calculated the resistors needed and came up with the following results using http://ledcalc.com/:

Green LED

https://www.conrad.de/de/led-bedrahtet-gruen-rund-8-mm-3-mcd-60-20-ma-22-v-l-793-gd-180343.html

Red LED

https://www.conrad.de/de/led-bedrahtet-rot-rund-8-mm-3-mcd-60-20-ma-2-v-l-793-id-180327.html

Yellow LED

https://www.conrad.de/de/led-bedrahtet-gelb-rund-8-mm-3-mcd-60-20-ma-21-v-kingbright-l-793yd-180475.html?sc.ref=Product%20Details

What I didn’t think of was how bright they would be. When I connected everything I was a bit disappointed but having a look at the data sheets I understood why and blamed myself. They only have 3 mcd of light. That’s really next to nothing. A candle has about 1000 mcd. So I will go back to using 5mm LEDs that are cheaper and easier to find in various colors and with a much higher mcd value. Lesson learned!

I then just ordered a cheap LED set from ebay with higher mcd values and 5 colors each in sizes 5mm and 3mm. Those are quite acceptable in brightness. Only the green LED is very dark (although it has the highest mcd ratings… can anyone explain that? I experimented with resistors from 82 ohm to 100 ohm but it is not very bright). I won’t do the full resistor math here, just use an online LED calculator

The light distribution is very wide but I also had some LEDs from a cheap starter set which are more like a spot light. I will combine both and will place the spots. I also have red, blue and green LEDs from those but the green ones have the same brightness problem so I will just use red and blue. I combine the red and blue spots together with the yellow ones from the set in the Playmobil spots and have two white spots at fixed points at the side of the stage for the disco mirror ball (5cm diameter) I bought from Conrad:

The spotlights are mounted on a 4mm aluminum rod:

That is a tight fit but is just the right tension to not move easily and be able to move the spots.

Schematics LED controller board

From my HUEify project I had good experiences with using a MOSFET to drive LEDs so I bought some BUZ11 again (I know, not the best ones to use but at least here a very cheap way to go). So the plan is to drive the LEDs in color groups, each driven by a BUZ11. In the groups the LEDs will be connected in parallel with a resistor each.

This is the basic cabling for one LED. There are two pin headers for power (top=GND, botton=5V) and one pin header for the control pin of the Arduino. Three of the LEDs are connected to one MOSFET with common 5V. The build process is documented in the following pictures:

Resistors first, then the cables to LED’s anode (red cabling).

Then solder the MOSFETs, the pin headers for the control pins and the pin headers for GND in place (I took 2 here which was a good decision in the end. I will explain that later). If you have a closer look at the picture above: do you see what’s wrong? Post it in the comments… Always double-check before soldering!

On the right side is another pin header (also 2 pins here) for the 5V power. Above are the black cablings from the LED’s cathodes. The lower part is for the white LEDs for the mirror ball. I messed up with one resistor so I had to solder a third one… Here the cabling is a bit different because I wired them directly to pins 9 and 10 of the Arduino. I also messed up with the black cable: it goes to the LED’s anode, not cathode so I used yellow cabling to the anode to be reminded of the mistake. It helped! And finally some hot glue to hold everything in place (that is a whole lot of cables…)

Here is a picture to give you an idea of the mess of cables (LED rings are also included there):

I used tape to hold the cable pairs together and marked them to see which is connected to which MOSFET. Also a good idea!

To put them into the spots I had to drill a hole in the spot itself. I think it was a 4mm drill that was perfectly fitting. After that I put some heat shrink tubing in place:

Putting the cables through and adding another small heat shrink tubing to the black wire:

Then I soldered the LED in place:

Always test after sodlering and before shrinking the heat shrink tubes:

Then put the LED into the spot and use hot glue to hold in place:

Last but not least put them on the rod (more on that in a future post):

In the following picture you can see one of the spot LEDs for the disco ball. They are just hot glued into the side walls:

And it’s always a good idea to prepare for mass production:

The control of the lights will be described in the software wrapup. Next week will be about the disco ball, including the control of the stepper motor.