Arduino Gear Shift Indicator Finds ‘Em So You Won’t Grind ‘Em

Now, it’s been a shamefully long time since we’ve driven a car with a manual transmission, but as we recall it was pretty straightforward. It certainly didn’t require a lot of help with the shifting pattern, at least not enough to require a technical solution to know what gear you’re in. But then again, we suspect that’s not really the point of [upir]’s latest build.

Oh sure, it’s pretty cool to display your current gear selection on a little LCD screen using an Arduino. And [upir] promises a follow-up project where the display goes inside the shifter knob, which will be really cool. But if you take a look at the video below, you’ll see that the real value of this project is the stepwise approach he takes to create this project. [upir] spends most of the time in the video below simulating the hardware and the code of the project in Wokwi, which lets him make changes and tune the design up before committing anything to actual hardware.

That turned out to be particularly useful with this build since he chose to use analog Hall sensors to detect the shift lever position and didn’t know exactly how that would work. Wokwi let him quickly build a virtual prototype for one sensor (using a potentiometer as a stand-in, since the simulator lacked a Hall sensor model), then quickly expand to the four sensors needed to detect all six gear positions.

By the time his simulation was complete, the code was almost entirely written. [upir] also walks us through his toolchains for both designing the graphics and laying out the PCB, a non-trivial task given the odd layout. We particularly enjoyed the tip on making smooth curved traces around the oval cutout for the shift lever in the board.

The video below is on the longish side, but it’s chock full of great little tips. Check out some more of [upir]’s work, like his pimped-out potentiometer or his custom animations on 16×2 LCDs.

