Cycling Cadence Display With ESP32

Terry Pratchett once said “Wisdom comes from experience. Experience is often a result of lack of wisdom.” This is as true with technical skills as it is with the rest of life, and you won’t truly understand a specific topic unless you’ve struggled with it a bit. [publidave] wanted a simple wireless display for a bluetooth cycling cadence sensor, and soon found himself deep down the rabbit hole of Micropython and Bluetooth Low Energy on the ESP32.

[publidave] had converted his bicycle for indoor training during lockdown and winter, and realized he can’t use the guided training app and view his cadence simultaneously, so he needed a dedicated cadence display. Since [publidave] was comfortable with Python, he decided to give Micropython on the ESP32 ago. Bluetooth Low Energy can be rather confusing if you haven’t implemented it before, especially if good examples are hard to come by. In short, the ESP32 needs to find the sensor, connect to it, select the right service, and listen for the notifications containing the data. The data is then converted to RPM and displayed on a small OLED display. [publidave] does an excellent job of describing what exactly he did, highlighting the problems he encountered, and how he solved them.

In the end, he had a functional display, a good idea of what he would do differently next time, and a lot of additional knowledge and understanding. In our book that’s a successful project.

Since so much of the health related devices work with Bluetooth Low Energy, it could be handy to know the technology and how to interface with it. It would allow you to do things like unbrick a $2000 exercise bike,

Reverse Engineering Shimano Bike Electronics

ANT+ is a wireless protocol specifically designed for use with sensors, and has similar functionality in some respects to Bluetooth Low Energy. It’s found a place among various bicycle equipment manufacturers, to connect smartwatches, cycle computers and electronic gear shifters. Of course, as soon as something becomes a defacto standard someone has to start coloring outside the lines. In this case, Shimano went off book with their DI2 groupset, leaving [kwakeham] with a reverse engineering job on his hands.

[kwakeham] gives us a great example of how to approach reverse engineering. Researching the Shimano hardware by its FCC ID shows that the device communicates using an NRF24AP2 chip, common in ANT+ devices. The Shimano device is then opened, and a logic analyser attached to various test points until the SPI interface between the transceiver and microcontroller is found. At this point, it’s a simple matter of putting the hardware through its paces and capturing data until the protocol can be pulled apart, piece by piece.

The work is documented on Github for anyone wishing to interface with the Shimano DI2 groupset. Reverse engineering is a powerful skill, that can teach you about everything from Pokemon to botnets. Video after the break.

Continue reading “Reverse Engineering Shimano Bike Electronics”

The Apocalypse Bicycle

It seems to be a perennial among humans, the tendency among some to expect the End Times. Whether it was mediaeval Europeans who prepared for a Biblical Armageddon at the first sight of an astronomical phenomenon, 19th-century religious sects busy expecting a Noah’s flood, cold-war survivalists with bunkers under the lawn, or modern-day preppers buying survival gear, we have a weakness for thinking that Time’s Up even when history shows us repeatedly that it isn’t. Popular culture has even told us that the post-apocalyptic world will be kinda cool, with Mad Max-style rusty-looking jacked-up muscle cars and Tina Turner belting out ballads, but the truth is likely to be a lot less attractive. Getting away from danger at faster than walking pace as a starving refugee would likely be a life-or-death struggle without the industrial supply chain that keeps our 21st-century luxury cars on the road, so something more practical would be called for.

[Don Scott] has written a paper describing an extremely straightforward solution to the problem of post-apocalyptic transport, which he calls the Apocalypse Bicycle. As you might expect it’s a two-wheeler, though it’s not the kind of machine on which you’d lead a break-away from the Tour de France peloton. Instead this is a bicycle pared down to its minimum,, without advanced materials and with everything chosen for durability and reliability. Bearings would have grease nipples, for instance, the chain would be completely enclosed for better retention of lubrication, and the wheels would be designed to have strips of salvaged tyre attached to them. Interestingly, the machine would also be designed not to attract attention, with muted matte colours, and no chrome. It occurs to us that many of the durability features of this machine are also those that appear on the rental bicycles owned by bike sharing companies that have been spread liberally on the streets of many cities.

