Automatic Transmission Shifter Idea

First of all, I am a noob. Not so much to electronics/electricity, but to programing and IC's. Please be patient with me, because I have little experience with controllers, but I am very excited to start learning. I will try to be as thorough as possible when explaining my ideas.

My car has an automatic transmission that uses two solenoids to shift into one of 4 gears. Right now I can manually control the gears like a manual transmission by using 2 toggle switches that provide 12 VDC to the solenoids. The table below shows which switch combinations engage which gear.

Switch 1 (Solenoid 'A') Switch 2 (Solenoid 'B')

(1st Gear) ON ON

(2nd Gear) OFF ON

(3rd Gear) OFF OFF

(4th Gear) ON OFF

I purchased an Arduino 'UNO' controller and would like to use it to control relays that will control the solenoids by using 2 push buttons. I would like to have one button for upshifting, and one for down shifting. I would like to be able to press the upshift button 4 times and go through the gears like so, 1st->2nd->3rd->4th , and the downshift button would be able to do the opposite. I also want the ability to downshift regardless of the gear, for example, 2nd->1st or 3rd->2nd or 4th->3rd . Meaning I don't want to go all the way to 4th gear for the downshift button to work.

At some point I would also like to integrate a 7 segment display to show which gear the car is in.

Right now I am very lost with how to program, which pins to use, and how to control the solenoids (with a relay, transistor, ?)

I know how to upload the code, but I'm having trouble with understanding how to write it.

Any help/advice is greatly appreciated! Thank You! :blush:

P.S. There is a product that does this, but I'm a DIY'er and want to take the opportunity to learn something new. I also like the possibility of integrating different features. Here is a link to help you better understand what I'm trying to do > http://www.roadsurge.com/viewproduct.php?id=1

I'm a noob myself but if you want some advice keep reading...
I wouldn't try to control the shifting with the arduino, leave that up to the high paid engineers (unless the original is broken). But reading which gear is already selected and displaying that to an LCD screen is very do-able.
Sample the solenoids with a resistor of appropriate value to tame the 12v to 5v before wiring it to 2 analogRead pins, I'd write the code something like this:
//
initialize 2 pins for switch 1 and 2 with int
initialize a gear variable with int
setup the pins as inputs with pinMode

make 2 interrupts both referencing the switch pins and pointing to a state change loop

use the changed state to trigger a function determining which gear has been selected.
"if (switch1 = HIGH && switch2 = HIGH),
gear = 1",
else if(switch1 = LOW && switch2 = HIGH),
gear = 2
and so on.

