DIY Electronic Derailleur

 by nabilt
Contest WinnerFeatured
If you just want to get building move on to step 1.

Background
This instructable is part of a larger project to build the ultimate bicycle computer, which you can read about on my blog. It will show you how to build an electronic rear derailleur for Shimano parts. I've tested it on the RD-4500 Shimano Tiagra, but this method should work with similar derailleurs. Rather than pulling the shift levers, you press a button to get to another gear.

Motivation
1. Once both derailleurs are electronic you get automatic trimming, which means no more chain rub!
2. Easier/smoother shifts. OK so it's not super hard to change gears with mechanical levers, but going electronic means you get an accurate shift every time.
3. Cheaper than the commercial alternatives. Like thousands of dollars cheaper...
4. When your gear changes are combined with other metrics like your heart rate, gps, speed and incline you can improve your ride by finding your weakness. Were you on the correct gear on that incline?
5. It's a conversation starter.
6. Adding electronics to anything is always cool!

Skills Required
- Basic soldering and electronic skills. See Sparkfun's Soldering 101
- Very basic Arduino knowledge like how to upload a program. See Sparkfun's beginning embedded electronics
- Basic bike mechanic skills like a removing derailleur, if you do your own bike maintenance you be should OK

Progress
So far we've got the rear derailleur shifting and plan to do the front so look for future instructables for updates and new features. At the time of writing the software does not turn off the servo to conserve battery power because there is a chance of gear slippage. This means you will have limited ride time. A fix for this coming soon so follow my instructables account.

Open Source
Up to date Arduino sketch, schematics, Fritzing diagram, bill of materials and CAD diagrams can be found on the project page http://nabilt.github.com/diy_eshift/.

Future plans
- EEPROM wear levelling
- Waterproofing and better a enclosure
- Better cable management
- Machined servo bracket
 
Remove these adsRemove these ads by Signing Up

Step 1: Tools

tools.JPG
Dremel
Hammer
Philips Screwdriver
Pliers
2 Clamps
Wire cutter
Scissors
Large Metal File
Small Metal File
Saw
Electric Drill
Alan keys
Googles
Drill
Metal drill bits
Third Arm
Clear hocket tape
Gloves
Clear hockey tape - Best tape ever
1-40 of 44Next »
lcsc says: May 16, 2013. 5:04 PM
Such a great hack! Congratulations! I'll do this in my commuter bike! Thinking in house this inner seat tube and with 18650 cells in pararael custom mount. Congratulations!
softenersreviews says: Mar 2, 2013. 3:56 AM
thank you ,
for the help,to make this very interesting project.
The Dark Lord says: Jan 29, 2013. 5:47 PM
Thank you for this!!!
It's exactly what I was looking for.
BillBiker says: Oct 31, 2012. 7:09 PM
Will say this is really incredible! Yes I know this is WAY too far in advanced but how about programming it around a smart phone app(s) that would take out alot of the problems with your GPS, Terrain inclination, heart rate, and other factors!?!?! Just a thought to help you out :) . By all means I know this right now is in it infancy.
mr fat says: Sep 13, 2012. 6:25 PM
Awesome idea and I look forward to reading your Blog!
gnikolovienis says: Aug 1, 2012. 6:41 AM
great project!!!!
do you have in mind for the front derallier?
i would like to see a video with this working.
can you fine tune without pc just in case it happens somethin on your ride?
great!!!!if you add the front derallier i will built it the same time!!
charlie_r says: Jun 12, 2012. 5:06 AM
Love the work you've done on this!

Here's an idea for when you get the front der added to the mix:

Since you are using an arduino, how hard would it be to program in a gear sequence so when you hit the upshift or downshift buttons it progresses to the next gear in a logical sequence, moving either or both the front and rear ders?

Also, since my ride is a home built trike with a mid-drive, I have 1 front on a triple, a 6 cog mid, and a 7 cog final. Could this be programmed to account for all three?

I would definitely be interested in building something like this!

Thanks for the 'ible!
brgt40 in reply to charlie_rJul 14, 2012. 8:07 PM
Very cool project!!

Shifting in sequence is very doable but I question its usefulness on the road at least for the way most bikes are geared and the way I ride.

First, although, mathematically, there may be 21 gears, there are usually duplicates. You would not want to waste time shifting to a gear that is marginally different. Ok, you need to (and can in fact) program the arduino to bypass one or the other.

Secondly, when I shift I usually change only one derailleur. To clarify, say I have a triple chain ring. On the ride, I find a sweet spot using the middle ring. UpHill coming - I switch to the smaller front or a larger rear but not both on one shift. Don't need to - one or the other improves my situation and usually close enough. If not close enough, I tweak (probably with the derailleur I did not change initially). Chances are my changes are not sequential at all.

So maybe a programmed set of "my favs" gears would be more useful whether accessed sequentially or directly.

If we really were to put in the bells and whistles, Version 17.1 would chose the gear for you based on your cadence, heart rate, the incline, your power output and your fitness level and length of ride. It also stores your ride history and uses predictive logic to determine the gear and when it will shift.

But I am happy with the promise you've shown so far! Good job. Very inventive.
nabilt (author) in reply to charlie_rJun 12, 2012. 7:24 AM
> how hard would it be to program in a gear sequence so when you hit the upshift or downshift buttons it progresses to the next gear in a logical sequence, moving either or both the front and rear ders?
Not difficult at all. A few people have requested this so I'll add it to the feature list. The only difficulty is making installation easy with all of these new configurations.

> Could this be programmed to account for all three?
Definitely. The next version has an LCD so each user could choose their configuration on the screen.
charlie_r in reply to nabiltJun 12, 2012. 2:56 PM
Fantastic!

Thanks!
tiros76 says: Jun 10, 2012. 6:41 PM
Nice Instructable!

I can tell you the front derailleur is much easier to control with a servo than the rear. I have been working on a similar project for some time http://www.diyshift.com . Have you had any problems with derailleur ghost- shifting over large bumps? That  was one nut that I was having difficulty cracking without leaving the servo powered up and eating batteries.

I look forward to seeing your updates and test results.
moraant in reply to tiros76Jun 12, 2012. 4:18 AM
maybe the inclusion of a wormgear would hold the derailleur in position when the electronics are sent to sleep between shifts? Perhaps something along the lines of this would optimise battery power conservation http://interface.khm.de/index.php/lab/experiments/sleep_watchdog_battery/

I think this is great and should provide endless funin the dark winter nights when riding is impossible...

well done to all!
nabilt (author) in reply to tiros76Jun 10, 2012. 7:28 PM
Thanks for the kind comment. Good to hear the front derailleur will be easier to modify. I've seen your project a while ago and looks like you've made a lot of progress lately. I'm really impressed how professional it looks especially for someone who started tinkering with electronics in 2011!

> Have you had any problems with derailleur ghost- shifting over large bumps?
I have. I'm thinking of adding some tension or a normally closed brake to hold the derailleur in place to fix this.

Maybe we should chat and see if we can help each other out. Email me at nabil dot tewolde gmail.com.

chris.brent says: Jun 7, 2012. 4:35 PM
The Shimmano system makes sure it moves the derailleur when the chain lines up with the shift ramps on the cogs. This means you can stand up and pedal as hard as you want while shifting and the shift is still smooth. I have no idea on how they manage this. It doesn't look like they have an optical sensor on their. Anyway, just an idea if you're looking for upgrades. Great work! I've been wanting to try something like this myself.
nabilt (author) in reply to chris.brentJun 10, 2012. 8:18 PM
Thanks :)
Grinhill says: Jun 8, 2012. 11:27 PM
Great work!!!
Referring to the schematic, could you please explain futher the use of the transistor to switch the servo power? I've only seen this done with the base being used to control the load. Thanks.
nabilt (author) in reply to GrinhillJun 10, 2012. 8:17 PM
This is a mistake in the diagram. The transistor I'm using has a different pinout than the one in the Fritzing. I wired it so the breadboard view was correct, but this meant the schematic was incorrect. Thanks for the heads up. I'll get on that.
arick says: Jun 9, 2012. 6:19 PM
How can I hold position on the servo,
for example I want to shift into Gear 5 and hold that ?
nabilt (author) in reply to arickJun 10, 2012. 8:10 PM
In the current implementation the servo is always on so that should hold whatever gear you're on. In the future I plan on designing a mechanical fix.
gtoal says: Jun 8, 2012. 12:30 PM
Put a force sensor on the pedal and program it to change gears automatically ;-)
espdp2 says: Jun 8, 2012. 9:13 AM
VERY cool, enough that I may spend some of my limited free time to try this. Went a little crazy with the text boxes... :-)
nabilt (author) in reply to espdp2Jun 8, 2012. 10:11 AM
Hahahah, yeah I totally did.
JohnBPrice says: Jun 6, 2012. 12:10 PM
Instead of fixed step sizes, I would think an array of ideal positions would be better, since the best rear derailleur position changes depending upon the front derailleur. When in manual mode, it could tweak the current position for the gear combination.
Circle of Owls in reply to JohnBPriceJun 8, 2012. 6:07 AM
You could also install a temporary set of +/- buttons on a removable tether near the gear shift buttons so that the derailleur positions for each gear could be adjusted on the fly, while riding. Once the positions are ideal for each gear the tether could be removed.
nabilt (author) in reply to JohnBPriceJun 6, 2012. 1:05 PM
This is a great idea. Once I get the front derailleur working I'll add this feature.
laxap says: Jun 7, 2012. 11:11 AM
That's a cool idea!

