Our son has been riding these motorbikes since he's been able to walk and loves to roam around our local park, usually going way too fast and waaay too careless. During the winter, when it gets dark pretty soon around here, he's been quite "invisible" to us and to other people on bikes, Segways, etc. So I decided to tune his motorbike up a little bit with LEDs.
I've been reading and getting inspiration from many instructables. This is the first one of my own, so I hope you'll like it & get me some feedback :)
Step 1: Materials & Tools
- Waterproof addressable 5V RGB LED strip (I used WS2812 - only 30 LEDs per meter as they draw a decent amount of current)
- Double-sided adhesive tape - preferably waterproof (if the LED strip does not come with a strong enough adhesive tape) or you can use some glue suitable for plastics, which will last a lot longer than the tape - especially after riding in the rain ;)
- Arduino Nano (best without the pins soldered = saves space)
- Batteries - I recycled a couple of old laptop 18650 Li-ion batteries (a LiPo battery pack will work too - some 1000+ mAh should be enough)
- Suitable battery charger (like TP4056 with undervoltage protection)
- Micro USB Step up module
- Any ON/OFF switch
Tools you will need:
- Rotary tool for the cutout in the plastic "engine"
- Drill for making holes (switch mounting, USB adapter)
- Soldering tools
Step 2: Get a Suitable Kids Motorbike
Pretty much any plastic motorbike will work, though the best motorbikes are those that have a separate "engine" part that comes off - usually on the bottom of the motorbike - which can be used for housing all the electronics. Ours was a well-used typical local brand KCX Enduro bought second-hand for a few euros :)
If your bike has a storage box or something similar, that would work too.
Step 3: Mounting the LEDs
Depending on the size of your bike, you should cut the appropriate number of LEDs from the 5m strip - in my case 32 was enough - they are bright enough even during the day. Then it is time to tape or glue it to the bike body. The beginning of the strip should be around the engine area. Addressable LEDs have to go in a specific direction - usually marked with an arrow - so don't forget about that before glueing. In my case, having a waterproof LED strip, I used a double sided tape which is easy to work with, but does not last long. Next up for me would be glueing the strip directly to the body.
My strip just went all around the bike and I tried to have the LEDs facing out and down (not upwards) as that makes for a better effect - especially at night.
Do not glue / tape the strip onto the engine part is it would be difficult to access the electronics housing in the future.
If your LED's come with a plastic sleeve (my case) I would suggest hot glueing the cut end so that no water can get inside the strip. Some other waterproof strips are covered with translucent silicon - these may be better for this purpose as they are thinner - which also helps to prevent mechanical wear from the kid's legs.
Step 4: Hardware "engine"
The main thing is to find the most suitable housing for the electronics. Especially hidden away from water, sand and other "roadside danger". As you can see from the photos, mine has a black removable hollow "engine" part that is perfect for this. It can be easily pried off using a flathead screwdriver.
I cut a trapezoidal hole in the plastic with a Dremmel + two additional holes for the switch and USB charging port. The switch was mounted using two screws and the TP4056 board was hot-glued in place in between the wall of the engine and the switch, so that it stays in place even after the bike comes back from a bumpy ride. As the hot glue is somewhat flexible it does help in winter when the temperature gets low.
The hole is then taped with duct tape (thin enough so you can put the engine back as it just clicks onto the body). Only the LED connector is sticking out.
Step 5: Electronics
You can find a basic schematic on EasyEDA here.
The charging module is connected to the boost module with a simple switch in between. Then the boost module output is set to 5V and it goes to Arduino directly to the 5V input (no need to go through the Vin pin that has a voltage regulator on it). The LED strip is then connected directly to the 5V of the boost module and its digital pin goes to PIN 6 on Arduino via a 470 Ohm resistor. My preferrable
Usually the strip comes with a connector that can be used to easily join the actual strip to the rest of the electronics.
I used two 18650 batteries from an old notebook in parallel. It's not a good solution since the TP4056 module is really suitable for a single battery (so far it works). One cell should be OK with the boost module. My two batteries last for a fairly long time at 100% brightness but obviously it depends on the battery capacity, outside temperature, etc. I also tried to wrap the batteries in some package padding as my "home-made" soldered connectors kept breaking due to vibration - the typical 18650 battery holders would just not fit inside the engine. So I would definitely suggest using just a single battery with strong gauge wire well-soldered or a LiPo battery which would be a lot flatter and easier to mount.
You better make sure the wires are well soldered with a good anti-vibration dampening in place. What I would definitely suggest is to use some strong gauge wire. The bike gets a lot of vibration and the small wires break after a while - personally tested as I used some basic wire as is seen in the photos - already fixed broken wires at least 5 times. As the motorbike speeds over pebble stones and is thrown down the stairs, it does not take much for the wires to come loose ;)
Step 6: Arduino Code
For the WS2812 LEDs, you should use the Adafruit_NeoPixel library, which works great. Other than that I have set up a few effects that are running in loop on the bike.
You can find the code on github here.
Enjoy the ride :)
As for the future, it would be cool to vary the effects based on a gyroscope / accelerometer combo ;)
Participated in the
Microcontroller Contest 2017