You might wonder what use the idea might have, and why a prepper might consider one alongside their tins of survival rations. But it’s also worth considering that these machines have a real application in the here-and-now, rather than just an imagined one in an apocalyptic future. Many Hackaday readers are fortunate enough to live in countries unaffected by wars or natural disasters, but there are plenty of places today where an aid agency dropping in a load of these machines could save lives.

Apocalyptic cycling has featured little here. But we have brought you at least one bike made from wood.

Take A Bicycle Tour Anywhere In The World

Imagine yourself riding through the countryside of Tuscany in the morning, then popping over to Champagne for a tour in the evening without taking a plane ride in the intermission. In fact, you don’t have to leave your living room. All you need is a stationary bicycle, a VR headset, and CycleVR.

[Aaron Puzey] hasn’t quite made the inter-country leap quite like that, but he has cycled the entire length of the UK, from its southern point to its northernmost tip. The 1500km journey took 85 hours over the course of eight months to complete.

CycleVR is actually a VR app created using Unity. It takes advantage of Google street view’s panoramic image data, using Bluetooth to monitor the cycling pace  and transition between the panorama capture points. So, the static images of pedestrians and cars clipping and distorting as the panorama images load might throw off the illusion at first, but there’s thousands of side streets and country roads out there where this won’t be as pronounced. Check out the highlight reel from [Puzey]’s journey after the break.

Continue reading “Take A Bicycle Tour Anywhere In The World”

Cyclists Use Tiny Motors To Cheat

Blood doping is so last decade! The modern cyclist has a motor and power supply hidden inside the bike’s frame.

We were first tipped off to the subject in this article in the New York Times. A Belgian cyclocross rider, Femke Van den Driessche, was caught with a motor hidden in her bike.

While we don’t condone sports cheating, we think that hiding a motor inside a standard bike is pretty cool. But it’s even more fun to think of how to catch the cheats. The Italian and French press have fixated on the idea of using thermal cameras to detect the heat. (Skip to 7:50 in the franceTVsport clip.) We suspect it’s because their reporters recently bought Flir cameras and are trying to justify the expense.

The UCI, cycling’s regulatory body, doesn’t like thermal. They instead use magnetic pulses and listen for the characteristic ringing of a motor coil inside the frame. Other possibilities include X-ray and ultrasonic testing. What do you think? How would you detect a motor inside a bike frame or gearset?

Grinding A Bicycle Crank For Power Analysis

For [Mark] and [Brian]’s final project for [Bruce Land]’s ECE class at Cornell, they decided to replicate a commercial product. It’s a dashboard for a bicycle that displays distance, cadence, speed, and the power being generated by the cyclist. Computing distance, cadence and speed is pretty easy, but calculating power is another matter entirely.

The guys are using an ATMega1284 to drive an LCD, listen in on some Hall Effect sensors, and do a few calculations. That takes care of measuring everything except power. A quick search of relevant intellectual property gave then the idea of measuring torque at the pedal crank. For that, [Mark] and [Brian] are using a strain gauge on a pedal crank, carefully modified to be stiff enough to work, but flexible enough to measure.

A custom board was constructed for the pedal crank that measures a strain gauge and sends the measurements through a wireless connection to the rest of the bicycle dashboard. It works, and the measurements in the classroom show [Brian] is generating about 450 W when pedaling at 33 mph.

Video below.

Continue reading “Grinding A Bicycle Crank For Power Analysis”

Build And Install Your Own High-end Cycling Power Meter

Cycling power meters can set you back quite a pretty penny. [Keith] quotes prices starting at $1500 and going up to $4000. We know several serious cyclists who would think twice about spending that on a bike, and wouldn’t even consider putting that kind of investment into an accessory for it. But if you’ve got the time [Keith] will show you how to build and install your own cycling power meter.

The link above is a roundup of all the posts and videos [Keith] made along the way. We’ve embedded his introduction video after the break where he discusses the goals of the project. The system allows for independently measuring the power of each leg. This is accomplished using strain gauges on the cranks to monitor torque. This data is combined with cadence measurements (how fast the rider is turning the cranks) which is all that is necessary to calculate the power output of the rider.

The parts list comes in at about $350. This doesn’t include the equipment he used to test and calibrate his calculations.

Continue reading “Build And Install Your Own High-end Cycling Power Meter”