Helmet Lights

by Niubit in Circuits > Wearables

1848 Views, 3 Favorites, 0 Comments

Helmet Lights

microbit_neopixel.jpg

After managing to connect a strip of NeoPixel to micro:bit, we came up with something useful to do with it by making a program that would detect some gestures to signal cycling maneuvers through the LED strip.

These instructions actually describe the adapter made to connect the NeoPixel strip and make it portable with a battery holder. Once built it can be used to signal bicycle maneuvers or anything else by changing the code in micro:bit.

Supplies

Circuit

leds_Wiring-Diagram_v3.png

The circuit to connect a NeoPixel strip to micro:bit is elementary. One important thing is to power the LED strip externally, that is, not to take the power from the micro: bit. We take advantage of the fact that both the micro:bit and the NeoPixel strip are quite tolerant to supply and signaling voltages. Thus, we feed both from a battery holder with two 1.5V alkaline batteries following the circuit that can be seen in the above picture.

Micro:bit Adapter

adaptador.jpg
tarjeta_v4.png
jst_v2.png
real_01.jpg
real_02.jpg
real_03.jpg

We started by making an adapter so that the circuit with the micro:bit, the LED strip and the battery would be solid. The starting point was one of the micro:bit to breadboard adapters available in the market. Since we were making the adapter, we thought we would support 3 LED strips instead of just one for future projects.

We designed a simple PCB with KiCad whose Gerber files can be downloaded from this link.

In one of the photos above, can be seen the connections in the JST connector. In this assembly we only use the pins GND, 3.3V and 0 as we only connect one LED strip.

Finally, we made a case with TinkerCAD to be 3D printed.

The final result with everything assembled (PCB, components, batteries, wiring for LED strip, case, adapter and micro:bit) can be seen in the last three photos of this step. The PCB is hot glued to case.

Code

program.png

For the code we will take into account that a strip with ten LEDs was mounted. Five will go on the right half of the bike helmet and the other five on the left side.

The design conditions of the program are as follows:

  • When the micro:bit accelerometer detects a deceleration, it will indicate that we are braking by lighting all the LEDs in red with a rapid flash for 3 seconds.
  • When the gyroscopes detect tilting of the helmet to the right or left, the intention to change direction will be indicated by flashing the LEDs on the corresponding side for 10 seconds.

We use the MakeCode platform to program micro:bit. The resulting program can be seen here.

The code in MakeCode does not allow to calibrate the accelerometer and gyroscope to fine-tune the behavior, although with the default calibration it works quite well already. To have more control over this aspect, you would have to face development in one of the more advanced languages that micro:bit supports, such as MicroPython.

Final Result

With a bit of double-sided tape both to hold the LED strip and the control unit, the installation can be done on a helmet. We can see that the above program behaves quite well: