Sam SutherlandEthan Owens
Published

Air Ride Suspension Control

Using a particle, we connected it to an Air Ride suspension in a VW Rabbit and are able to control it through the phone.

IntermediateShowcase (no instructions)2 hours2,740
Air Ride Suspension Control

Things used in this project

Hardware components

Photon
Particle Photon
×1
Breadboard (generic)
Breadboard (generic)
×1
Particle Photon I²C 2-Channel SPDT 1-Amp Signal Relay
ControlEverything.com Particle Photon I²C 2-Channel SPDT 1-Amp Signal Relay
×2
Male/Female Jumper Wires
Male/Female Jumper Wires
×8
Male/Male Jumper Wires
×3
VU4 Switch Box Harnes
×1
Wire Cable - By the Foot
OpenBuilds Wire Cable - By the Foot
×4

Software apps and online services

Particle Pi
Particle Pi

Story

Read more

Schematics

Circuit Diagram

Relay Diagram

VU4 Switch Box Wire Harness Diagram

Code

Coding

ActionScript
int FrontUp =D6;
int RearUp =D5;
int FrontDown =D2;
int RearDown =D1;

void setup() {
   pinMode(FrontUp,OUTPUT);
   pinMode(FrontDown,OUTPUT);
   pinMode(RearUp,OUTPUT);
   pinMode(RearDown,OUTPUT);
   
    
    Particle.function("Lift", lift);
    Particle.function("Lower", Lower);
}

void loop() {

}
int lift(String command) 
{
    
    if (command=="1") 
    {
    digitalWrite(FrontUp,HIGH);
    delay(500);
    digitalWrite(FrontUp,LOW);
    digitalWrite(RearUp,HIGH);
    delay(650);
    digitalWrite(RearUp,LOW);
    return 1;
    }
    else if(command=="2") 
    {
    digitalWrite(FrontUp,HIGH);
    delay(1100);
    digitalWrite(FrontUp,LOW);
    digitalWrite(RearUp,HIGH);
    delay(1350);
    digitalWrite(RearUp,LOW);
    return 2;
    }
    else if(command=="3") 
    {
    digitalWrite(FrontUp,HIGH);
    delay(1800);
    digitalWrite(FrontUp,LOW);
    digitalWrite(RearUp,HIGH);
    delay(2300);
    digitalWrite(RearUp,LOW);
    return 3;
    }
    else {
        return -1;
    }
    
}
    
int Lower(String command) {
    
    if (command=="1") 
    {
    digitalWrite(FrontDown,HIGH);
    delay(650);
    digitalWrite(FrontDown,LOW);
    digitalWrite(RearDown,HIGH);
    delay(900);
    digitalWrite(RearDown,LOW);
    return 1;
    }
    else if(command=="2") 
    {
    digitalWrite(FrontDown,HIGH);
    delay(1250);
    digitalWrite(FrontDown,LOW);
    digitalWrite(RearDown,HIGH);
    delay(1500);
    digitalWrite(RearDown,LOW);
    return 2;
    }
    else if(command=="3") 
    {
    digitalWrite(FrontDown,HIGH);
    delay(2000);
    digitalWrite(FrontDown,LOW);
    digitalWrite(RearDown,HIGH);
    delay(2500);
    digitalWrite(RearDown,LOW);
    return 3;
    }
    else if(command=="0") 
    {
    digitalWrite(FrontDown,HIGH);
    delay(1250);
    digitalWrite(FrontDown,LOW);
    digitalWrite(RearDown,HIGH);
    delay(1250);
    digitalWrite(RearDown,LOW);
    digitalWrite(FrontDown,HIGH);
    delay(2000);
    digitalWrite(FrontDown,LOW);
    digitalWrite(RearDown,HIGH);
    delay(2000);
    digitalWrite(RearDown,LOW);
    digitalWrite(FrontDown,HIGH);
    delay(2000);
    digitalWrite(FrontDown,LOW);
    digitalWrite(RearDown,HIGH);
    delay(2000);
    digitalWrite(RearDown,LOW);
    return 0;
    }
	else {
        return -1;
    }
}

Credits

Sam Sutherland

Sam Sutherland

1 project • 0 followers
Ethan Owens

Ethan Owens

1 project • 0 followers

Comments

Add projectSign up / Login