take that gear value and either light up a bar graph of 4 leds (simplest) or convert it to a 7segment display (not something I'v done yet)
//

I also recommend reading on how to use "serial.begin" and "serial.print()", very useful for debugging.

Hopefully I've used enough keywords to get your research started, it seemed pointless for me to write it all out since i'd make mistakes and not be able nor willing to make a circuit to debug it :stuck_out_tongue:

@invintive

You should start simple and work your way to controlling solenoids. First use the examples provided with the Arduino IDE.You will find sketches using buttons and you will find sketches to blink LEDs. If you can make 2 leds to follow the pattern that represents your requirements to control transmission solenoids you will be ready to move to the electronics next.

By the way, what about reverse? You did not list a way to activate reverse.

Thank you for the feedback! The transmission computer is bad, and I have been controlling the gears with toggle switches like I said. Reverse and park are controlled mechanically by the shift lever. Once the lever is placed in 'Drive' the gears are controlled by me with the 2 switches. I am an automotive tech student and simply want a more user friendly way of doing what the toggle switches already do. That way its harder to accidentally go from 4th gear to 1st with the flip of a switch, not that its happened yet (knock on wood). I have already been playing with the button and LED sketches, but I'm having some trouble understanding the programming language. I took an intro to C++ in college a few years ago, but don't remember much. Any suggestions on how to learn (where to get information)?

What kind of voltage and current do the switches already in place control?

Yes there are motor/relay control circuits and boards/shields at many different net places. It's -very- possible. You might if you don't already have them consider adding engine sensors, at least a tach though perhaps something to indicate engine load would be desirable even if only manifold pressure.

I prefer manual transmissions and always have. I have yet to find an automatic that can see the road ahead and/or know what the driver is going to do next so here is at least one person who will agree you don't need automatic shift control. Dropping a gear into a turn... well you have to love sport driving to even know why I guess.

Why not junk the broken 4-speed auto for a 5 speed tranny or lol, do they make one at all any more? Automatics bleed power just to run, IMO they're made to let lazy and stupid people drive.

@Invintive Keep in mind that the Arduino IDE has some language parts that are it's own. It is based on c/c++.

You can learn a lot of the language by practicing sketches with you Arduino but, if you want a book for C ++ here is what I found helpful. http://www.amazon.com/Schaums-Outline-Programming-John-Hubbard/dp/0071353461

Here is some Arduino specific books. http://www.amazon.com/Getting-Started-Arduino-Make-Projects/dp/0596155514

And here is a site that is free http://www.cplusplus.com/doc/tutorial/

That sounds like a cool idea, and easy enough with an arduino
use some generic transistors to switch power to tne solenoids with a flyback diode, you can find alot on that on google
you could probably even make it automatic again if you tap into the tachometer, so. It shifts at preselected speeds
then monitor the gas pedal and you can make it downshift when you floor it
the program can be simple
assuming you debounce the switches just have each button increment or decrement thvalue for what gear you are in( do t forget to include if()s so you don't go over or to 0
Then have if(gear== 1) { //turn on proper transistors}
and additional ifs for the other gears
good luck

Does it particularly have to be push button control? It seems to me that you could most of what you're asking for just using a two pole rotary switch with four positions. That also gives you a pretty obvious and tactile indication of what gear you're in.

To be usable for day-to-day driving I'd have thought you would want to provide automatic gear selection based on engine revs, or at the very least lock out gear changes that would grenade the engine, but you haven't mentioned any requirements for that.

(If you do want that sort of thing, it could be achieved using a low-tech rev limiter, or you could make it an Arduino project.)

GoForSmoke:
I prefer manual transmissions and always have. I have yet to find an automatic that can see the road ahead and/or know what the driver is going to do next so here is at least one person who will agree you don't need automatic shift control. Dropping a gear into a turn... well you have to love sport driving to even know why I guess.

Why not junk the broken 4-speed auto for a 5 speed tranny or lol, do they make one at all any more? Automatics bleed power just to run, IMO they're made to let lazy and stupid people drive.

I hate automatics, for all the reasons you've mentioned.

It'll be interesting to see how this thread turns out.

The switches simply provide +12 volts to the solenoids. I hate automatics, and have put a great deal of research into converting to a manual transmission. I found an entire donor car for only $350, but the guy changed his mind, and I can't do it for any cheaper (BTW I'm broke).

The reason I didn't list any requirements to lockout gear changes is because it would already be safer than how I'm driving it now. If I was on the highway in 4th gear and accidentally flipped one switch I would be lucky if the transmission was the only thing to grenade. I figure I could integrate safety features after I get the basics figured out.

I'm not really interested in fully automatic control, just something to get me by a while longer until I can get a manual tranny. I saw this as a good learning project, not necessary, but it sounded fun in my head.

I considered using a rotary switch, and haven't found one. I was actually looking at radio shack for one when I saw the Arduino UNO and the thoughts started flowing, so I bought it and decided to go from there.

Thanks everyone, keep the good posts coming!

Itd be cool if you can put the buttons on the steering column, like fancy paddle shifters

The simplest way to do it would be something like this

Int gear = 1;
// output pins for transistor controlled solenoids
int solA = 2;
int solB = 3;
// input pins for up down /  with pullup resistors
int gearup = 4;
int geardown = 5;

void setup(){
pinMode(solA, 1);
pinMode(solB, 1);
pinMode(gearup,0);
pinMode(geardown,0);
}

Void loop(){
if(gear == 1){
digitalWrite(solA,1);
digitalWrite(solB,1);
}
 if(gear == 2){
digitalWrite(solA,0);
digitalWrite(solB,1);
}
 if(gear == 3){
digitalWrite(solA,0);
digitalWrite(solB,0);
}
 if(gear == 4){
digitalWrite(solA,1);
digitalWrite(solB,0);
}
//takes care of gear switching

Delay(250)//delay to prevent going through gears too quick from holding the button or pressing too long


Gear += digitalRead(geardown) - digitalRead(gearup); // non debounced! But may not be a problem because of the delay by gear change
if(gear < 1) gear = 1;
if(gear > 4 gear = 4;
//limits to actual gearset


}

other than some capitalization errors from me doing this on my phone this should compile and work, maybe try with just leds( and current limiting resistors) coming off the output pinsr

That sound like an interesting project.

Here an idea : use a VIC-20 joystick ( a swith type joystick - North / South - East / West ) just use the North and South switches - Check an old Atari joystick... <-- Those switches will be a digitalRead(inputpin) - pinMode(inputpin, INPUT);

And I check your gear selector :

Out A B
1st gear : 1 1
2nd gear : 0 1
3rd gear : 0 0
4th gear : 1 0

Hum... That pattern look like a stepper motor - 2 coil type... and I will add a single 7 segment display to tell the gear I am in...

Let see... need 9 out, 2 in = 11 I/O. The UNO or an ATMega328 is just fine. To test your code, use LED's for Out A and B ( the selenoids ) and a 7 segment display.

Bear in mind, that design is still a manual transmision, just like a driving video game using a joystick.

Anyway, just an idea.

As a mather of fact, I do have an old VIC 20 / Comodore 64 joystick at hand. Look like I will do a code just the fun of it.

invintive:
The switches simply provide +12 volts to the solenoids.

Very good. For 45 cents at Mouser you can get a ULN2803 8-channel Darlington Array that can turn Arduino 5V to up to 500 mA of 50V (or 12V) = with built-in back EMF protection= given up to 50V (or 12V) external power capable of the load and a a heat sink on the chip.
You need 2 channels for your shift toggles. That leaves 6.

Have you ever rode a motorcycle? You shift by raising or tapping a lever. Replace with one toggle switch. Click forward and let go to raise a gear, back and let go to drop a gear. 1 control that can only change 1 up or down even if it gets bumped. If you could re-connect the shift lever as a toggle with center-return springs, you'd be set. It'd be like a slapshifter.
But you know that with a clutch pedal you can hold the thing open that second while you match revs to the new gear (less rpm when I shift up, more when I shift down and let out the clutch) and speed but with automatic can you do that, make a smooth shift?

Here are a couple other ways to control solenoids.

http://arduino.cc/playground/Learning/SolenoidTutorial

Here my attept to code a gearshifter. I simulated using 7 segment and 2 led and 2 push-button switch.

Well, the code work --- "not to well' , but heh, it is a start. So far, the display sequence work fine, the while loop is fine, it up shift and down shift kind of working, but only from 1 to 4 or 4 to 1, not 1,2,3,4 or 4,3,2,1. I will be working on it to figure out. Heh it is my 1st attempt.

Here the code :

const byte outpin[9] = {4,5,6,7,8,9,10,11,12};
const byte inpin[2] = {2,3};
boolean gearone[9] = {1,1,0,0,0,0,1,1,0};
boolean geartwo[9] = {0,1,1,0,1,1,0,1,1};
boolean gearthree[9] = {0,0,1,0,0,1,1,1,1};
boolean gearfour[9] = {1,0,1,1,0,0,1,1,0};

byte gear=1;
byte beforegear=1;

int upshift=1;
int downshift=1;

void setup()
{
  for (int i=0; i<9; i++)
  {
  pinMode(outpin[i],OUTPUT);
  }
  pinMode(inpin[0],INPUT);
  pinMode(inpin[1],INPUT);
  // Put in gear one
  gear=1;
  beforegear=1;
  for (int i=0;i<9;i++)
  {
    digitalWrite(outpin[i],gearone[i]);
  } 
}

void loop()
{
  
  readswitch();
  while((upshift==1) && (downshift==1))
  {
    readswitch();
  }
  if ((upshift==0) && (gear==1))
  { 
    selecttwo();
    gear=2;
    beforegear=1;
  }
  if ((upshift==0) && (gear==2))
  { 
    selectthree();
    gear=3;
    beforegear=2;
  }
  if ((upshift==0) && (gear==3))
  { 
    selectfour();
    gear=4;
    beforegear=3;
  }
  if ((downshift==0) && (gear==4))
  { 
    selectthree();
    gear=3;
    beforegear=4;
  }
  if ((downshift==0) && (gear==3))
  { 
    selecttwo();
    gear=2;
    beforegear=3;
  }
  if ((downshift==0) && (gear==2))
  { 
    selectone();
    gear=1;
    beforegear=2;
  } 
}

void selectone()
{
   for (int i=0;i<9;i++)
   {
     digitalWrite(outpin[i],gearone[i]);
   }  
}

void selecttwo()
{
   for (int i=0;i<9;i++)
   {
     digitalWrite(outpin[i],geartwo[i]);
   }  
}

void selectthree()
{
   for (int i=0;i<9;i++)
   {
     digitalWrite(outpin[i],gearthree[i]);
   }  
}

void selectfour()
{
   for (int i=0;i<9;i++)
   {
     digitalWrite(outpin[i],gearfour[i]);
   }  
}

void readswitch()
{
  upshift=digitalRead(inpin[0]);
  delay(100);
  downshift=digitalRead(inpin[1]);
  delay(100);
}

Wow! Thanks guys for helping with the code!

The steering wheel actually has 2 horn buttons on each side I could use, but I'm still exploring my options... Everyone is giving me such great ideas!

Techone:
Here an idea : use a VIC-20 joystick ( a swith type joystick - North / South - East / West ) just use the North and South switches - Check an old Atari joystick...

GoForSmoke:
Have you ever rode a motorcycle? You shift by raising or tapping a lever. Replace with one toggle switch. Click forward and let go to raise a gear, back and let go to drop a gear. 1 control that can only change 1 up or down even if it gets bumped. If you could re-connect the shift lever as a toggle with center-return springs, you'd be set. It'd be like a slapshifter.
But you know that with a clutch pedal you can hold the thing open that second while you match revs to the new gear (less rpm when I shift up, more when I shift down and let out the clutch) and speed but with automatic can you do that, make a smooth shift?

Yes I have! I actually like to match revs when driving a car with a manual transmission, makes for really smooth downshifts and minimal brake usage. The automatic does make a smooth shift (up and down) if you get a "feel" for the timing of it, but it can also "chirp" the wheels when upshifting if you want by revving higher between shifts.

GoForSmoke:
Very good. For 45 cents at Mouser you can get a ULN2803 8-channel Darlington Array that can turn Arduino 5V to up to 500 mA of 50V (or 12V) = with built-in back EMF protection= given up to 50V (or 12V) external power capable of the load and a a heat sink on the chip.
You need 2 channels for your shift toggles. That leaves 6.

This intrigues me... So i wouldn't need any other transistors or relays?

Thank you everyone, this forum has been such a great help!!!

A few years ago I cobbled together a full throttle gear shift controller from a shift light, rev limiter and a few switches and relays. In case you haven't seen one of of these, it's a little black box that takes care of rev matching during up and down shifts with a manual transmission. Mine was very crude and assumed, for example, that the ratio between adjacent gears was constant, but it worked reasonably well considering that it was a very low tech design.

Given that you have got an electrically controlled gearbox which takes away 99% of the problems in creating a gear shift controller, I'd be really tempted to add circuits to give you a tacho input and rev limiter output, and create a complete automatic gear shift system. I think you'll be surprised how easy it is, and you could easily provide a paddle shift manual override that still takes care of the rev matching and timing for you on upshifts. Adding a throttle-blip for rev matching on downshifts would need some extra hardware (unless you were prepared to make the driver hold the throttle open for you) but there are some pretty fast acting idle control valves that might do the job. With all the bells and whistles it would take a significant amount of work, and would need a lot of tweaking to get the rev matching and timing right, but you don't have to tackle the whole problem in one go. But wouldn't it be cool to have your own home-made paddle shift system? :slight_smile:

I agree with PeterH. It is possible to design fully automatic transmission using an Arduino.

I drive a 18 wheeler before, so the RPM and speed as to be right when doing a upshift and downshift ( double clutching is needed using a 10 speeds on a 18 wheeler truck ). A manuel transmission have Gear Number, Reverse and neutral, an automatic has Park, Neutral, Reversed and the Gears numbers. An possible issue just occured to me, when a vehicule is waiting at a red light ( example ) and your are at a uphill position, I know on a manuel transmission is "tricky" to operated ( a chance to going "back-ward" ) and the other issue is a downhill shifting, manual is "tricky", specially using a 10 speed ( RPM going up quickly ). And also an uphill shifting can be a problem ( need a faster shifting - RPM going down quickly ).

Just to let you know, the newer 72 passager school bus have an electronic automatic transmission.

Just a friendly reminder:

http://store.arduino.cc/eu/index.php?main_page=conditions&language=en

1.5 UNAUTHORIZED USE
GHEO SA products are not authorized for use in safety-critical applications where a failure of the GHEO SA product would reasonably be expected to cause severe personal injury or death. safety-critical applications include, without limitation, life support devices and systems, equipment or systems for the operation of nuclear facilities and weapons systems. GHEO SA products are neither designed nor intended for use in military or aerospace applications or environments and for automotive applications or environment. Customer acknowledges and agrees that any such use of GHEO SA products which is solely at the customer's risk, and that customer is solely responsible for compliance with all legal and regulatory requirements in connection with such use.

PeterH:
A few years ago I cobbled together a full throttle gear shift controller from a shift light, rev limiter and a few switches and relays. In case you haven't seen one of of these, it's a little black box that takes care of rev matching during up and down shifts with a manual transmission. Mine was very crude and assumed, for example, that the ratio between adjacent gears was constant, but it worked reasonably well considering that it was a very low tech design.

Given that you have got an electrically controlled gearbox which takes away 99% of the problems in creating a gear shift controller, I'd be really tempted to add circuits to give you a tacho input and rev limiter output, and create a complete automatic gear shift system. I think you'll be surprised how easy it is, and you could easily provide a paddle shift manual override that still takes care of the rev matching and timing for you on upshifts. Adding a throttle-blip for rev matching on downshifts would need some extra hardware (unless you were prepared to make the driver hold the throttle open for you) but there are some pretty fast acting idle control valves that might do the job. With all the bells and whistles it would take a significant amount of work, and would need a lot of tweaking to get the rev matching and timing right, but you don't have to tackle the whole problem in one go. But wouldn't it be cool to have your own home-made paddle shift system? :slight_smile:

Do you perhaps have some sort of circuit diagram of that full throttle gear shift controller you made? It sound a little complicated to me right now because it hasn't processed much in my brain, but it's definitely a great idea! The cruise control throttle actuator would be another good way to blip the throttle.... Hmmm.... :slight_smile:

I figure I should show everyone a pinout of the transmission control module, I have access to a lot of good stuff from that wiring connector.