{"id":16021969,"url":"https://github.com/tfry-git/ergometrino","last_synced_at":"2025-04-10T03:00:24.276Z","repository":{"id":215634467,"uuid":"121680911","full_name":"tfry-git/ergometrino","owner":"tfry-git","description":"Simple Arduino-based ergometer display with differential feedback","archived":false,"fork":false,"pushed_at":"2018-02-21T11:47:07.000Z","size":243,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T04:24:12.942Z","etag":null,"topics":["arduino","ergometer"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tfry-git.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-02-15T20:47:00.000Z","updated_at":"2022-12-02T00:50:04.000Z","dependencies_parsed_at":"2024-01-05T16:02:08.933Z","dependency_job_id":null,"html_url":"https://github.com/tfry-git/ergometrino","commit_stats":null,"previous_names":["tfry-git/ergometrino"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfry-git%2Fergometrino","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfry-git%2Fergometrino/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfry-git%2Fergometrino/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfry-git%2Fergometrino/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tfry-git","download_url":"https://codeload.github.com/tfry-git/ergometrino/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248148217,"owners_count":21055547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","ergometer"],"created_at":"2024-10-08T18:06:35.674Z","updated_at":"2025-04-10T03:00:24.231Z","avatar_url":"https://github.com/tfry-git.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ergometrino\nSimple Arduino-based ergometer display with differential feedback\n\n![Project photo](doc/project_photo.jpg)\n\n# Problem statement\nCardio-workout is boring, particularly when practicing indoors. Several existing projects try to alleviate this by doing cool stuff such as\ncoupling the ergometer to a game console, or even simulating a real bicycle ride in VR. Cool as these are, technically, they don't really help much:\nWorkout is still boring. So, instead, I'd like to be able to just read a book or watch TV while training. But then it's difficult to keep up a\nsteady pace.\n\nThe idea, here, is to focus on the latter problem, and provide straight-forward feedback, on whether your current level of training is good enough,\nor you should try to speed up. However, the \"good enough\" level will vary not only per person, but also over time (long, term, as you get better,\nbut also within a training session, as for instance, it's near impossible to go at full speed before you've warmed up). Therefore, the idea is simply\nto record a) the previous run and b) the best run (aka highscore), and then provide feedback on how you are currently faring compared to those runs.\n\n# Hardware\nThe hardware requirements are deliberately minimal.\n\nFor a quick overview, refer to the breadboard view shown below (the red wires symbolize the connection to the ergomenter), but read on for details.\n![Frizzing breadboard view](doc/breadboard.png). More [hands-on instructions are also available](https://www.instructables.com/id/Simple-Arduino-based-Ergometer-Display-With-Differ/).\n\n## Microprocessor\nAs the basis, you'll need at least an ATMEGA328 based arduino (or something better), but it does not matter whether it's a Uno, Nano, whatever. Personally\nI picked an Arduino Pro Mini at 3.3V 8MHz. Pretty much anything supported by the arduino enviroment should work, however (including STM), as long as your\ndisplay has a driver.\n\n## Ergometer connection\nYour ergometer will probably have some sort of reed switch or Hall switch sensor for sensing revolutions of the fly wheel or the pedals. Chances are you\ncan plug right into that. Connect between Gnd and Pin D2 (by default) of your Arduino. If you cannot find an existing interface, just attach a magnet to the pedals, and a\nreed switch at a point where the magnet will pass.\n\n_Note_ that in the case of a mechanical switch, you _may_ run into issues with jumping readings due to contact bouncing. While the sketch uses a simple timeout for software\ndebouncing, it may be helpful to place a 100nF (or so) capacitor between D2 and Gnd for simple hardware debouncing. (No separate resitor needed, capacitor will charge via the\ninternal pullup resistor.)\n\nThe top of the sketch has some defines that you can tweak to convert this into a credible km/h or mph reading, importantly \"CM_PER_CLICK\".\n\n## Display\nThis sketch assumes an SSD1306 based 128*64 monochrome display. These are one of the cheapest and easiest display options available, today. Just connect to VCC and Gnd,\nSCL, and SCA (Arduino: A4, and A5), and voilá, you're done. However, any other display with similar dimensions and an Adafruit_GFX-compatible driver will work just as\nwell. You may have to tweak some details, if your display geometry is smaller, but that should not be much of a problem.\n\n## Optional quick reference LEDs\n_Optionally_, you can connect LEDs (with appropriate resistors) to D6 and D5, for indication of \"you're doing well, you're near or above your best level\", and \"you're doing\npoorly, you're significantly below your best level\", respectively. Note: These LEDs indicate the relation between your current speed, and the best recorded speed\n_in the current phase of the training_, by default, i.e. the reference speed is _changing_ according to your recorded best training. The idea behind these LEDs is to provide\na rough feedback mechanism that will be noticeable in peripheral vision, i.e. even while you're looking at something else.\n\nA push button connected to Pin D4 can be used to switch the reference used for the above two LEDs between \"best level on this segment\" (default), \"previous level on this segment\"\n\"current speed\". The latter is very useful for your initial run, or whenever neither the \"best level\", nor the \"previous level\" provide a good reference to your current\ntraining. Modes other than \"best level\" are indicated by either a small letter \"P\" or \"C\" in the lower left corner of the speed graph.\n\n_Note_: In contrast to the \"best run\" and \"previous run\" settings, the \"current\" speed reference will not update, automatically. To update it, manually, press the button thrice\nto switch away from, and back to \"current speed\" setting, while maintaining the desired speed.\n\n## Optional jumpers\nConnect the following pins to Gnd to achieve specific non-standard behavior:\n- D9: Reset/erase best run recording\n- D8: Do not update previous run recording\n- D7: Do not update best run recording\n\n## Power supply and consumption\nWhen using a 3.3V Arduino, you can connect a LiPo battery (or three NiMH cells) directly to Vcc and Gnd (this is ok because the ATMEGA will tolerate up to 5.5V; _not_ ok for use\nwith genuinely 3.3V processors such as STM32!). For this use case, there will also be a \"low battery\" warning at around 3.4V, without any additional hardware. As the ATMEGA can be\nexpected to work correctly, at least down to 3.0V or so, that should leave you enough time to finish your training unit before recharging.\n\nAnother good supply option is a USB power bank, with a built-in battery indicator. Of course powering with a 9V battery via Vin, and many other power options will work, too, but\nyou won't get battery level indication, then.\n\nWith an SSD1306 display and an Arduino Pro Mini 3.3V, the circuit consumes on the order of 12mA @3.6V _without_ the external LEDs. For an Arduino Nano / Uno, expect consumption to\nbe 10mA to 20mA higher. Of course external LEDs may also draw substantial current when lit, depending on type of LED and resistor value.\n\n## Storage\nTo keep things simple, all data is stored in the internal EEPROM. No need to connect any external storage. (However, for this reason, there is also no room to store much\nmore elaborate data).\n\nThe EEPROM is initialized on first usage. After that, at most four bytes of data are updated every time a segment (500m, by default) is completed. Thus, write cycle limitation should not be a concern.\n\n# Feature details\n\n## Numeric displays\n- Left hand: Current speed (large) - Average speed - Graph of the speed over the past minute\n- Right hand: Distance (large) - Time - Time difference to previous run - Time difference to best run - Low battery warning\n\n## Speed graph\nTo help maintain a stable speed, the lower left graph plots your speed over the past minute (roughly). This is centered at the current speed, with a range of +/- 7 units.\nDotted lines indicate the average speed _during the current segement_ of the previous, and best runs.\n\n## Quick status LEDs\nSee above.\n\n## Future extensions\nWith a bit of tweaking, the display could hold more values such as heart rate, cadence, etc. Also, we could easily keep track of total training time and distance.\nFinally, if adding separate SD card storage, you could get a much better resolution of the recorded trainings, and also store separate training profiles (e.g. for\nseveral persons in the same household).\n\nI'll be happy to accept contributions, but I'm unlikely to implement any of that, myself (unless paid to).\n\n# Status\nIntial version basically functional.\n\n# License\n[GPL Version 3 or later](https://www.gnu.org/licenses/gpl-3.0.en.html).\n\n# Begging\nAs usual, developing even \"simple\" things always takes more time than anticipated. Writing up documentation for sharing with others is another significant time sink.\nIf you like the project, consider donating via PayPal to thomas.friedrichsmeier@gmx.de . Thanks!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftfry-git%2Fergometrino","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftfry-git%2Fergometrino","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftfry-git%2Fergometrino/lists"}