An open source bike computer based on Raspberry Pi Zero (W, WH) with GPS and ANT+. Including offline map and navigation.

Overview

title

Pi Zero Bikecomputer

An open-source bike computer based on Raspberry Pi Zero (W, WH) with GPS and ANT+

https://github.com/hishizuka/pizero_bikecomputer

News

  • 2021/4/18 Please reinstall pyqtgraph when using python3-pyqt5 in Raspberry Pi OS (skip check if using).
  • 2021/4/3 Please reinstall openant and pyqtgraph because both libraries are re-forked.
$ sudo pip3 uninstall pyqtgraph
$ sudo pip3 install git+https://github.com/hishizuka/pyqtgraph.git
$ sudo pip3 uninstall openant
$ sudo pip3 install git+https://github.com/hishizuka/openant.git

Table of Contents

Abstract

Pi Zero Bikecomputer is a GPS and ANT+ bike computer based on Raspberry Pi Zero(W, WH). This is the first DIY project in the world integrated with necesarry hardwares and softwares for modern bike computer. It measures and records position(GPS), ANT+ sensor(speed/cadence/power) and I2C sensor(pressure/temperature/accelerometer, etc). It also displays these values, even maps and courses in real-time. In addition, it write out log into .fit format file.

In this project, Pi Zero Bikecomputer got basic functions needed for bike computers. Next target is to add new functions which existing products do not have!

You will enjoy both cycling and the maker movement with Pi Zero Bikecomputer!

Here is detail articles in Japanese.

Daily update at twitter (@pi0bikecomputer), and my cycling activity at STRAVA.

system-01-202106

system-02

Features

  • Easy to make

    • Use modules available at famous Maker stores.
    • Assemble in Raspberry Pi ecosystems.
    • Install with basic commands such as apt-get install, pip and git command.
  • Customization

    • Need only modules you want to use. Pi Zero Bikecomputer detects your modules.
  • Easy to develop

    • Pi Zero Bikecomputer uses same libraries as for standard Linux.
    • So, you can run in cross platform environments such as Raspberry Pi OS, some Linux, macOS and Windows.
  • Good balance between battery life and performance

Specs

Some functions depend on your parts.

General

Specs Detail Note
Logging Yes See as below
Sensors Yes See as below
Positioning Yes A GPS module is required. See as below.
GUI Yes See as below
Wifi Yes Built-in wifi
Battery life(Reference) 18h with 3100mAh mobile battery(Garmin Charge Power Pack) and MIP Reflective color LCD.

Logging

Specs Detail Note
Stopwatch Yes Timer, Lap, Lap timer
Lap Yes [Total, Lap ave, Pre lap ave] x [HR, Speed, Cadence, Power]
Cumulative value Yes [Total, Lap, Pre lap] x [Distance, Works, Ascent, Descent]
Elapsed time Yes Elapsed time, average speed(=distance/elapsed time), gained time from average speed 15km/h(for brevet)
Auto stop Yes Automatic stop at speeds below 4km/h(configurable), or in the state of the acceleration sensor when calculating the speed by GPS alone
Recording insterval 1s Smart recording is not supported.
Resume Yes
Output .fit log file Yes
Upload to STRAVA Yes
Live sending Yes But I can't find a good dashboard service like as Garmin LiveTrack

Sensors

USB dongle is required if using ANT+ sensors.

Specs Detail Note
ANT+ heartrate sensor Yes
ANT+ speed sensor Yes
ANT+ cadence sensor Yes
ANT+ speed&cadence sensor Yes
ANT+ powermeter Yes Calibration is not supported.
ANT+ LIGHT Yes Bontrager Flare RT only.
ANT+ Control Yes Garmin Edge Remote only.
Bluetooth sensors No
Barometric altimeter Yes An I2c sensor(pressure, temperature) is required.
Accelerometer Yes An I2c sensor is required.
Magnetometer Yes An I2c sensor is required.
Light sensor Yes An I2c sensor is required. For auto backlight and lighting.

Positioning

Specs Detail Note
Map Yes Support map tile format like OSM. So, offline map is available with local caches.
Course on the map Yes A course file(.tcx) is required.
Course profile Yes A course file(.tcx) is required.
Cuesheet Yes Use course points included in course files.
Search Route Yes Google Directions API
  • Map with Toner Map
    • Very useful with 2 colors displays (black and white).
  • Map with custimized Mapbox
    • Use 8 colors suitable for MIP Reflective color LCD.
  • Course profile

GUI

