Harnessing energy from a bicycle

I enjoy cycling not only because it is one of the most efficient and cheapest forms of transportation, but also it is very satisfying. Yeah hills can be a pain but what goes up must come down, eventually.

When I ride my bike I like to have my phone with me so that I can have a map, a list of directions and also see how fast I am going. Couple of years ago I created an electronic dashboard for cyclists called Smart Turn. It was designed to help cyclists navigate safely through urban roads.

Smart Turn consisted of a mobile phone app and a safety vest with lights. The lights can be activated wirelessly to indicate turn signals and braking. I successfully created a working prototype of Smart Turn. However, it had several issues:

  1. The cell phone battery dies fast
  2. The turn signal lights cannot be seen during the day
  3. The vest is cumbersome to wear, specially in hot weather

The biggest problem it had is with the cell phone. The Smart Turn app uses GPS, Bluetooth and keeps the screen on all the time. This makes the cell phone battery drain in a couple of hours. So to fix this issue I created a cell phone charging system for my bicycle.

The cell phone charging system uses both solar and pedal power to charge the phone. While building this I decided to also include a battery pack, a front lamp, and a rear lamp which could also be powered by the same charging system.

The following is a schematic of the charging system:


Schematic of bicycle charging system

The Dynamo

For the dynamo I used a stepper motor. This Nema17 stepper motor was rated at 12 V and 1.2 A per phase. Generally the higher the amp rating of the motor, the more power it can generate. The first thing I needed to do is to verify that this motor can generate enough power to charge the cell phone and accessories. To do that I had to attach the motor to the bicycle wheel. Thanks to my 3D printer I was able to make a holder to attach the motor to the bicycle. Then I also 3D printed a contact wheel for the motor.

Dynamo motor attached to the bicycle

Dynamo motor attached to the bicycle

Contact wheel of the dynamo

Contact wheel of the dynamo

This stepper motor has two pairs of windings. Each pair of windings generates an alternating current when the motor is rotated. To convert the AC to DC, I used a multi-phase rectifier bridge as shown in the schematic.

During initial testing I found that the motor can generate up to 70 V when hand cranking the pedal. So it was obvious that I needed a regulator before connecting it to a cell phone. As shown in the schematic I made a simple regulator using a 5.6 V Zener diode and a TP129 transistor. The transistor needed to have a heat sink since it will be generating a fair amount of heat. I put the regulator and the mode select switch in a control box under the back of the seat. The six position mode switch selects which power source is connected to which device.

Six position mode switch for selecting which power source is connected to which device

Six position mode switch for selecting which power source is connected to which device

Solar Panel

The Solar Panel I found at a local electronics store is rated to produce 200 mA at 5 V in direct sunlight. The only thing I had to do for this is to design a holder to attach it to the bicycle.

Solar panel attached to the front handle bar

Solar panel attached to the front handle bar

The Battery Pack

The battery pack consists of six Ni-Cd batteries arranged in two rows with three batteries per row connected in series. These batteries are salvaged from old solar garden lights. Ni-Cd batteries are safer and easier to charge compared to Li-Ion batteries. Also a special charging circuit is not required for Ni-Cd batteries as long as the charge current is limited.  The two rows of batteries power the front and rear lamps when neither the solar power or pedal power is available. The battery pack can be recharged by either the solar panel or the dynamo. I made a case for the battery pack using the 3D printer and sealed the case using a glue gun.

Rechargeable Ni-Cd battery pack made using solar garden light batteries

Rechargeable Ni-Cd battery pack made using solar garden light batteries

Front & Rear Lights

Both the front and the rear lights consist of two LEDs that blink alternatively. The blinking circuit is simply an astable multivibrator made with a couple of transistors. For the rear light I designed and printed a case from  scratch. But the front light is hacked from a purse light. The lights can be power from either the battery pack, solar panel or the dynamo. Although powering the lights with the solar panel is somewhat useless since there is no need for lights when it is sunny.

Front and rear lights

Front and rear lights

