Instructables
Picture of IKEA Hack: Solar Powered Bike Light
53b18b499d29c9eaac0003b9.jpg
53b18b249d29c9665d0000c9.jpg
53b18a869d29c9149d000179.jpg
53b1ded79d29c9eaac000482.jpg

In school this year, I have a pretty late schedule. Sometimes i'll be coming home from class after
sundown and with a bike that can be dangerous. Before purchasing a commercial bike light, I decided to see if I could make one myself. Using an IKEA lamp I found at goodwill (for $2) I figured I could make a pretty unique, environmentally friendly bike light. The lamp that I will show in this instructable can be found here. It uses a solar panel and re-chargable batteries which provides 3.6 volts to light several LEDs. The solar panel takes about 9 hours to charge and can provide 3 hours of light. I thought those specs were perfect for embedding a microcontroller (such as an attiny) to make a stylish bike light. Here are some features of the complete bike light:

-Solar powered

-about 3 hour battery life

-backpack mountable

-extra bright with 4 LEDs

-8 different LED animations (selectable via a push button)

This project is great for students, bikers, makers, and anyone who enjoys tinkering with electronics! And best of all it is not expensive to make. The parts list won't set you back more than $3 (assuming you already own the lamp). However, before we begin here are some warnings I want everyone to acknowledge before continuing:

WARNING!: GREEN LIGHT IS NOT AN ACCEPTABLE COLOR FOR BIKING. I USED GREEN LEDS FOR STYLE. WHEN I USE THIS WITH A BIKE, I WILL NEED TO USE EITHER WHITE OR RED!

DISCLAIMER: I AM NOT RESPONSIBLE FOR ANY HARM DUE TO THE MAKING/USE OF THIS BIKE LIGHT.

Once you have acknowledged these warnings, lets begin gathering our parts for this project!

 
Remove these adsRemove these ads by Signing Up

Step 1: Parts

You'll need these parts:

-attiny85 (or attiny45)

-4 LEDs

-4 100 ohm resistors

-1 SPST button

-SUNNAN LED lamp

You'll need these tools:

-Soldering iron (with rosin)

-Hot glue gun

-Dremel

-Wire strippers

-Optional: Multimeter

Step 2: Open Wide!

Picture of Open Wide!
lamp3.jpg
lamp6.jpg
lamp7.jpg
53b18b059d29c9eaac0003b8.jpg

Lets begin by preparing the lamp for modification!

Begin by removing the solar charging pack from the lamp. To do this push the center of the lamp from the back, the solar pack should pop off. Set it aside. Next unscrew both the base. After, take out all visible screws inside the lamp's base and cut the wires leading to the LEDs through the bendable metal neck.

Now lets get back to that solar pack! Unscrew the four screws on the back of the pack and carefully take the case off. Once open you should see a PCB board, and a battery pack. Take out the batteries and check for any leaking material from each battery. If theres anything strange coming from the batteries, I suggest searching online for replacement batteries.

However, if they are OK, we can double check their voltage outputs with a multimeter then lets move onto some actually "hacking"!

Step 3: Gut It Like a Fish!

Picture of Gut It Like a Fish!
lamp11.jpg
lamp8.jpg

For our new electronics to fit in this case, we will need to make some room. Inside the case, you will notice several black weights screwed in inside the lamp. Before continuing be sure you have removed all these.

Next, get your dremel tool out and lets make some room for our SPST swtich button. Using the dremel, enlarge the hole which the metal spine protruded from so that or SPST button screws in. Then dremel four 5mm holes, one on each side, and two on the top. Be sure that the tips of the LEDs fit snug in the holes.

Once our SPST button and four LEDs fit in our case we can install them more permanently!

Step 4: Hot Glue It!

Picture of Hot Glue It!
lamp13.jpg

Before we semi-permanently install our LEDs to the case, lets test each LED to ensure we don't install a faulty one. Using a 3.3 volt supply (from the arduino), test each LED to make sure it actually emits light. To do this just connect your power supply to the positive side of the LED (the positive side is the longest lead) and ground to the other.

Ok now that we know each LED is functioning, we can mount them to the case. Slide each LED into the holes you dremeled out in the previous step. One by one, hot glue each LED (from the inside) into the holes. Be sure you use lots of hot glue to make sure that your LEDs are sturdy. If you have epoxy that would be a more permanent solution, but hot glue is nice since it is strong, yet it can still be removed.

Now that our LEDs are in place, lets focus on making our bike light circuit!

Step 5: Breadboard It!

Before soldering, lets build our circuit on a breadboard. To do this, use the schematics and code found on the next two steps. In those steps I will go over the details on what you must connect to what. However, you will need to know how to read schematics and basic coding skills. Also, keep in mind that you will have to know how to program an attiny!

Once you have programmed that attiny and the circuit is working properly, we can finally solder!

Step 6: The Schematic