Specs Detail Note
Basic page(values only) Yes
Graph Yes Altitude and performance(HR, PWR)
Customize data pages Yes With layout.yaml
ANT+ pairing Yes
Adjust wheel size Yes Set once, store values
Adjust altitude Yes Auto adjustments can be made only once, if on the course.
Language localization Yes Font and translation file of items are required.
No GUI option Yes headless mode
  • Performance graph
  • Language localization(Japanese)

Experimental functions

ANT+ multiscan

it displays three of the people around you in the order in which you caught sensors using ANT+ continuous scanning mode.

Comparison with other bike computers

  • 200km ride with Garmin Edge 830 and Pizero Bikecomputer (strava activity)

  • title-03.png

Items Edge830 Pi Zero Bikecomputer
Distance 193.8 km 194.3 km
Work 3,896 kJ 3,929 kJ
Moving time 9:12 9:04
Total Ascent 2,496 m 2,569 m

Hardware Installation

See hardware_installation.md.

Software Installation

See software_installation.md.

Q&A

License

This repository is available under the GNU General Public License v3.0

Author

hishizuka (@pi0bikecomputer at twitter, pizero bikecomputer at STRAVA)

Comments
  • AttributeError: module 'PyQt5.QtGui' has no attribute 'QTextEdit'

    AttributeError: module 'PyQt5.QtGui' has no attribute 'QTextEdit'

    Hi Hishi Great project and I am enjoying trying to get this to work. Diligently working my way through the hardware and software installs and have a timeout issue with ANT+ and some questions about using the waveform 2.4" display

    But main issue is trying to get the graphics to work in console mode, keep getting this issue

    Traceback (most recent call last): File "pizero_bikecomputer.py", line 49, in main() File "pizero_bikecomputer.py", line 39, in main gui = gui_pyqt.GUI_PyQt(config) File "/home/pi/pizero_bikecomputer/modules/gui_pyqt.py", line 108, in init self.init_window() File "/home/pi/pizero_bikecomputer/modules/gui_pyqt.py", line 187, in init_window self.debug_log_viewer_widget = DebugLogViewerWidget(self.stack_widget, "Debug Log Viewer", self.config) File "/home/pi/pizero_bikecomputer/modules/pyqt/menu/pyqt_menu_widget.py", line 37, in init self.setup_ui() File "/home/pi/pizero_bikecomputer/modules/pyqt/menu/pyqt_menu_widget.py", line 65, in setup_ui self.setup_menu() File "/home/pi/pizero_bikecomputer/modules/pyqt/menu/pyqt_debug_widget.py", line 32, in setup_menu self.editor = QtWidgets.QTextEdit() if USE_PYQT6 else QtGui.QTextEdit() AttributeError: module 'PyQt5.QtGui' has no attribute 'QTextEdit'

    Any help will be much appreciated THAnks Simon

    opened by slumsdon 7
  • real time W'bal integration as info displayed

    real time W'bal integration as info displayed

    It's more of an idea than feature request ( I'll probably never build a bike computer even given a very detailled how to like you're doing here :-) ).

    I, nevertheless, appreciate your great work.

    I'm using using Goldencheetah to keep track of my bike rides and I thought it would be great for some bike tourers to have that W' bal info ( the red curve on the screenshot below ) directly available on the screen, in ( almost, recalculated every few minutes, kilometers... ) real time to, for example not overwork themselves during sorties. I didn't real dig on the what that would involve but at first glance, it seems you're already packing all what's needed on your board.

    Again it's just an idea...and congratulation 👍 on what you did.

    W'bal red graph

    opened by serpico 4
  • Compatibility with Raspberry Pi Pico W

    Compatibility with Raspberry Pi Pico W

    Hi there,

    can you confirm the project working on a RPi Pico W MCU? If not, what is required compared to the RPi Zero SBC, that the Pico doesn't offer?

    Best & thanks in advance

    opened by MauriceArikoglu 3
  • Need some help with I2C sensor configuration

    Need some help with I2C sensor configuration

    Hi, hishi, hope you are doing well. I'd like to firstly appreciate your work, but something going wrong with my I2C sensor - BMP280. For some reason I couldn't buy the product like Adafruit and SparkFun Qwiic SHIM for Raspberry Pi (https://www.sparkfun.com/products/15794), so I use GY-BMP280-3.3 as substitution. While I connecting the VCC, GND, SCL and SDA pins with Raspberry Pi (and CSB, SDO are left vacant), bikecomputer seems not have receive the data form BMP280, and the demo mode shows:

    Loading original modules... config : 2.914984 sec GPS : True GPS_ADAFRUIT_UART : False GPS_I2C : False ANT : False RPi GPIO : True I2C : True ... detected I2c sensors: PiTFT 2.8(r) : True

    Is my connection wrong or the configuration is not completed? Looking forward to your solution, thanks again.

    opened by inlovewithsilver 3
  • Question Regarding Compatibility

    Question Regarding Compatibility

    Currently there seems to be a shortage of Raspberry Pi Zeros, as a result I was wondering if I could use a Radxa Zero to the same effect. If so, what would be different with hardware & software? If you're not sure, no worries.

    opened by Seuong 2
  • Unable to use --demo with my own .tcx file

    Unable to use --demo with my own .tcx file

    Hey hishizuka, as a complete novice I am trying to recreate your project with Pizero 2 W with a Adafruit Sharp Display.

    I am currently demoing the raspberry over XRDP and I am unable to load a .tcx file when starting pizero_bikecomputer.py

    The output is as follows: Loading original modules... config : 3.376206 sec GPS : True GPS_ADAFRUIT_UART : False GPS_I2C : False ANT : False RPi GPIO : True I2C : True running build_ext skipping '/home/pi/.pyxbld/temp.linux-armv7l-3.9/pyrex/modules/logger/cython/logger_fit.cpp' Cython extension (up-to-date) skipping 'modules.logger.cython.logger_fit' extension (up-to-date) logger_core : 1.428127 sec Loading modules... done : 4.820308 sec Raspberry Pi Zero 2 W Rev 1.0(BCM2835), serial:0xb4431714 logger_core : init... detected I2c sensors: PiTFT 2.8(r) : True GPS/ANT+/I2C/GPIO/integrate/start: ['0.017962', '0.000565', '0.246051', '0.000136', '0.000180', '0.178859'] logger_core : init... logger_core : loading course... loading /home/pi/pizero_bikecomputer/course/course.tcx logger_core : load_course : read tcx(regex): 1.098054 sec Traceback (most recent call last): File "/home/pi/pizero_bikecomputer/pizero_bikecomputer.py", line 51, in main() File "/home/pi/pizero_bikecomputer/pizero_bikecomputer.py", line 20, in main logger = modules.logger_core.LoggerCore(config) File "/home/pi/pizero_bikecomputer/modules/logger_core.py", line 119, in init self.course.load() File "/home/pi/pizero_bikecomputer/modules/logger/loader_tcx.py", line 84, in load self.read_tcx() File "/home/pi/pizero_bikecomputer/modules/logger/loader_tcx.py", line 180, in read_tcx self.point_notes = list(np.array(self.point_notes)[not_straight_cond]) IndexError: boolean index did not match indexed array along dimension 0; dimension is 429 but corresponding boolean dimension is 431 ^CException ignored in: <module 'threading' from '/usr/lib/python3.9/threading.py'> Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 1428, in _shutdown lock.acquire() KeyboardInterrupt:

    Are you able to upload a sample course.tcx to the repository?

    Thank you for your great work!

    opened by 3ZKDB 1
  • No issue, sorry just a question.

    No issue, sorry just a question.

    I really like your project! it is exactly what I am looking for, I do have a couple of questions/ suggestions. Is there a way to stream live video and the data from GPS to a mapping software. My son races and it would be cool to watch him race live through a first person camera and see his location, speed, altitude live as well.

    opened by ameggs 1
  • Contacting the developer

    Contacting the developer

    Hi,

    Congratulations on your really cool project! We are a startup that develops tools for e-bikes and we are very impressed with your work! We would like to get in touch with you to discuss some possible collaboration.

    Our contact page is https://shop.eggrider.com/contact

    PS: we wrote to you on Strava and we are unable to write you direct messages on Twitter or Github.

    opened by baneageorge 0
Genetic Algorithm, Particle Swarm Optimization, Simulated Annealing, Ant Colony Optimization Algorithm,Immune Algorithm, Artificial Fish Swarm Algorithm, Differential Evolution and TSP(Traveling salesman)

scikit-opt Swarm Intelligence in Python (Genetic Algorithm, Particle Swarm Optimization, Simulated Annealing, Ant Colony Algorithm, Immune Algorithm,A

郭飞 3.7k Jan 3, 2023
MohammadReza Sharifi 27 Dec 13, 2022
Data and Code for ACL 2021 Paper "Inter-GPS: Interpretable Geometry Problem Solving with Formal Language and Symbolic Reasoning"

Introduction Code and data for ACL 2021 Paper "Inter-GPS: Interpretable Geometry Problem Solving with Formal Language and Symbolic Reasoning". We cons

Pan Lu 81 Dec 27, 2022
Deep GPs built on top of TensorFlow/Keras and GPflow

GPflux Documentation | Tutorials | API reference | Slack What does GPflux do? GPflux is a toolbox dedicated to Deep Gaussian processes (DGP), the hier

Secondmind Labs 107 Nov 2, 2022
Many Class Activation Map methods implemented in Pytorch for CNNs and Vision Transformers. Including Grad-CAM, Grad-CAM++, Score-CAM, Ablation-CAM and XGrad-CAM

Class Activation Map methods implemented in Pytorch pip install grad-cam ⭐ Tested on many Common CNN Networks and Vision Transformers. ⭐ Includes smoo

Jacob Gildenblat 6.6k Jan 6, 2023
A neuroanatomy-based augmented reality experience powered by computer vision. Features 3D visuals of the Atlas Brain Map slices.

Brain Augmented Reality (AR) A neuroanatomy-based augmented reality experience powered by computer vision that features 3D visuals of the Atlas Brain

Yasmeen Brain 10 Oct 6, 2022
E-Ink Magic Calendar that automatically syncs to Google Calendar and runs off a battery powered Raspberry Pi Zero

MagInkCal This repo contains the code needed to drive an E-Ink Magic Calendar that uses a battery powered (PiSugar2) Raspberry Pi Zero WH to retrieve

null 2.8k Dec 28, 2022
Alex Pashevich 62 Dec 24, 2022
TorchDistiller - a collection of the open source pytorch code for knowledge distillation, especially for the perception tasks, including semantic segmentation, depth estimation, object detection and instance segmentation.

This project is a collection of the open source pytorch code for knowledge distillation, especially for the perception tasks, including semantic segmentation, depth estimation, object detection and instance segmentation.

yifan liu 147 Dec 3, 2022
Open source Python module for computer vision

About PCV PCV is a pure Python library for computer vision based on the book "Programming Computer Vision with Python" by Jan Erik Solem. More details

Jan Erik Solem 1.9k Jan 6, 2023
Open Source Differentiable Computer Vision Library for PyTorch

Kornia is a differentiable computer vision library for PyTorch. It consists of a set of routines and differentiable modules to solve generic computer

kornia 7.6k Jan 4, 2023
A simple, high level, easy-to-use open source Computer Vision library for Python.

ZoomVision : Slicing Aid Detection A simple, high level, easy-to-use open source Computer Vision library for Python. Installation Installing dependenc

Nurettin Sinanoğlu 2 Mar 4, 2022
Code and data of the Fine-Grained R2R Dataset proposed in paper Sub-Instruction Aware Vision-and-Language Navigation

Fine-Grained R2R Code and data of the Fine-Grained R2R Dataset proposed in the EMNLP2020 paper Sub-Instruction Aware Vision-and-Language Navigation. C

YicongHong 34 Nov 15, 2022
Code for the paper "Improving Vision-and-Language Navigation with Image-Text Pairs from the Web" (ECCV 2020)

Improving Vision-and-Language Navigation with Image-Text Pairs from the Web Arjun Majumdar, Ayush Shrivastava, Stefan Lee, Peter Anderson, Devi Parikh

Arjun Majumdar 44 Dec 14, 2022
Pytorch code for ICRA'21 paper: "Hierarchical Cross-Modal Agent for Robotics Vision-and-Language Navigation"

Hierarchical Cross-Modal Agent for Robotics Vision-and-Language Navigation This repository is the pytorch implementation of our paper: Hierarchical Cr

null 43 Nov 21, 2022
improvement of CLIP features over the traditional resnet features on the visual question answering, image captioning, navigation and visual entailment tasks.

CLIP-ViL In our paper "How Much Can CLIP Benefit Vision-and-Language Tasks?", we show the improvement of CLIP features over the traditional resnet fea

null 310 Dec 28, 2022
Autonomous Ground Vehicle Navigation and Control Simulation Examples in Python

Autonomous Ground Vehicle Navigation and Control Simulation Examples in Python THIS PROJECT IS CURRENTLY A WORK IN PROGRESS AND THUS THIS REPOSITORY I

Joshua Marshall 14 Dec 31, 2022
Official implementation of "Learning Forward Dynamics Model and Informed Trajectory Sampler for Safe Quadruped Navigation" (RSS 2022)

Intro Official implementation of "Learning Forward Dynamics Model and Informed Trajectory Sampler for Safe Quadruped Navigation" Robotics:Science and

Yunho Kim 21 Dec 7, 2022
The most simple and minimalistic navigation dashboard.

Navigation This project follows a goal to have simple and lightweight dashboard with different links. I use it to have my own self-hosted service dash

Yaroslav 23 Dec 23, 2022