Friday 23 October 2020

DIY Car Steering Wheel Control Unit with Attiny

Most of the modern vehicles are manufactured with steering wheel control units. But older and budget vehicles do not have such a facility. But if you install an aftermarket car stereo system, you can see there are two cables to connect steering wheel control units.

But if you have a dream to have a steering wheel control unit for your vehicle, this tutorial will help you to create such a unit.

Basics

The car steering wheel controller is basically built on resistance. If you press a button, the device identifies the resistance and will be activated the particular switch.

There are two options

OPTION 01

Programmed Control unit with Arduino

You can make a classic control unit using Arduino. I am using here one Rotary encoder and ATTINY IC.

The  circuit is as follow


If you have completed the circuit, you can upload the following code.

 /* Read Quadrature Encoder
  * Connect Encoder to Pins encoder0PinA, encoder0PinB, and +5V.
  *
  * www.setnfix.com
  * 
  *
  */  


 int val; 
 int encoder0PinA = 0; 
 int encoder0PinB = 1; 
 int test = A2;
 int testdata=0;
 int volP = A3; // Volume control +
 int volM = A1;// Volume control -
 int encoder0Pos = 0;
 int encoder0PinALast = LOW;
 int n = LOW;
// int BOOT = 3; //boot up set
// int ampoff = 11;
/// int AMP=2;
 //int POWER = 5;

 // Variables will change :
//int ledState = LOW;             // ledState used to set the LED

// Generally, you should use "unsigned long" for variables that hold time
// The value will quickly become too large for an int to store
unsigned long previousMillis = 0;        // will store last time LED was updated

// constants won't change :
const long interval = 1800000;           // interval at which to blink (milliseconds)

 void setup() { 
   pinMode (encoder0PinA,INPUT);
   pinMode (encoder0PinB,INPUT);
   pinMode (test,INPUT);
   //pinMode (BOOT,OUTPUT);
   pinMode (volP,OUTPUT);
   pinMode (volM,OUTPUT);
 } 

 void loop() { 



testdata = analogRead(test);

    
   n = digitalRead(encoder0PinA);
   if ((encoder0PinALast == LOW) && (n == HIGH)) {
     if (digitalRead(encoder0PinB) == LOW) {
       VolumeUP();
       //delay(200);
     } else {
      VolumeDOWN();
      //delay(200);
     }
     //Serial.print (encoder0Pos);
    // Serial.print ("/");
   } 
   encoder0PinALast = n;
   
   
   //POWERON/OFF switch

     unsigned long currentMillis = millis();

  if (currentMillis - previousMillis >= interval) {
    // save the last time you blinked the LED
    previousMillis = currentMillis;

    // set the LED with the ledState of the variable:
    //digitalWrite(POWER, ledState);
  }
   
   
   
   }

   void VolumeUP(){
    digitalWrite(volP,HIGH);
    delay(500);
    digitalWrite(volP,LOW);
   }

   void VolumeDOWN(){
    digitalWrite(volM,HIGH);
    delay(500);
    digitalWrite(volM,LOW);
   }
   

If you want to know how to upload the codes with Arduino to ATTINY, you can watch the following video.





OPTION 02

Physical Button Switches

This method is the easiest way to create steering wheel switches. Just follow the following circuit diagram.


You can extend the switch as the following diagram

Download high-resolution Circuit diagrams CLICK


Programming the above switches with a car head unit can be seen by watching the following video.




If you have any doubt, do not hesitate to put in the comments.
Stay with setNFix


'



AliExpress.com Product - COB LED Lamp Chip AC 220V LED Bulb 10W 20W 30W 50W IP65 High Power Smart IC DIY Flood light Bulb Spotlight Outdoor Chip Lamp
AliExpress.com Product - 4PCS Car Portable Disassembly Tool Audio Removal Trim Panel Dashboard Car DVD Player Special Disassembly Tool
Previous Post
Next Post

post written by:

3 comments:

  1. I am a bit confused here. If you use same ohm resistor for the switches how can the head unit differentiate between the switches. What i mean to ask is are you sure to use the same 220 ohm resistor for every switch in you second simple option?

    ReplyDelete
    Replies
    1. Ok. Check the 1st circuit. for an example, if you press "Back" key, then the switch will be closed and connected with ground. the ground from the pin 1 of the switch will go to the R12 resistor. Then the Head unit will be received (220ohm *5 ) 1100ohms.

      However if you press "Next" key, the head unit will be received only 220ohm.

      I think you can understand it..

      Delete