This charging system will significantly extend the battery life of the cell phone and uses energy that is freely available. The next step is to make turn signal indicators that are visible during the day. Unlike the front and rear lights the turn signals will be attached to the rider instead, making them more effective. More on wearable turn signal indicators will be covered in the next post.

3D printer and first case for Gyro’clock

The 3D printer arrived a week ago and I have been using it pretty much every day since. The Prusa I3 DIY printer kit I ordered from Amazon came from a company called Shenzhen Anet Technology. They provided instructional videos of how to assemble it, and it took me about a full day to put it all together. Assembling the printer was quite fun and it’s great to know what every nut and bolt in it does. The printer also came with two spools of PLA filament.

Here’s the completely assembled 3D printer:

Fully assembled 3D printer

Fully assembled 3D printer

So for my first test I decided to print the Gyro’clock case I designed previously. The 3D printer firmware understands G-code. To convert the 3D design made in FreeCAD to G-code it must be given to a slicer software. The 3D printer manual recommended to use Cura for slicing, so I decided to use it. The slicer program literally slices the 3D model into many layers for the 3D printer to print one by one.

After exporting the design in FreeCAD as a .stl (stereo-lithography) file I opened it up in Cura. When you first start up Cura, you have to give it information about your 3D printer such as print size, nozzle and filament type etc. After loading the .stl file, Cura also gives options to scale, rotate and mirror the object, which is handy. After converting the image to G-code I saved it in an SD card, which can be inserted into a slot in the printer.

It took about an hour and a half to print the bottom part of the case, and this is how it turned out:

Bottom piece of the Gyro'clock case with the Gyro'clock PCB

Bottom piece of the Gyro’clock case with the Gyro’clock PCB

The top piece took only 30 minutes or so since it was smaller in size, and this is how it turned out:

Top piece of the Gyro'clock board

Top piece of the Gyro’clock case

During this first run of the printer I noted a few problems with my design and a few issues with the printer:

  1. The walls were too thin. I designed the walls to be 0.8 mm wide. This made the case too flimsy and it was too flexible. My attempt to remove the pieces from the printer bed caused them to bend slightly.
  2. The holes were too small. The screw holes I made to attach the board to the case and the top piece to the bottom piece were non-existent in the print.
  3. Printer does not wait for minimum time interval before moving to the next layer. There is a setting in Cura for selecting the minimum time spent on a layer. I set this value to 5 s. But I noticed when the top piece was printing the printer does not wait the minimum interval between the layers. This caused the snap on part of the top piece to deform. Could be a firmware bug.
  4. I forgot to create a window for the switch and the charger LED. There is no excuse for such carelessness!
  5. The printer has trouble making small overhanging features at 90°. This is understandable because there is no support underneath to hold the thin strands of melted plastic. So the first few layers of an overhanging section (or a bridge) does not hold well. But if the overhang is thicker and the bridge is not that wide then later layers will build up properly.
  6. Masking tape on the heated bed lifts causing the print to bend. This printer has a heated bed. Masking tape is put on the metal bed so the print job will not stick to it. On repeated use this masking tape looses its adhesiveness and lifts from the bed causing the printed object to bend. The solution for this is to replace the masking tape for each print.
  7. Formation of snags causes the printer head to jump. It was good that I noticed this problem before it became an issue. When the printer head moves across a gap following the same route multiple times, excess plastic can cause snags to form. The next time the printer head comes around the same path the snag could block it. This could cause the printer to misalign. Fortunately I saw the printer jolt a few times on a snag and cut off the snag before it got too large. A good reason not to leave a print job unattended for too long.

After cleaning up the two pieces of the case to remove snags and excess plastic I put the two pieces together. There was no need to attach the board to the case with screws since it fitted snugly. I also cut off the deformed snap on piece of the top part.

And here’s the resulting case:

First 3D printed Gyro'clock case

First 3D printed Gyro’clock case

This was a good learning experience about 3D printing. Now I know what to do for the second version of the case. It’s coming soon!