75 thoughts on “Arduino Gear Shift Indicator Finds ‘Em So You Won’t Grind ‘Em

  1. >a follow-up project where the display goes inside the shifter knob

    That strikes me as being pretty dumb, when a lot of learning to drive is about learning to use your hands without looking down. What’s next, an indicator on the pedals to tell you which one you’ve pressed?

    1. Yeah you are not supposed to look at the gear stick when driving, you should know where it is and where the gears are and it really isn’t difficult. The diagram on top of the gear stick is to let people know when they first drive the car.

      Also modern cars sometimes display the current gear on the dashboard.

      I wouldn’t want to go messing around with something important like the gear stick anyway.

      1. The main use for the diagram in my opinion is telling you where reverse is.

        But other than that, a display on top of the shifter is pointless for me, because I put my hand over the top of the shifter, and I don’t have eyes in my palms.

      2. The diagram was originally used to show the gear shift pattern or gate. In my 50 years of driving experience I have seen a number of different patterns. If you were to move from car to car one of the 1st things yoou need to check and memorize is the shift pattern. When overdrives began to be added to tranmissions the manufacturers were sticking 5th gear in all kinds of places on the pattern.

    1. You can’t, ODB is just for emission related stuff, Probably possible to get that value from the Transmission control unit but then you have an Auto gearbox (Torque converter or Automated Manual which is most likely already displaying the gear you’re in) and on top of that you’re then dealing with proprietary software.

      1. Or get wheel speed and tach and do math based on the known gear ratios. My 2019 VW does it that way. It obviously isn’t perfect since it sort of ignores what’s happening when the clutch is in.

        1. This. If your car supports RPM PID and speed then you can get gear based on gear ratio from the Cars manual or by empirical data.
          Lot less invasive then the solution in the video above.

      2. I’m pretty sure this is not correct, Ive don’t replay attack stuff for locking and unlocking my doors through the obd port before and that has nothing to do emissions. Now whether or not you can get the gear position I don’t know.

        1. I’m guessing utilizing Bluetooth adapter right? otherwise how would you connect to odb while outside of the car.. I thought about trying to mess around with this with my car but wasn’t sure if it was the route to go rather than attacking rolling code methods which I’d have to invest in additional hardware

      3. Having worked in the automotive industry for some time, I can say that most vehicles have the Gear position present on OBDII if you know what to ask the vehicle for, even with a manual Transmission. It is typically proprietary to the vehicle though, and not readily available to a generic low end Scan tool via a standard PID. Some ECM’s use this information to help optimize engine management and control throttle response, as well as do REV matching in some cases.

      4. Wrong. OBD provides access to the can bus. You can talk to any device including the transmission control unit and query it, if you know how. Messages with that info are likely already being sent.

        1. Not true to every vehicle
          Some which use CAN buss between ECU TCU and MFD will still use an older style K-line to the OBD. So really depends on car in question.

          This setup would be handy if able to output to can to talk to aftermarket standalone ECU in some sernarios

      5. Many manufacturers connect the CAN bus to the unused pins in the OBD2 port. You can get the readouts of any sensor connected to the CAN bus, but implementation varies greatly between manufacturers.

        1. And the popular no-brand ELM327 bluetooth obd adapters are often fully capable of communicating on the CAN bus(es) automatically, and have been for years now.

          (There’s apps for various manufacturers (Stellantis/FCA/whatever, GM, Ford, probably other large groups of makes) which can often change settings and enable dealer features. My experience with them is only with alfaobd on ram’s, but I imagine things are similar across the board. Even if something doesn’t have all that, tons of sensors are going to be available over the connection.)

      6. OBDII won’t tell you what gear yiur in with a manual transmission unless the car is equipped with some form of engine Rev match system. Wich you don’t see in older cars.

        1. That’s not accurate. The Ist gen Toyota FRS/Subaru FRS show you what gear you are in on the dashboard, no rev matching to be had in these cars, my 2014 Ford Focus knows what gear I’m in as it tells me to upshift or downshift to the appropriate gear.

      7. False. You can access every sensor through the OBDII port, live. This is how my custom dash works. This is how most cars work. It is not proprietary software. It absolutely does make the current gear data available on my six speed. It is not just emissions related items. It even has yaw rate available.

        1. Sure but most manual transmissions have no sensors and no connection to the can bus since they’re, you know, manual. The data is derived from engine rpm vs wheel speed, and if you suck enough at driving manual to actually need this thing by the time the clutch is engaged it’s too late. I mean sure, it can calculate that the brief rev to 12,000 rpm at 45mph is first gear, but you’re still out a lot of cash already.

    2. My 1983 VW Rabbit knew. It would use the info to flash an ‘upshift’ light in the dash. It used a 6 pack of switches on the selector ‘drum’. If course the switches would wear out and I replaced the transmission with a different on that only had a reverse lamp switch and the cluster with a GTi one that had a tachometer.

      He needs to get back to first principles. The ‘stick’ actually works against shift rods. So if he could put a microswitch or something on each shift rod he would easily know which gear with no microcontroller or anything. I mean bare minimum 6 microswitches, 6 resistors and 6 LED.

      If you want to get fancy there are ‘sequential shift’ gear shifters that use a ratcheting mechanism and some ‘cam plates’ to handle the gear position. Then you simply lever one direction for a higher gear, and the other direction for a lower gear. That said it would be amazing if the cam plate moved an automatic style indicator through the gears.

      If this works he should patent it and use it for curing stick drift in video game controllers 😂

      1. I should have said he already has access to the X and Y bell cranks and cables coming from the shifter. So could have implemented a simple microswitch for front/back, and 3 more for the “gate”. A simple logic circuit would tell you forward+first gate is 1st gear. F+2nd gate is 3rd gear. Etc.

        Kudos for the hack, keep experimenting and learning. Neat way to make a hall effect joystick.

        1. I’m now wondering if the microswitches could be the logic, as they are double throw, containing their own ‘NOT’ signal. Also 4 microswitches total. As the default gate is the center one it doesn’t need its own switch. Argh this is going to bug me, I’m looking up some flowchart software now.

  2. Honestly wish MOST vehicles were manual. I see this being very useful for a learner/beginner or if you have a car you drive a few times a year. However after a bit of experience with any given vehicle, the tactile feel is all you need.

    a note on manual. the way people drive because they are in an automatic is appalling. There are a few principles in driving that most people will never recognize and are a bit to conceited to admit. Some of which could be solved simply by driving a manual. Ever notice how truck drivers leave space in front of them in traffic jams? Driving is as much about the space you do NOT occupy as much as it is about the space you DO occupy. Most hard lock traffic jams could be alleviated by simply leaving enough space for cars to merge properly without stopping. When you drive a manual, and you don’t wanna mash the clutch 500 times in 15 minutes, you simply leave it in a low gear and observe the movement of the crowd as a whole rather than mashing the gas and brake repeatedly to gain 30 inches. Other little things like being more mentally engaged in driving causes greater attention to the road. Knowing the timing of your daily red lights so you’re ready to move by being in gear at the right time. more attention to your speed due to having to be in the proper gear at the proper time. Having to take an extra second to think about changing lanes to pass due to possibly having to downshift to make a pass. not having a free hand to stare at your phone while blazing down the highway, so on and so forth. I really do wish cars were made for driving, rather than focused on dozens of cup holders, stupid screens, and ease of access via automatic ‘features’. The ‘feature creep’ is super real and super useless, even counter productive. I think it matters more that a car is durable and affordable rather than turning on the windshield wipers without my intervention or some other stupid function that breaks in a few years. however can’t convince most consumers of that, they want a recliner in a home theater on wheels they can drive way too far to work so they can save a few bucks on their house and spend more on the gas and car to get there.

    having said that, I do like this project as it can slightly lower the learning curve for anyone to learn to drive a car with a real transmission, should be on all rental vehicles and dedicated learning vehicles. Could be a real market for this as a post manufacture bolt on.

    1. So while I agree with all of your points about how to drive better, and even do them myself in my old automatic and now tesla (does it count as automatic?) But I think you underestimate both your own intelligence relative to the standard driver out there, AND the extent to which people’s ignorance will prevail against any practical considerations. I am sure you would have figured out similar ideas even if you did not know how to drive stick, because it just makes traffic flow better and leads to less accident exposure while maximizing speed. (Never brake is a good goal). So many people however drive with the most short sighted goal set. Basically, “I am going forward so the faster I go forward right now the better” leaving things like an upcoming light or merge to be worked out when it becomes an immediate issue. So I would say this would remain an issue if they were driving stick, and they would just suffer the consequences of their actions, including shifting 20 times per minute in heavy stop and go traffic. ” I can’t let that person merge, that will put me 10 feet further from my goal of forward!” Glad to see there is at least one other driver out there who is trying to drive optimally though.

      1. We need a tech that disables smartphones inside a car not in park, not one to make texting easier. The act of writing or talking thru a phone is what kills your attention to road conditions.

        1. With all the things to twiddle that are built into the car, and all the stuff people mess with without a phone (makeup, food, kids, etc) I don’t think that’s the main problem. We had texting and maps and all sorts of stuff in cars 20 years ago, even if it wasn’t built in. That was before things had gotten this bad, although even then we rightfully blamed texting for some of the problems.

          But I think the main problem in the past few years is people who perhaps feel so invincible and perfect that they don’t think twice about how the way they drive may interact with others or the road/weather conditions to cause problems. It’s not just that they’re paying attention to things other than driving, it’s that they don’t know or care what they should even be paying attention to while driving. They could have zero distractions and still run a red light, then blame you for hitting them. Or go 20 over the limit in heavy rain without so much as turning on their lights to make themselves easier to see.

        2. The solution isn’t to disable smartphones but rather to enforce the laws stricter, catch more people on their phone and driving and punish them.

          Your solution of disabling phones in a car not in park is not a great solution as it means that passengers can’t use their phones either.

          Hands free systems are also fine to use, they are no different than having a conversation with a passenger.

      2. Pfft. I could eat a burger, fries and drink a soda all while signaling my turn and shifting.

        Chording or joystick keyboards exist. An 8 way stick with 2 shift keys can give you 24 characters. Enough to type most stuff you’d want. Forget z x v and make one spacebar.

    2. I sometimes borrow an old stickshift pickup when my regular vehicle is indisposed. It’s more dangerous, because I can’t maneuver as aggressively as modern traffic does, although partly that’s because a) it has neither the engine nor the handling to keep up and b) if I keep it in low gear trying to pretend it’s a sports car, I get 12 mpg instead of 18. Also, the sharpness of the way the clutch grabs and position of the pedals makes uphill starts a pain to neither stall nor roll back, unless I make use of the e-brake pedal by depressing it as far as it will go every single time – even if I am only advancing one car length. (That says more about the e-brake’s strength than the transmission, but still.) Also, even though it hasn’t been used enough to really deserve to be worn out, and it’s had its fluids changed to help the synchro’s do their job, it still sometimes doesn’t cooperate when upshifting while trying to get on a highway from a standing start. It’s… frustrating, when you’re rev-matching and the damn thing still tries to keep you out unless you force it to grind its way in. Sample size of 1 transmission, but none of that is unheard of in general.

      By comparison, with a zf 8hp automatic, which I’ve experienced in multiple vehicles, the same engine probably would have been entirely adequate because there’s more gears, it shifts faster, and there’s no slushiness. And of course, a torque converter has a lot longer life when you slip it than a clutch when you ride it. The decision to shift may be slower than the speed of shifting – that lies with the programming for the vehicle. Assuming they’ve programmed it properly it will happily upshift you to a low and efficient rpm while still being able to downshift very quickly at any point you actually need power. It rewards optimal driving still, but doesn’t punish mistakes by making you unable to maneuver.

    3. If someone cannot handle manual gears, regardless if they only drive once a year, then they shouldn’t be driving in my opinion and learning how to use the gear stick is very easy too.

    4. Good point. Riding my motorcycle is very similar to your senario. riding in traffic is brutal on the left hand (pulling and relesing clutch lever). I ride just like what you describe. This is also one of the reasons lane sharing is so popular in California.
      Back to the project. Good learning tool and conversation starter….

  3. If you actually have a manual car, you know what gear your in, ALWAYS. Only takes a week or two to get used to the shifter position relative to yourself. A solution looking for a problem.

    1. You know where it is, I’d like to stress, without looking. You get to know it by feel, not by sight.

      Also, knowing ‘what gear it’s in’ is far less important than knowing *when* to shift. Don’t know how many times I’ve been 2nd in line at a red light, and the car in front of me clearly tried to get it into 3rd before they got across the intersection. Nice little cars driven like overloaded trailer trucks. Not sure a little glowing number to look at is going to help with that.

      1. yep, 100% true…
        This is a solution looking for a problem imagined by people who don’t drive manual cars…
        and in any case, this is looking for a problem that will just disapear thanks to EV…

      2. This is what a shift light on the tach is for, preferably a mechanical tach sticking out of the hood so it’s in your line of vision without having to look down.

          1. But that would require more effort from their brain & their ears.. Might explode from the sensory overload. Today’s generation with how soft they have gotten would probably see this as a form of slavery & protest it…

          2. @Justin, I suppose I don’t find myself impressed with the younger generation either, but there’s just as many spoiled members of older generations. The ones who expect to be treated like royalty with five star service for minimum wage and a five percent tip, for instance. Or the ones who take credit for the prosperity that was built on their parents’ hard work. History’s never cut and dry, but there were people who started with nothing after the depression and went through war and social upheaval to make it possible to get a nice union job with a pension. Then there’s their kids, who reaped the benefits and convinced themselves they earned it.

            Now we don’t teach the younger generations what we used to, what we ought to if we’re going to judge them on it. The world is only getting more complex, while the usual goals seem less and less achievable or practical to aspire to. I mean, really – whether you look at jobs that don’t require higher education or you look at the cost of college and figure on how long it’ll take to pay off, there’s some tough decisions to make. If your average joe doesn’t feel like he can realistically dream of getting a house, giving a kid at least as good a childhood as he had, and then retiring, what’s he going to do? Tread water and spend time assigning blame or finding happiness where he can, I suppose.

  4. Regarding the hackaday article:
    The first part of this article contains a lot of “we”, who Dan are you exactly referring to?

    Regarding the project:
    Fun little project, pretty smart idea to use hall sensors.
    Tip for the next video, keep the display and the stick in the same orientation, makes it easier for the viewer to watch and see that it actually works without requiring the viewer to mentally rotate one of the two items.

    Regarding manual transmission:
    If you need an indicator to visualize what gear you are in, then you’d probably better of driving automatic. Shifting gears isn’t difficult at all, first of all the current speed at which you are driving at is a huge indicator of what gear you could be in. If the car doesn’t seem to accelerate, shift down until it does. but if the car makes too much noise, shift up. Finally, the huge stick with the billiard ball on top of it, is also a huge indicator as it always seems to point in a distinct direction depending on the currently selected gear. But all that was also mentioned at the start of the article. So I guess “we” already know that by now.

    1. And don’t forget the next higher gear or lower gear is accomplished mostly moving the stick the other direction. If it’s forward you’ll need to move it down……. my problem is mostly the difference between the long throw commercial truck trans and my wifes super short one.

      1. and some tieiraps, some wire in various colors, some insulation material like tape or heat shrink tubing, a soldering iron and some solder and some spare time speaks for itself, just like the tools to get to the proper area to do the job and to repair the damage you caused by getting to the part that needed to get fixed.
        But perhaps more importantly a decent relay, because the reed contact most likely can’t handle the current of the light bulb that is required to be lit. Oh, don’t forget a diode (or another sort of snubber), to prevent arcs from happening in the reed contact when switching the relay, otherwise it only works a few times.

        The classic “all you need is…” is where all simple project starts. But in the end simple projects always end up requiring much more time and parts then initially suggested/anticipated (assuming nothing goes wrong because then it’s even worse). Anyway, the not mentioned “details” are always pretty obvious for the one who mentions the handy tip, but a complete surprise for the “slightly less handy” person doing the job.

    1. Angle bracket and a microswitch. Work out where the stick lands to engage reverse. Put the switch there. When reverse is selected the switch will engage the reverse lamp. Even easier if there is a reverse lockout or reverse is alone on its own ‘gate’. Put the switch on the lockout mechanism or the gate that the reverse light uses.

  5. ” as we recall it was pretty straightforward”

    Yes, driving A vehicle with a manual transmission is pretty straightforward.

    Driving two however… Just when to shift and when not to… there is so much variance!

    I learned in two trucks that couldn’t possibly be more opposite one another. One you almost needed an expressway to get passed second. The other you could barely get them into the first few gears before it was time to shift.

    One you had to so slowly, carefully ease the stick into gear or it would grind and stall. The other Go Go Go what are you waiting for!

    1. Yeah, I currently have a car with a three speed manual, R1,23, and another with a five speed, 12, 34, 5R, and another with a six speed, 12, 34, 56/R, and sometimes I do appreciate that one of them has the gear it’s in shown on the dashboard. It was really useful when I was teaching a friend to drive it recently because it isn’t immediately obvious from feel (short shifter narrow gates) if you’re not very used to it.
      I know a guy who has the same transmission case as I have in the five speed, although he acquired the case as a four speed. He races his little Datsun and decided it would be a good idea to convert it to the five speed, but because the output section of the two cases is a little different and doesn’t have room for the five speed synchro in the same place mine has it, and also because he wants to have 3-4 inline for racing because that’s the main shift he does (originally R1, 23, 4) he has the stupid thing set up with R1, 52, 34. He says he’s learned it and never misses a shift, but dayammnnnn I think I’d want a map and a gear position indicator.

    2. I would swap the differential in my 1989 BMW. I had a 2.89, a 3.73 and a 4.11. The 2.89 was great for the freeway and fuel economy. The 4.11 gears were amazing for getting off the line, but freeway use was noisy.

      I drove alternately a 2011 Nissan and a Ford Ranger at work. The Ford was terrible, by the end of the day I had to start it in gear or it wouldn’t engage a gear to get rolling. The Nissan had car style ratios which were great for normal driving. But taking a loaded service truck into the hills twice a month was a disaster. Had to get a running start at a lot of driveways. And I’m amazed I didn’t get stuck.

  6. This would be a great starting point for a reasonably safe remote start on a manual vehicle. Any attempts I’ve seen in the past have always sketched me out.

    This could also be turned into some kind of warning light for a racecar if combined with VSS input. It’d be great to have a big bright light turn on around eye-level when you’re about to dump the clutch on second when you needed to grab fourth.

    1. The corvette had something similar. Due to the amount of torque from the small block v8 it would lock out 2nd gear using a solenoid if you weren’t accelerating particularly quickly. Forcing a 1st to 4th gear skip shift. This could probably be copied to prevent ‘money shifts’ instead of passing fuel economy testing.

      Funny enough I got a ride in a top-level professionally prepped C4 autocross Vette. It had the 6 speed* and a wicked tuned 280hp motor. *You got it rolling, stuck it in second gear. . . and never shifted. The engine had a massive flat torque band and would easily hit 60mph pulling out of even a low speed corner.

        1. I looked it up and Autocross in general seems to be designed to keep you between 25-60MPH. and the LT1 motor C4 Vette with the 6-speed has a top speed in 2nd gear of somewhere in the 72-77 mph range (the regular small block bogs a little after 4,500, but the LT1 can pull strong to 6,000RPM.) This agrees with what I felt doing a ride-along.

          Basically what I am saying is an engine with a wide torque band and the proper gear ratio can minimize shifting. while shifting you are not applying power.

          See also the Saab and Volvo which were tuned and geared to pull the fastest from 30-70mph. So while maybe not super powerful, in traffic they felt a lot better than most other cars.

  7. I think that this would be a good solution for people wanting to manual swap a car that would not otherwise be manual.

    Changing the transmission usually requires reflashing/reconfiguring the car (sometimes in a way that is prohibitively expensive). Going this route might be a way to avoid all of that trouble.

    It certainly has me thinking….

      1. That’s poor advice at best. I’ve done the swap, if you are doing it yourself and source the parts economically, it can be a better option, especially in vehicles where a manual may be difficult to fine

        1. Agreed.

          I’ve done manual swaps before. I have a car in mind for this project that I am not sure *ever* came to the US with a manual transmission.

          But, a cohort model did make it to the North American continent. Using this method to lie to the TCM would possibly allow me to avoid the heavy lift of BCM/TCM/ECM/DIM module hacking/flashing on that car.

          More research is certainly warranted considering this new development :-)

  8. Back in the mid 2000s I remember seeing a shift knob that had a numerical indicator showing what gear you were in, and ever since then I tried to think of how one would build a sensor setup for that based on leaf switches or the like. This is a pretty cool way to achieve the same thing. As someone who loves to drive manual, I don’t see this as a driving aid but more just a “nice to have” thing for cool factor and could be a nice aesthetic upgrade to have the current gear shown on the dashboard. Gearbox gear indicators are common on sequential transmissions found in the road and rally racing worlds, so I could see someone trying to emulate that.

  9. I would like to do this but with my automatic gearbox. I can use a virtual clutch pedal to actuate the clutch in the automatic gearbox. Then I would need a stickshift made with a nice feel. Fully Electronic, setup like this so the arduino can give the gear selection to the TCU.

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.