Pages: [1] 2   Go Down
Author Topic: Steering wheel control  (Read 2921 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is my first ever project with the Arduino.  I have worked with basic stamp a bit.
So my project is this.  
I just bought a new truck.  I am putting a after market radio in my car.  I need to control the radio with the steering wheel control.
I know they make boxes out there to do this. This is the box I am using http://retailer.installernet.com/productfeatures.aspx?retailerid=1273&productid=23230&sid=20B26D55-DA04-4B5D-A62C-6767C92FBC25
My problem is this.  
I need to have 1 single button do two actions.  For example.  Phone button press will pick up a phone call.  Hold Phone button and it would start voice recognition.  
Since i dont know the protocol that the Pioneer unit uses I would need to use the ASWC box as well.
Steering controls------> Arduino -------->ASWC--------> Radio
Summarize
Arduino reads the resistance from the steering wheel control then sends a resistance valve to the ASWC box which then makes the radio function work.

Not sure where to start.  I did buy a nano should be here tues
Thanks
Mike


* Res.PNG (40.79 KB, 906x411 - viewed 90 times.)
« Last Edit: September 10, 2012, 03:05:47 pm by themlruts » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

no one can help me?
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 508
Posts: 31427
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It is not at all clear why you want the arduino.
It is not at all clear what buttons you want to detect.
It is not clear what the arduino has to feed to the ASWC as this appeares to be a compleate solution.
It is not clear why the thread has this title.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Use a PNP transistor to drive a constant current of about 10 mA, into the resistance which is to be measured.

Connect the output to the pwm pin of arduino and get a value corresponding to the resistance value. use that value with a digital pin to operate your radio or whatever.

hope this resolves some of the issues in your problem.
Logged

Offline Offline
Edison Member
*
Karma: 20
Posts: 2110
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
int analogPin = 0;     // potentiometer wiper (middle terminal) connected to analog pin 3
                       // outside leads to ground and +5V
int raw = 0;           // variable to store the raw input value
int Vin = 5;           // variable to store the input voltage
float Vout = 0;        // variable to store the output voltage
float R1 = 10;         // variable to store the R1 value
float R2 = 0;          // variable to store the R2 value
float buffer = 0;      // buffer variable for calculation

void setup()
{
  Serial.begin(9600);             // Setup serial
  digitalWrite(13, HIGH);         // Indicates that the program has intialized
}

void loop()
{
  raw = analogRead(analogPin);    // Reads the Input PIN
  Vout = (5.0 / 1023.0) * raw;    // Calculates the Voltage on th Input PIN
  buffer = (Vin / Vout) - 1;
  R2 = R1 / buffer;
  Serial.print("Voltage: ");      //
  Serial.println(Vout);           // Outputs the information
  Serial.print("R2: ");           //
  Serial.println(R2);             //
  delay(1000);
}

I just copied and pasted this from the old forum... i want to try out this code now
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It is not at all clear why you want the arduino.
It is not at all clear what buttons you want to detect.
It is not clear what the arduino has to feed to the ASWC as this appeares to be a compleate solution.
It is not clear why the thread has this title.

1.  The arduinio will give me the function to have 1 button do 2 actions. quick press or hold press
2.  Vol up, Vol down, trk up, trk down, Seek up, seek down, Phone pickup, phone hang up, Voice activate and Mode
3. The ASWC reads the Resistance there for I would need the arduino to create those Resistances and send them to the ASWC. The ASWC will only do one action per button.

I am not sure i can connect the arduino directly to the radio as i am not sure what the protocol is that the pioneer radio uses this is why the ASWC is in the picture



« Last Edit: September 10, 2012, 03:07:00 pm by themlruts » Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 508
Posts: 31427
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The ASWC reads the Resistance there for I would need the arduino to create those Resistances and send them to the ASWC.

In which case you need to use a digital pot to send the unit a resistance value.

http://arduino.cc/en/Tutorial/SPIDigitalPot
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The ASWC reads the Resistance there for I would need the arduino to create those Resistances and send them to the ASWC.

In which case you need to use a digital pot to send the unit a resistance value.

http://arduino.cc/en/Tutorial/SPIDigitalPot
Thanks I have ordered some samples already.


The good news is I dont need the AWSC.  The pioneer head unit just read resistance values. 
As I am new this is the code i am starting with.
Code:
int analogPin = 4;     // potentiometer wiper (middle terminal) connected to analog pin 3
                       // outside leads to ground and +5V
int raw = 0;           // variable to store the raw input value
int Vin = 5;           // variable to store the input voltage
float Vout = 0;        // variable to store the output voltage
float R1 = 15;         // variable to store the R1 value
float R2 = 0;          // variable to store the R2 value
float buffer = 0;      // buffer variable for calculation

void setup()
{
  Serial.begin(9600);             // Setup serial
           // Indicates that the program has intialized
}

void loop()
{
  raw = analogRead(analogPin);    // Reads the Input PIN
  Vout = (5.0 / 1023.0) * raw;    // Calculates the Voltage on th Input PIN
  buffer = (Vin / Vout) - 1;
  R2 = R1 / buffer;
  Serial.print("Voltage: ");      //
  Serial.println(Vout);           // Outputs the information
  Serial.print("R2: ");           //
  Serial.println(R2);             //
  delay(1000);
if(( R2 > 21 ) && ( R2 < 23) )
{
digitalWrite(13, HIGH);
}
else
{
digitalWrite(13, LOW);
}
}
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 508
Posts: 31427
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

As R2 is a float then you will be lucky to get it into such a range.
Vin is an int and so needs casting as a float before doing sums with it.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As R2 is a float then you will be lucky to get it into such a range.
Vin is an int and so needs casting as a float before doing sums with it.

You completely lost me there.  Can you explain? Float?
Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As R2 is a float then you will be lucky to get it into such a range.
Vin is an int and so needs casting as a float before doing sums with it.

You completely lost me there.  Can you explain? Float?

He means the variable is of the float data type.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

got it so i think i should covert the float to interger?
Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

got it so i think i should covert the float to interger?

An unsigned integer would give you a much larger absolute value.  Furthermore, negative ohm resistors are hard to come by. smiley-wink
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can anyone help write the case statements for this? 
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 508
Posts: 31427
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

For what? It dosn't look like a case statement is sutiable here.
Logged

Pages: [1] 2   Go Up
Jump to: