I am building a GPS tracker build on Raspberry Pi Pico and a u-blox NEO-6M GPS module. Now, I want to power this project with a lithium battery that can offer some autonomy. I was thinking of using a 8200 mAh, 3.7 V battery, connected with my bike dynamo to constantly charge it. Normally I produce 200 W in a five or so hours trip, 300W in much less. A commonly quoted efficiency for electrical generation is 80%, but let's assume 75%.

200 W × 0.75 = 150 W

300 W × 0.75 = 225 W

Daily I need to use my bike for 15/20 mins, so we can take the higher figure. 15 minutes is 0.25 hours, so we have

225 W × 0.25 h = 56.25 Wh

So that would run a 100 W load for half an hour (provided the remaining parts of the system were 90% efficient.) Based on these numbers, I could charge the battery, but I need to understand 3 things:

  1. How can I connect both the dynamo and the Pico to the battery
  2. And how can I avoid to make the battery explode?
  3. How can I safely connect the battery to the Pico in case I don't use a USB shield + port?
  • \$\begingroup\$ A dynamo will just output power, you need a charger. To connect the pico and gps you use a buck converter. Then a lot of finetuning sleep modes for the pico and gps, to minimize the power usage. Btw, I did some rough calculations on this a while ago, and you need to bike a lot to charge these batteries full. \$\endgroup\$
    – MiNiMe
    Oct 24, 2023 at 12:33
  • \$\begingroup\$ Wasn’t there an identical question to this posted last week? \$\endgroup\$
    – winny
    Oct 24, 2023 at 13:41
  • 1
    \$\begingroup\$ @winny Two, one was strangely enough migrated to Raspberry Pi. \$\endgroup\$
    – MiNiMe
    Oct 24, 2023 at 19:17

1 Answer 1


I think your numbers are wrong. 200W sounds like the energy you produce to power the bike, and cannot be used to charge a battery if you still want the bike to move.

I think a dynamo will generate more like 3W. This might well be enough power to run a microcontroller and a GPS module, at worst you'd need to consider sacrificing the number of GPS updates to bring the power usage down, or else downgrade from a pico to a smaller microcontroller. You'd need to look at the power requirements of your GPS / and the pico. You can also make up any excess by charging the battery when not on the bike.

So you take the W generated by your dynamo and subtract the W needed to run your system. If you have a positive number, your system will run happily off the dynamo, if you have a negative, then the battery will need to make up the slack and you'll have to charge the battery in between rides. Naturally, you want the battery in order to compensate for variation in the power from the dynamo, which might give you 3W on the flat, and 2W when slowly crawling uphill. So ideally your load needs 2.5W, so on the uphill your battery discharges, but on the flat there's spare power to recharge the battery

Your battery size seems pretty big to me, as it could produce significantly more power than the dynamo and significantly more than I think you'll need.

Adafruit do some nice lipo charge/discharge controllers that might be a good place to get started.

  • \$\begingroup\$ I got a couple of Shimano hub dynamos, rated 6 V 2.4 W and 3 W respectively. Not sure questioner ever look into the dynamo part. SON dynamos can possibly go higher than 3 W. \$\endgroup\$
    – MiNiMe
    Oct 24, 2023 at 12:36
  • 1
    \$\begingroup\$ I've tweaked the numbers to reflect this info \$\endgroup\$
    – LordTeddy
    Oct 24, 2023 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.