# # Bike dynamo

I was recently planning a longer bike tour, where I would enjoy the wonders of sleeping under a tent and a wide open sky.

Retreating to nature is fun, but as a society, we're addicted to electricity. As a data hoarder, the very least I need to do is to keep my GPS tracker charged. The camera with a full battery is nicer than a dead one, too. This poses some logistical challenges if you don't want to regularly check into hotels, or libraries, or restaurants. And when cycling, I like having the freedom of not **having** to do many things.

This means I **should** produce my electricity myself to rely less on civilization.

I'll mention solar cells just to dismiss them: they don't work when I cycle, they don't work when I sleep. Next!

## ## Dynamo

If the rumor is to be trusted, a bike dynamo is not a dynamo, but rather an alternator. It produces alternating current. But how exactly? What are the pitfalls of using a dynamo to power circuits?

### ### AC

Alternating current is not directly useful for charging batteries. The AC needs to be rectified first, and a rectifier bridge made out of 4 diodes takes care of that.

### ### Voltage

After the rectifier stage, we have direct current. But what voltage? Most bike dynamos are rated for 6V. But if you connect a multimeter (and nothing else) to the dynamo and spin the wheel, you'll get more like 30V to 100V AC peaks. Those rectify to way more than 6V. You're about to fry your USB device if you plug it in.

On the other hand, attach a small resistance and you don't even get the rated 6V. What the heck?

So I decided to run an experiment. I attached various resistive loads to a wheel with a hub dynamo, caught the axle in a vise, whipped out a hand drill, and held it against the tire to spin the wheel at an equivalent of about 20km/h.

This is a table of voltages I got:

resistance [Ω] | AC voltage[V] |
---|---|

3200 | 28 |

1000 | 23 |

1000 | 22.4 |

470 | 26 |

470 | 23.2 |

68 | 22 |

22 | 13.2 |

6 | 8.6 |

4 | 4 |

2 | 1.8 |

0.8 | 0.6 |

0.4 | 0.4 |

Some values repeat because I couldn't believe my eyes (j/k I was just sloppy at taking notes).

Clearly, a dynamo is not a voltage source. You'll find out as much after five minutes of research.

### ### Current

But is it a current source? If so, then the current should be equal across all measurements. And current = voltage / resistance, so we can quickly calculate it and add it to the table:

resistance [Ω] | AC voltage[V] | AC current[A] |
---|---|---|

3200 | 28 | 0,0087 |

1000 | 23 | 0,023 |

1000 | 22.4 | 0,022 |

470 | 26 | 0,055 |

470 | 23.2 | 0,049 |

68 | 22 | 0,32 |

22 | 13.2 | 0,6 |

6 | 8.6 | 1,4 |

4 | 4 | 1 |

2 | 1.8 | 0,9 |

0.8 | 0.6 | 0,75 |

0.4 | 0.4 | 1 |

The current isn't always equal, as it goes from almost nothing with a high resistance to over 1A. So no current source, either?

### ### Fitting a dynamo model into a current hole

There's no clarity from looking at raw data in a table, so instead I decided to guess a model and see whether it matches the data.

First I had to decide whether I wanted to model a current source, or a voltage source. Fortunately, Thévenin's theorem says that one can be converted to another. So I simplified my life by modelling my circuit as a voltage source with internal resistance:

The current(resistance) function to fit to match the data looks like this:

i(r)={v}_{s}/({r}_{s}+r)where r_s is the internal source resistance.

After letting gnuplot find the best fit, it finds v_s = 23.9184 and r_s = 14.492. The plot looks like this:

Given that the data already contains 28V, I don't think it's a great fit. And I suspect there's more power hiding near the 1.4A, which should form a peak, but there isn't one in the best fit. Given that, the model seems wrong.

But I don't know what other model I could use. If you know, I'm eager to hear from you!

But this model is enough to estimate that any circuit dealing with the dynamo should withstand about 30V at about 20km/h. Investigation at higher speeds will continue after I find a faster hand drill.

### ### Spikes

Except when the voltage spikes. If you're like me, your connectors will not be attached with micrometer precision and steam engine forces. It may get torn by accident or just get loose from all the experimenting. As the spinning dynamo on a bike in motion disconnects from the load, its resistance jumps to infinity, and voltages on the leads spike to 100V or maybe even above that.

And when the connection catches again, your circuits are in for a shock. Literally. Look at this vertical line at the beginning of the graph. That's the moment I connected the spinning dynamo.

The shock isn't long, but apparently it's enough. This matter has been brought to my attention because someone had had multiple lights fried for no clear reason.

Thankfully, it's possible to mitigate. Experiments showed me that sticking a 30µF capacitor rated for 50V in parallel to the load is enough to absorb the shocks. A TVS diode (or two) might also be sufficient.

### ### Overvoltage

Okay, but what if 30V is still too much? You'd like to cut it off, even at the cost of losing some of the energy, because you just can't find a reasonably sized or priced component that can handle it?

Notice that current goes WAY down above about 23V and stick two Zener diodes in series, parallel to the load. A Zener diode cannot handle much current, but there isn't much to divert, either.

If that's still too much for you, add a resistor in parallel to the load. Choose one based on your preferred voltage from the table above, just be aware that it caps the voltage by always diverting some of the power.

### ### Power

One more thing we can estimate is power. The spice must flow into those batteries! How much can we count on? Power = voltage · current. Skipping directly to the plot:

Again, the fitted curve is kind of crazy, but at least we already know that we can cross 10W. I strongly suspect this is not the last word of the dynamo, given online tests, but more measurements are needed.

## ## Sources

The data for the plots and the code can be downloaded: data, plot. Run with ``gnuplot -p ./dynamo.gnuplot`

`