Introduction: DIY Bike Generator
Using easily accessible parts, it is possible to build your own bicycle generator that will charge your cell phone! This instructable is an extension of this instructable made by our friends. Eventually, this bike will stand on its own in our student union, so our classmates can sustainably charge their phones off the grid!
The basic setup of the bike is as follows: the back wheel of the bike spins a DC motor via fan belt, the motor is connected to a charge controller, the charge controller charges a lead-acid battery, and the battery is then connected to an inverter. You can then plug your phone into the outlets of the inverter!
Basic Materials needed:
Bicycle Stand
Bicycle Frame with Back Wheel
Wires, Screws, Wood, and a Metal Rod
NOTE: We added more to our bike to make it run better, but these are the bare minimum materials to get it up and running.
Step 1: Assembling the Bike
We attached our bike system to a 2' by 6' piece of plywood. We used a bike stand to suspend and stabilize the back wheel. You can bolt the back wheel stand to the board, but we thought it was unnecessary since other portions of the bike were attached to the board. Our bike was donated with the front wheel off, so we built a front wheel stand. Make sure you have enough room on the board to attach the motor behind the back wheel!
Building the front wheel stand: The forks had a 1 cm diameter hole, so we found a one inch dowel for it to rest on. In addition, we took a 1.5" x 3" wooden beam and cut it into two 9.5" and two 4.5" blocks. We drilled a 1cm hole 1/2" down from the top of each of the 9" blocks. We then put the metal rod through the blocks and assembled the stand (see photo above). We added some washers and nuts to make the connections more secure. The two 4.5" blocks should be cut to fit tightly between the 9" blocks, as shown above. After building the bike stand, the front wheel should sit snugly on the blocks. Next, we screwed the lower 4.5" block down to the plywood. Finally, we attached the upper 4.5" block for stability. Now the bike stand for the front wheel is complete and should sit snugly on the rod between the blocks.
Step 2: Adding the Fan Belt to the Motor
We removed the tire from the back wheel using this video (make sure all the air is out of your tire). Next, we attached the pulley to our motor by adding a collar to the pulley and making it D-shaped. The pin running out side of the motor is in a D-shape so this allows the pulley to fixate to the motor and rotate the internal portion of motor smoothly. The screw holding it on is a left handed screw that goes on in the opposite direction of a normal screw allowing the motor to turn without having the screw come out. We then attached the belt to the wheel and to the pulley. Make sure that the motor is directly aligned with the back wheel. We screwed down the motor to the plywood base by having one person hold the motor unit as far back as possible while the other screwed it down, this insured maximum tension in the fan belt. The more tension we can get on the belt, the better it will work.
Note: Be aware of the direction that your motor is spinning in order to a positive and not negative voltage output. If it's negative, just switch the leads at your charge controller.
Step 3: About the Fan Belt Choice
The motor is rated at 2800 rpm, but riding at 20 mph is only 250 rpm at the back wheel. Thus, we chose a pulley with diameter about ten times smaller than the wheel, so riding leisurely could give us higher rpm (about 10x increase). For practicality purposes we chose the thickest belt that could fit in the rim of our wheel. Our belt was rather long because it needed to be able to fit around the entire wheel and still have extra length to attach the pulley at the motor. Depending on what belt you are using, the motor could be mounted at various distances from the back wheel.
Function of Motor: This component is what is converting the movement of your legs on the bike into a DC voltage.
Step 4: Step 4: Motor to Charger
Purpose of Charger
The charge controller regulates the rate at which current travels into the battery. Ultimately, the charge controller prevents overcharging and draining of the battery, which will ruin the health of the battery. If the battery is overcharged then water electrolysis will occur, converting the water molecules into hydrogen and oxygen gas inside the battery. This will increase the sulfuric acid concentration in the battery and expose the internal plates to oxygen, quickly degrading the internal materials. Draining the battery will lead to sulfation, the crystallization of sulfur on the plates inside the battery. This will diminish the concentration of sulfuric acid in the battery and it will no longer be able to charge to its original potential.
Charger Properties
This charger can regulate the amount of current going to the battery, read the voltage that you are producing when biking, and the total amount of energy you have generated in one bike session. It will not give you the percentage of the battery charged, therefore (this is in the additional section) we have required that the user ride on the bike a set amount of time before the inverter will allow them to charge their device and that the user cannot charge the device if they are not biking.
The battery that we are using is a 12 V battery therefore the charge controller we chose can take us from 12V to 24V. The battery has a maximum charging current of 5.4 A, therefore the charge controller should be put on a current output setting less than the max. Increasing the current that the charge controller is requiring will make pedaling harder. That’s a good reason why it’s good to keep the gear system on your bike, and not make it a one-speed!
Adding a Capacitor or Zener Diode
Also, it is important to not overcharge the power controller by biking over its limit of 24V. You can add a zener diode with a breakdown voltage of 24V, so that if voltage is above 24V the zener diode will allow excess voltage to flow away from the charger.
In this setup we added a capacitor in parallel with the charge controller to assist in regulating the voltage generated by the motor. If we were to suddenly have Lance Armstrong hop on the bike and generate a voltage more than 24V temporarily, we can avoid a sudden overload to the charge controller by forcing a regular discharge from the capacitor.
Step 5: Step 5: Charger to Battery
Choosing your Battery
As we said before, you want to make sure that your battery is being charged at an appropriate current and voltage, well within the limits listed on your battery. Be sure to find a battery that your charge controller can charge or vice versa. The reason that you want to have a battery is so that you can store the energy that you are creating—so that you don’t have to bike constantly to charge your device and that you can bike without charging a device and store your energy for later.
Taking Care of your Battery
Make sure your battery is not moving when you are biking—sloshing around the liquids in the battery will add a kinetic energy variable into storage of your energy. It’s not a good variable. Your battery will output different voltages at different levels of charge. The voltage across your battery will be different when it is charging, sitting, and discharging; they will be about 14V, 12.5V, and 11 V respectively. Remember that these values will change over time (most likely decrease) as your battery ages and is being used. Degradation will occur. Be sure that if the output of the battery is 14V then you drain the battery so that it doesn’t overcharge.
http://www.power-sonic.com/images/powersonic/sla_batteries/ps_psg_series/12volt/PS-12180_12_Sept_10.pdf
Step 6: Step 6: Battery to Inverter
Purpose of AC Inverter
The current that comes out of your wall socket is alternating current (AC) rather than direct current (DC). The inverter converts the DC output of the batter to AC so that you can appropriately charge your devices. Also it provides the infrastructure to charge your devices, as in a plug and USB ports.
Choosing the Right Inverter
When choosing your inverter you want to be sure to make sure it give an output current and voltage similar to that of your typical wall socket, accepts a range of voltages similar to your battery, and the wattage that it can output.
Depending on the devices that you decide to charge (here we were interested in charging laptops, cell phones, and other small student devices) you need to make sure your inverter can output the right amount of watts. As a reminder, watts are a measure of energy required over a unit of time, joules per second. Appliances typically list the wattage that they require but to give you an idea a cell typically requires 5 watts and a laptop computer requires about 45-60 watts. The inverter featured in this instructable has a capacity of 400 watts.
Step 7: Making the Bike User Friendly
Our aim is to put this bike in our student union. Therefore we wanted to make this bike as user friendly as possible. A big obstacle we found was that the charge controller required you to press a button for 3 seconds in order for it to start charging. Although this is relatively simple for us to do, we felt like other users might not read the directions and think that they were charging even though they hadn't pressed start. The screen lights up which is misleading because it is technically "on", but is not charging. Therefore, we hacked our charger and will control it with an arduino instead to make the energy generation process user-friendly.
Step 8: Hacking the Charge Controller
Hacking the Charger: We took apart the charger by unscrewing the sides and popping off the top lid. We found that there was a ribbon wire connecting the 4 buttons to the circuit board. There were 5 wires on the ribbon wire, thus we thought that there might be one "reference" wire and the other four wires went to the buttons. Connecting the "reference" wire to any of the other four button wires was equivalent to pushing a button. We took a multimeter and tested our theory, and it was valid. To press a button, we should connect one of the wires with the "reference" wire. Next, we added wires to each of the five terminals where the ribbon wire used to connect to. The wires were led outside of the charge controller by drilling a hole through the side panel and pulling them through. These wires lead to our arduino shield, which will allow us to press the buttons and control the start button autonomously using a relay.
External Buttons: We used 4 buttons on our shield to recreate the buttons on the controller for testing purposes and in case we wanted to change settings on the charge controller.
Use of a Relay: We used a OMROM G5V-1 Relay to "press" the start button using our arduino. The image above shows how we connected each of the relay pins. The digital output pin from the arduino that is wired to the relay will signal the pressing of the button when it is set to HIGH. Two other pins on the relay connect to the start button wire and the "reference" wire, completing the connection. We had to connect one other relay pin to ground. For precaution, we put a diode across signal and ground of our relay because we don't want current flowing into our arduino when the digital output pin is switched to LOW (start button is off) . Now the arduino has the capability of pressing the start button autonomously.
Programming the Start: Although we know how to get the arduino to press start, we don't know when to tell it to do so yet. We would like it to press start for a few seconds after the user has been pedaling for about 10 seconds. How will we know a user is pedaling? We would like our arduino to read the DC voltage of our motor which will be present when a person is biking. However, our voltage is more than 5V, so our arduino cannot read it directly as it has a limit of 5V. We used this article to create an appropriate voltage divider to have the arduino read motor voltage.
A simple sketch of this voltage divider is in the picture above. I will include all the arduino code in another step. We used a 3.9K and 1K resister to scale down the voltage going into the arduino by a factor of 5. We've yet to pedal hard enough to get the motor to go above 17V, so we should be safe. Usually, we are outputting less than 15V from our motor. The voltage divider will go into an analog input in the arduino which will let the arduino calculate the motor voltage.
Psudo Code:
void loop(){
while(!started){
startCharger();
}
void startCharger(){
if (motorVoltage>12 && hasBeenOnForLong){
digitalWrite(relayOut, HIGH); //which really is equivalent to pressing Start
started=true;
}
else if (motorVoltage>12){
//say it has been on for longer
}
else{
//reset hasBeenOnForLong to the beginning
}
}
Step 9: Battery Voltage
We soldered an additional voltage divider to the shield in order to measure the voltage of our battery. We found that this was the best way to calculate how much our battery was actually charged. The output voltage of the battery is between 14-11V; decreasing as it becomes discharged. We found these tables which relate the output voltage of the battery to the battery state of charge in percent values for a 12V Lead Acid battery. We can make estimates from this graph, but we will further calibrate it later. Eventually we could add an LCD screen to readout the percent battery charge on our arduino. This readout can be coded by a lot of "if" statements simply structured as follows:
if(batteryVoltage<12){
batteryPercent=.7;
}
Because the battery only outputs up to 15V the absolute worst case scenario, we chose 2.2K and 1K resistors for our voltage divider. This divider works the same as our motor voltage divider. The picture above shows the resistors for the voltage divider on our board.
Note: Batteries degrade over time and the the capacity to which a battery can charge will change, altering the percent charge graphs.
Step 10: Preserving the Battery
Lead Acid Batteries last a lot longer if they are not completely drained. Furthermore, we want to make sure users are generating electricity and not just charging devices from the battery without pedaling. We decided that we wanted users to bike for at least 2 minutes continuously before they were allowed to charge their phone. This idea turned out to be a little difficult, because we need something that can control a lot of current. We ended up employing a HUF7345 MOSFET, which we be between our inverter and battery. When we signal the MOSFET with our digital output pin on the arduino, it will allow current to flow from the inverter to the negative terminal of the battery, thus completing the inverter/battery portion of the circuit. When it is signaled on, the MOSFET will act as though it is not there at all and the cell phones can charge normally. This is possible because the MOSFET we used allows a high current. However, we decided not to allow computer charging on our bike because that would draw more current than the MOSFET could handle. Furthermore, we were afraid the computer would deplete our battery. We are relying on some users biking just for fun without charging.
We will keep track of time since the charger pressed start and once two minutes have elapsed, we turn the MOSFET "on" by setting the digital out to HIGH. Here is part of the code:
String allowBatteryAccess(){
if(currentMillis-startMillis>(1000*120)){ //if 2 minutes of time has elapsed
digitalWrite(allowBattery, HIGH);
return "Your device has started to charge. Keep Peddling";
}
return " "
}
Step 11: Board Layout
We soldered all our components to a small board. Here is a color coded layout of how we attached everything. A lot of what we were attaching was to components off the board, so the names of these components are written instead. Attached is the untested Arduino Code for our board.
Attachments
Step 12: Current Progress
Our board currently has the same functions as the charge controller before it was hacked with the arduino. We have the board wired up for the most part, but we need still need to attach a couple more components:
- attach the battery and motor positive leads to the voltage divider
- ground the other end of the voltage divider
- attach the inverter negative lead to the drain of the MOSFET
- attach the ground lead of the battery to the source of the MOSFET
- attach battery ground to the arduino ground
- ground the relay
These connections may be more difficult to create because the wires on the external components of the mortor and charge controller are much larger than the wires on our arduino shield. Once we get everything added we can test our code. We may need to fiddle with the timing of the start button and how long we it will be "on". The charger performs battery checks when it turns on so we might need to hold it down for as many as 8 seconds. We will check this once we get our board finished.
Step 13: Future Ideas
Though our system works, there is a lot more to be done with user interfacing before it can be introduced unsupervised in the student union. We definitely should encase our electronics so that no one can touch them. We also would like to have a LCD display the can interact with the user showing how much they have charged the battery and their real time motor output voltage. We already have a clear plexiglass stand where people can put their homework reading. We plan to have instructions pasted to the back of this stand and mount the charge controller and arduino to the bottom of the stand.