Our schematic for this project is pretty easy on the eyes. All we have to worry about is connecting our LEDs, our SPST switch, and connecting VCC and ground. For those who are not firmiliar with schematics I'll go over whats happening with each pin:

Pin 1: Nothing!

Pin 2: Connect a 100 ohm resistor to an LED which is connected to ground

Pin 3: Connect the SPST button which is connected to ground

Pin 4: Connect to ground

Pin 5: Connect a 100 ohm resistor to an LED which is connected to ground

Pin 6: Connect a 100 ohm resistor to an LED which is connected to ground

Pin 7: Connect a 100 ohm resistor to an LED which is connected to ground

Pin 8: Connect to 3.6 volts

Step 7: The Code

Picture of The Code

If you use the schematics in the previous step exactly, you should just be able to upload the attached code and have a functioning bike light, but for those of you who want to know whats happening in the code continue reading.

All that is going on in the code is a "switch" statement and a variable which keeps track of what mode the program is in. Whenever the SPST button is pressed, the mode increments. There are eight modes, and there are four different LED animations (each one has two different speeds).

A fault of my code is that it uses the "delay()" function to animate the LEDs. It would be better to use the "millis()" function so that the MCU is never just in delay mode. However, using "delay()' still works quite well since we are only delaying for a few milliseconds.

Step 8: Solder!

Picture of Solder!
lamp14.jpg
lamp16.jpg
lamp20.jpg

Lets get this thing working! To solder the circuit, cut a small piece of perfboard sized to fit our attiny (and extra room for our wire connections). Follow the schematics shown in previous steps and look back at your breadboarded circuit to make sure you solder this right the first time. Here are some mistakes that are easily made with this circuit:

-Not using long enough wire.

-Forgetting to add resistors

-Breaking LED leads while trying to solder to them.

Once you have successfully soldered the circuit, we can mount your new solar powered bike light to your bike/backpack!

Step 9: Mount it!

Picture of Mount it!
53b1db949d29c9149d00023c.jpg
53b1d68d9d29c9149d00022f.jpg

Mounting your new solar powered bike light is going to depend on your bike and your backpack. Since it will vary from person to person, I'm going to just list many ways you can mount it and you can choose which method works best for you.

Here are some ways to mount onto a backpack/bike:

-Epoxy a belt-like strap to the back of the case, and belt it onto a strap on the mounting surface.

-Attach heavy-duty velcro to the mounting surface and to the back of the case.

-Attach a wire to two washers, put the washers on the screws which go into the back of the case. Put the wire through a strap on your mounting surface, and screw the washers in.

When you're all done mounting your new device, you can go take your bike for a spin and try it out!

Step 10: Bike Safely!

Picture of Bike Safely!
lamp24.jpg
lamp22.jpg

Now you should have a bike light to brag about! You'll be saving the environment from disposable batteries while riding in style with your new solar powered bike light. I hope building this light taught you at least a little about batteries, solar power, attinys, and green electronics. If you think this instructable is awesome then please give me a vote in either the Green Design, Summer #MikeHacks, or Battery Powered contest! Thank you for your interest!

Cool way to make such a portable bike light. Well done i just voted for your project.

Thanks for sharing your project with us.

bigbroimc2 months ago

This would be a great idea for a disaster kit I'm making. Could you write the code to blink S.O.S?

Just a thought.

bergerab (author)  bigbroimc2 months ago

Absolutely! Could you describe exactly what the S.O.S. blink should look like? Thanks for your comment

Here is a link that shows the light flashes for S.O.S.

bergerab (author)  bigbroimc2 months ago

After a little googling I actually found someone who got an "S.O.S." blink working on his arduino. Here is a link: http://www.instructables.com/id/SOS-signal-with-an...

All you have to do is write a new function named "sosFlash(){ }" or something similar. And between the curly braces, add the code from the instructable I linked you to.

Thanks for the comment!

tisaconundrum2 months ago

I like this :D Very neat.

bergerab (author)  tisaconundrum2 months ago

Thanks so much! If you get around to making your own, please attach a picture!

I will. I could probably go as far as turning it into a phone charger as well.
kenyer2 months ago

Someone had the idea for this as a reply on my Sunnan-hack. Really cool that you actually did it. http://www.instructables.com/id/Easy-IKEA-SUNNAN-hack-non-destructive/

bergerab (author)  kenyer2 months ago

Thanks a lot! And yeah I actually saw that comment after I wrote this instructable but It's funny that we both had the same idea!

kenyer2 months ago

The Sunnan battery life is actually not that great, so it might be an idea to change the batteries.

brmarcum2 months ago

Very cool idea. Completely repurposing that lamp was very innovative. Good job.

bergerab (author)  brmarcum2 months ago

Thank you so much! And if you are interested, I took all these pictures with my smart phone (an HTC ONE) instead of my usual cannon t3i. So you too could take pictures like this in expensively. It's all about editing! Thanks again for looking