Automatic Arduino Bicycle Shifter

One of the keys to efficient cycling performance is a consistent pedalling cadence. To achieve this the cyclist must always be in the correct gear, which can be tricky when your legs are burning and you’re sucking air. To aid in this task, [Jan Oelbrandt] created Shift4Me, an open-source Arduino powered electronic shifter.

The system consists of a hall effect sensor at the pedals to measure cadence, an Arduino controller, and a servo mechanism to replace the manual shifter. Everything is mounted in a small enclosure on the frame. The only way to get one is to build your own, so a forum is available for Shift4Me builders, where the BOM, instructions, code and other documentation is available for download. Most bikes should be easy to convert, and [Jan] invites builders to post their modifications and improvements.

Since the only input is the cadence sensor, we wonder if the system will interfere more than help when the rider has to break cadence. It does however include allowance to hold on the current gear, or reset to a starting gear by pushing a button. One major downside is that you will be stuck in a single gear if the battery dies since the manual shifter is completely removed.

As one of the oldest continuously used forms of mechanical transport, there is no shortage of bicycle-related hacks. Some of the more recent ones we’ve seen on Hackaday include e-bike with a washing machine motor, and a beautifully engineered steam-powered bicycle.

16 thoughts on “Automatic Arduino Bicycle Shifter

  1. In my experience, most bycicles don’t shift well under power, so you usually want to momentarily take the tension off the chain by pedaling with little force while the derailer does its job and the chain wraps onto the next cog.

    Shifting under power takes longer, causing chain skipping and wears components more quickly. Having this happen unexpectedly is VERY jarring. I rode a bike with worn parts and badly adjusted derailer and when it unexpectedly jumped gears (note: not falling off either side of the cassette, just moving from gear 3 to gear 4), it could knock your feet right off the pedals, I had the pedal bite to prove it.

    Without some way of controlling the shifter (defeating much of the purpose) or having it warn you it’s about to shift (maybe a beep?), I think I’d prefer to shift manually.

    I’m curious if he plans to add an auto-shifter to the front derailer as the photo in the article only seems to control the rear.

    1. ISTR decades ago about automatic shifter for bicycles (mechanical).
      IIRC, it worked by theamount of tension on the chain e.g. if the rider was having to pedal hard, it shifted to a lower gear, and would “shift up” if thechain tension decreased.

      Oops! I accidentally pushed on Report Comment!

    2. It’s probably more for speeding up/slowing down on the flat road as opposed to gearing down for climbing.

      I never had a reliable derailleur. A successful shift is always a bit of a miracle.

    3. Yes, unexpected shifting can be a real problem. Imagine standing and hammering at it causing a shift. Could lead to a crash. Derailleurs are a pretty amazing bit of engineering but don’t work well under tension. I would prefer just an indicator that I needed to shift down or up – I think most bike computers do that.. Not as sexy though.

    4. Issues with shifting under power have been non-existent for close to two decades or longer, at least on components made by Shimano, Campagnolo, and SRAM that aren’t their bottom-tier. Everything on a modern road bike’s driverain is optimized for shifting as smoothly and quickly as possible, because a)it’s convenient for recreational cyclists and b)it’s vital for competitive cyclists. I can sprint at 750W+ an upshift one or more cogs perfectly smoothly.

      The shape of the chain links, the chainring teeth…the counts of the cogs on the rear cassette, the offset of each cassette’s teeth compared to the others…it’s all designed to handle shifting under power in both directions.

      If you have a wally-world bike that cost $200, yeah, it’s not going to shift under power worth a damn.

      Then again, the author of this article *also* has no idea what they’re talking about: “One of the keys to efficient cycling performance is a consistent pedalling cadence.”

      Yeaaaaaah that’s not even remotely true.

      Why is it that people who know nothing about bicycles just love to pontificate about bicycles?

      1. It may be better on very expensive bikes recently, but I have 2 mid-range (~$1000) bikes (1 mountain, one street) newer than 20 years old that have both had their cassettes and chains replaced fairly recently and it is *definitely* easier to shift when weight is taken off the pedals.

      2. They’ll shift perfectly smoothly if you ease up on the pedals for a brief fraction of a second, and they’ll generally shift successfully with some nasty clunk sounds under load, but I wouldn’t say shifting under heavy load is “smooth” on any bike that I’ve seen, and if things are worn or out of adjustment, shifting under load is when you’re likely to derail or skip your chain.

        And what about a “consistent pedalling cadence” isn’t true.

        Sure, it’s not something that should be your primary focus, but the whole reason we have gears is to keep the cadence within a reasonable range, and generally most riders will have a cadence that they’re most efficient at for any given load. IME I like a higher cadence when I’m going for a slightly higher average power, but I still like my gearing to keep me fairly close to my chosen rpm in the conditions.

        I don’t think that an automatic shifter is going to work well for any but the most casual riding, for those exact reasons.
        I can accelerate smoothly under heavy load, shifting smoothly and silently through the cassette as I go, because I’ve learned to instinctively soft pedal just long enough to shift into the gear (Which takes very little time on modern stuff that’s reasonably well set up). Often I’ll hear other people behind me clanging through the gears, but IMO that’s doing it wrong, even if you usually get away with it.

        I would definitely not want my shifter banging through the gears under load, though I was working on a manual electronic equivalent to this myself a while ago, mainly because I ride a lot of city riding where I’m downshifting to stop at lights, and braking while downshifting with an STI shifter is awful, and Campag isn’t much better (The downshift isn’t on the main brake lever, but you’re still going to pinch your fingers trying to brake and shift at the same time)
        Also, it would take care of cable pull ratios, so I could mix equipment without worrying about it.

  2. This would make a lot of sense with internal gear hubs. So much sense indeed, that shimano already did it in their steps e6100 ebike system. I test rode a bike once, liked it a lot. But unless you have an ebike anyway, i dont want any unnecessary batteries on my bike. In the end, good ol’ mechanical shifting is good enough for me, and that even with entry level components (shimano claris for example)

    1. Manufacturers don’t give a damn about that. They care about making stuff cheaper to manufacture. A “brifter” is a hugely complex mechanical assembly and with the trend toward hydraulic brakes for road/cross/”adventure” bikes, manufacturers need room in the brifter housing for the hydraulic cylinder and reservoir.

      Also, the systems are able to adjust themselves on the fly, and even to optimize for the position of the other derailleur – or do things like purposefully “overshoot” the ideal position for a gear to make it shift faster and more reliably, but then jump back to the ideal position.

      It also gives them an awesome opportunity to force people to have to take their bike to an official dealer with the proper computer interface tool, and to force bike shops to buy the tool (and eventually, I’m guessing, pay a monthly fee for “subscription” access to things like firmware, diagnostics, etc.) One of the nice things about the bike industry has been that there was a trend toward standardization and several companies make tools for everything, not just one company.

      Bosch is pulling the same nonsense with their mid-drive e-bikes. They require proprietary interfaces and programs to “talk” to the drive unit, the batteries brick themselves if the BMS is disconnected (to prevent people from trying to rebuild them), and Bosch changes the shape of the mounting area on the frame almost every year, and different tier systems can’t be put on other tier bikes. If you buy an economy e-bike you can’t later put a high-end performance Bosch mid-drive on it.

  3. “Shift4Me is an open-source project. That means it is completely free. The download section contains all the files (schematic, Arduino scripts, 3D-printfiles…) that you need to start building your Shift4Me.

    BUT: only registered users of this Forum can have access. The Download section is hidden if you’re not registered.
    So just hit the Register link op the top of this page, sign up, and you’ll have access. ”

    This person does not understand the meaning of “open source.”

  4. I think this needs some kind of torque sensor or chain tension sensor. Otherwise it will not be able to properly downshift when you approach steep uphill suddenly. You need to shift only when there is no tension on the chain, otherwise your chain will slip or damage itself. I have troubles properly downshifting manualy myself when i don’t plan the downshifting ahead enough… Anyway this is cool project. BTW have you seen bicycle CVTs or maybe planetary gearboxes? I think these are better suited for this stuff. CVTs (like nu-vinci) can be shifted under load. And planetary hubs (like shimano alfine) will not shift under load, but will (kinda) postpone the shift until there is no load. it’s not 100% healthy, but they can get more abuse than chain.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.