I added Neopixel programmable LEDStrips to my longboard. By measuring the speed of the board using some magnets and a hall effect sensor I can have the light-effect of the strip move with the same speed as the board, Making it look like I am driving past lights that are fixed to the street but light up when I pass by.
I made this longboard for my column in Dutch newspaper "De Volkskrant", read the column here: (in Dutch, will be added on June 18th).
For more projects, follow me on youtube: Rolfs Youtube Channel
or on twitter: @RolfHut
After publishing this instructable user A_Steingrube pointed out that it looks very similar to his project that he posted 5 years ago. It does indeed! He glued individual LEDS to his longboard in stead of the ready made neopixel ledstrip that I use. This does allow him to only use one Arduino, but involves a lot of soldering and glueing. Check out his instrucable.
Disclaimer: I had the idea for this project while attending the fabrication class at the high school where user Arjan teaches and was not aware of A_Steingrubes work before he pointed me to it. If ever one has to appoint the "inventor" of the LED-longboard: it is obviously him: he beat me by five years.
Step 1: Tools, Materials and Skills
You will need the following materials:
- a longboard. Make sure your long board does not "dip" too low between the wheels: you need the space to hide the electronics
- two stretches of Neopixel LEDstrip. I used these: https://www.adafruit.com/products/306. The strips must be as long as the sides of your longboard.
- two Arduino micro's. https://www.arduino.cc/en/Main/ArduinoBoardMicro.
- hall effect sensor. I used the 49E. Datasheet here: http://www.hallsensors.de/CYL49E.pdf
- four small (2 mm cube) permanent magnets.
- assorted electronics: two 1000 mu capacitors and one 1kOhm resistor.
- USB cable (to be cut open!)
- two medium size adhesive breadboards.
- box that will hold two breadboards and fits under your longboard.
- box or tube that will fit your power-bank and fits under your longboard..
- breadboard wires
- electrical wires
- shrink tubes
- lots of glue-sticks
and the following tools:
- soldering iron
- hot glue gun
- electrical pliers
- wooden chop sticks. (really).
- Dremel. (or other implement to make some holes in the boxes.)
The following skills are essential in building this longboard. If you do not feel comfortable with any of these, do not stop, but do please look up some tutorials before moving on.
- soldering. (tutorials: https://www.instructables.com/id/Soldering/ )
- programming an Arduino (great youtube playlist by Jeremy Blum: https://www.youtube.com/playlist?list=PLC55F5A7E2B8F422A )
Step 2: Hall Effect Sensor and Magnets
First, plan out where your box will be glued to your board. Solder wires to your hall sensor long enough to run from one of the wheels to well inside the box. Shield the pins and solder joints with shrink tubes.
Than, push one of the Arduino's in one of the breadboards and connect the hall sensor. Double check the datasheet for your particular hall sensor to see the pinout. Connect VCC to 5V, GND to GND and data-out from the hall sensor to D2 of the Arduino. Upload the example code "Digital Read Serial" from the 01. Basics menu from the examples to your Arduino. Open Serial Monitor on your laptop and watch the string of zeros indicating "no magnetic field". Than, take on of the permanent magnets, bring it close to the hall sensor and see it change from zero to one. You may need to flip it around a few times to find the face of the magnet that will trigger the hall sensor. Mark which side of the magnet triggers the sensor. Do this for all of the magnets.
One by one, glue the magnets to the inside of the wheel. This is where you need the chopsticks. Drop a drop of superglue on a scrap piece of wood. Pick up one magnet with the chopsticks, dip it in the superglue and than press it on the wheel. I found this was the one way I could do this, without either having the magnets stick to metal tools, or glueing my fingers to the wheel. Make sure that the face that triggers the hall sensor points to the center of the board. Hotglue the hall sensor on the trunk of the longboard, such that there is less than a millimeter of space between the magnets and the sensor when it passes. Check again if the hall sensor detects the magnets by looking at the serial monitor while slowly turning the wheel.
Step 3: LED Strip Testing
Cut open the USB cable, making sure that the length remains enough to reach the location of the power-bank once everything is installed. Identify the ground (GND, -) and the VCC (5V, +) and solder breadboard wires to them. If the LEDstrips did not come with connectors, solder wires to the VCC, GND and Data lines of the strips. These have to be long enough to reach the box from the start of the LED strip.
To test the LED-strips, plug the second Arduino Micro into the second breadbord and connect everything using the schema in this step. Than upload the "strandtest" example code from the Neopixel library, remember to change the number of LEDs in the code before uploading. If this is all greek to you (is was to me when I started this project), than walk through the Neopixel tutorials on the Adafruit website and pay very close attention to the power consideration: never have the power to the LEDstrips run through your Arduino! This means that you have to connect the power bank, even if you are having a USB connected from your computer to the Arduino. https://learn.adafruit.com/adafruit-neopixel-uberguide/overview
Step 4: Attach LED Strips to Hall Sensor
Connect the two boards by placing the two breadboards next to each other and hooking everything up using the schematic in this step.
All code can be downloaded from: https://github.com/MaakbareWereld/LEDlongboard
Open LEDstripcontrol.ino and speedMeasurement.ino in the Arduino IDE. Both programs have some important constants defined on the top that you might need to change: the number of LEDs, the maximum speed you want to go (in km/h) and the diameter of your wheel. Change them to the appropriate settings.
Upload the code LEDstripcontrol.ino to the right Arduino in the schema (the one controlling the LEDstrips, that was running teststrand up till now) and speedMeasurement.ino to the left Arduino in the schema (the one connected to the hall sensor).
Test everything by spinning the wheel!
side note: why two Arduino's?
It may seem like overkill to use two Arduino's, but in this case I really needed to. The fastled library that we use to drive the neopixels is very picky with respect to timing: 800 times per second the leds need updated information. When this happens, all code operations stop for a few milliseconds. Even (most importantly) all interrupts are surpressed. If, in this time, a magnet would pass the hall effect sensor, that measurement would be lost. A quick back of the envelope learns that this would happen fairly regular. Therefore, the second Arduino measures the speed of the board and passes that information to the first board.
Normally, for information passing, one would use a digital protocol (Serial, I2C, etc.) However, these protocols might suffer the same problem: interrupting the communication to the LEDstrip. Therefore, I went with analog communication. The speed is translated into an analog signal on (PWM) pin 9 of the speed-measurement Arduino. This is read by the LEDstrip-controlling Arduino on analog input A0.
Step 5: Attach and Hide Everything.
Only when everything works, glue everything in its place. I used generous amounts of hot-glue to glue the neopixel strips to the board. Hot glue is not ideal for the LEDstrips plastic coating: it easily detaches again. I still choose to use hot glue just for this reason: It allows me to harvest the LEDstrip in the future, if I want to use it in another project. If you want a very permanent solution to fixing the LEDstrip, browse the adafruit forums for advice on the correct adhesive for your situation.
Drill (or Dremel) some holes in the box for cables, glue everything inside and glue the box to the board. Glue the box for the powerbank close enough to attach the USB cable without it hanging on the ground when driving, but far away enough that you can get the powerbank out to recharge.
Double check everything, than get outside and ride the lightning!