For an anti-theft system:
  • install a teeth-less gear,
  • at shutdown, servo will select that one,
  • implement a secret sequence of presses to unlock, or a keypad.
nabilt (author) in reply to laxapJun 7, 2012. 12:09 PM
Great idea! I was also thinking to have the computer removable so nobody steal. This could also act as another form of anti-theft.
davmaldo says: Jun 7, 2012. 8:49 AM
So my thoughts are, first, this is already really fancy, but if you wanted to get EXTREMELY fancy, you could input your specific sprocket sizes into the program, then add a gyroscope, and some way to measure speed onto the system. Then, (idk if the arduino can get this fancy) you could program the computer to automatically shift depending on the incline of the road and your current speed, using its knowledge of the sprocket sizes to find the ideal gear ratio. With some trial and error, the system could ensure you are at an optimal gear ratio and there for optimal (maximum) speed at all times.
jeffeb3 in reply to davmaldoJun 7, 2012. 11:41 AM
If you did this with a IOIO board and an android phone, you could use the android's accelerometers or GPS + topo map to get decent results, I think. That would be a fun project. Maybe I'll try this next summer.
davmaldo in reply to davmaldoJun 7, 2012. 8:52 AM
Maybe add an accelerometer so it does not shift while the chain is on heavy load?
nabilt (author) in reply to davmaldoJun 7, 2012. 10:38 AM
These are great ideas, which I'm in the process of testing. I'm not sure I would like my gears to change for me, but this seems to be a feature lots of people want. Thanks for your input.
yaly says: Jun 7, 2012. 2:46 AM
I was previously thinking of doing that but have an lcd dashboard and stepper motors all controlled by an arduino uno and an atmega 32 or pic16f877a. There was no gps idea but I won't include it as it is expensive in our country. can it be made with steppers? and if so can you upload another code for the stepper one?
I try to get a new derailleur and use the old one for this project. and what servo size are you using?
yaly in reply to yalyJun 7, 2012. 2:48 AM
PS: I only have a rear derailleur ok.
nabilt (author) in reply to yalyJun 7, 2012. 10:36 AM
> can it be made with steppers?
Maybe, but I wouldn't recommend it. They tend to have less torque compared to an equivalent size servo. They are generally used when you need high accuracy.

> and what servo size are you using?
I am using the medium size HiTEC HS-225MG Servo.
moraant says: Jun 7, 2012. 9:32 AM
Great instructable. I am thinking of something similar myself. I think the front derailleur will be a harder nut to crack because of the forces on the chain esp when going up hill or when out of saddle.

I also thought of using a worm gear from a guitar machine head and then send the arduino to sleep to save battery consumption.

Anyway keep up the good work.
lesizz says: Jun 7, 2012. 9:30 AM
When you do the front derailer, if you make it workable with a 3-ring derailer then you will be ahead of Shimano and Campagnolo, since thier electronic shifters work ONLY with 2-ring front derailers.

Super cool project!
cjoliveira says: Jun 7, 2012. 9:07 AM
Awesome! You could add a dynamo and charge controller so you can ride an unlimited time.
http://www.google.com/products/catalog?hl=en&q=bike+dynamo&um=1&ie=UTF-8&tbm=shop&cid=3052823855019776153&sa=X&ei=btHQT6LqA4f69QTKj6G_AQ&ved=0CKkBEPMCMAc

Good work.
iglitchhalo2 says: Jun 7, 2012. 6:30 AM
Di2 envy?
Adambowker98 says: Jun 6, 2012. 8:55 PM
Finally a way to fix my bike! My derailleur has been messed up for quite some time now because it has not been shifting properly. Thanks for posting!
sofiadragon1979 says: Jun 5, 2012. 6:51 PM
Do you think that this will work w/ a velomobile?

I am just getting into the Arduino myself (still haven't gotten it in the mail, I ordered it last week lol) & I can't wait to get into the work w/ it & start programing & posting projects for people to use.

All things considered this is a wonderful project & I can't wait to try it out myself.
1-40 of 44Next »
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!