# Audi B7 A4 build thread with Arduino based managment



## leftovers (Dec 29, 2010)

This is my first air suspension build. When I first picked up my car, I figured I would do a few things here and there, but nothing big. It's at Stage 2 right now with H&R coil springs. After hanging out on the forums and watching a few youtube videos of Accuair e-level setups, I knew I had to have it. Unfortunately, I can't justify spending $4k on my suspension. So, I started piecing together parts from the forums and making my plan. It looks like I'll be able to have a similar setup for about half the cost. I now have almost everything I need. It just needs to get installed the way I want it. I'll use this thread as a place to put my pictures. I'm sure I'll make some mistakes along the way....be patient with me. 

This is what it looked like before I started:


I started with mounting the air tank. I didn't want to lose the ability to fold my seat down and slide cargo through there, so I planned to hang it from the rear deck lid. Unfortunately, there aren't many flat spaces to hang it from and the factory sub is in the way. What I did was put longer bolts in the child seat mounts and I made a bracket to hand the tank from.



I wanted to be able to drain the tank and tuck it up as close to the ceiling as possible. I cut the brackets off, cut them to be shorted, and flipped them to the top side of the tank.





Here you can see my 3/8" SMC water traps. The seats still close, but it's close.



In the meantime, I've been working with a friend of mine at work that knows a lot more than I do about electricity. The plan is to use some Cadillac CTS headlight level sensors as ride height sensors. We are using this Arduino setup to read the information from those sensors in order to control the Accuair VU4 manifold.

Here is the test setup:


And this is what it looks like slimmed down and connected to one of the sensors. I'll put the touch pad and display in the glove box. I'll have 3 ride heights (ground, normal height, and lifted) and a leveling button based on whatever ride height it is currently set to:


I've made some progress on the hidden mount for my compressors. I'll post pictures of that in a few days.


----------



## Yuripolak (May 30, 2008)

sweeeet.. always thought about doing that...

ended up buying accuair's e-level...
but props for doing it yourself! :beer:


----------



## tankdeer (Apr 29, 2013)

Subscribed. Just started an e-level install on our B7, but this is very cool. :beer:


----------



## leftovers (Dec 29, 2010)

tankdeer said:


> Subscribed. Just started an e-level install on our B7, but this is very cool. :beer:


Thanks. 

I'm a big fan of your avant. I hope you're taking pictures along the way.


----------



## tankdeer (Apr 29, 2013)

leftovers said:


> Thanks.
> 
> I'm a big fan of your avant. I hope you're taking pictures along the way.


Thank you. I definitely will be taking pics. We just started doing some test fitting and mapping out where we want stuff so I haven't taken many yet. That will change soon


----------



## leftovers (Dec 29, 2010)

I made some progress tonight. I powder coated my air compressor mounting bracket. 

This is the bracket I made to mount the compressors in the cubby. It took lots of cardboard templates to get it figured out. 





Hanging it for powder:



Powder done and the dual 480c compressors are mounted:






Sent from my iPhone using Tapatalk


----------



## leftovers (Dec 29, 2010)

Got the parts mounted in the car and started some air line routing:










Sent from my iPhone using Tapatalk


----------



## mellbergVWfan (Jan 31, 2008)

Very interesting. 

Are you not going to be adding functionality for manual adjustment? Only have settings for 3 ride heights seems like not enough.


----------



## Hombre3000 (Jan 12, 2010)

Very neat. You have my attention.


----------



## leftovers (Dec 29, 2010)

mellbergVWfan said:


> Very interesting.
> 
> Are you not going to be adding functionality for manual adjustment? Only have settings for 3 ride heights seems like not enough.


There's no manual adjustment planned...other than the initial program and setup. There is a re-level button to put it back to one of the specified ride heights if I pick up some extra cargo or passengers. Is there a reason why I would need more than that?


----------



## peddyproblems (Dec 9, 2009)

*FV-QR*

This is really cool, can't wait to see it all done and see how you like how your management works. If the leveling system works reliably I don't see a real NEED for manual adjustment, but it is a nice option to have and is also definitely fun to play with. I just got my air on a week ago or so though, so I'm no authority. Not to mention, mellberg here drives a super 4x4 static car Awesome project man!


----------



## boradie sucht (Aug 12, 2012)

good work, very clean install so far


----------



## leftovers (Dec 29, 2010)

I spent some time routing my air lines today. I would have done the rest of them, but I need to order more 90 degree elbows. It's really tough to figure out where to route them if you plan to keep your spare and you aren't mounting you tank/manifold to the floor. This is what I came up with so far:










Sent from my iPhone using Tapatalk


----------



## leftovers (Dec 29, 2010)

Cadillac CTS headlight sensor that I will be using for a ride height sensor. The bracket is a little funky. I thought I would have trouble mounting it, but the first one worked out great. 









Sent from my iPhone using Tapatalk


----------



## leftovers (Dec 29, 2010)

Got my glove box display mount done. I'm super happy with the fit. It'll look great with the display and keypad installed. 











Sent from my iPhone using Tapatalk


----------



## 59eurobug (Apr 27, 2009)




----------



## one_fast_vw (Feb 10, 2011)

Watching this

Sent from my SAMSUNG-SGH-I317 using Tapatalk


----------



## leftovers (Dec 29, 2010)

Not a ton of progress lately. I've been working with my buddy to figure out what the wiring harness is going to look like. I started by taking some measurements for him based on where I thought the routing would work out. He then got back to me with the amount of wired and loom I needed. I ordered that stuff from either Waytek or where I work and he got busy building it. This is the first one. It's for the compressors and VU4 manifold. I'm super impressed with his work.

I plan to start pulling panels and routing this over the next few days.


----------



## c0r3y.af (Oct 8, 2009)

Awesome build. Love how you were able to tuck away the compressors, and the custom management is very impressive. In for the finished result :thumbup:


----------



## leftovers (Dec 29, 2010)

I ran the harness through the car this week. I had to pull more of the interior than I liked, but it was the only way to put it in the right place. I'm happy I didn't break any clips. I hate interior stuff. One bonus...it did give me the chance to clean some of the under seat nasties from the previous owner. 




Sent from my iPhone using Tapatalk


----------



## leftovers (Dec 29, 2010)

My buddy finished another harness. This one contains the main power for the compressors. It also has the relays and fuses in one block. 





I routed the wires through the grommet in the firewall behind the battery. I mounted the fuse/relay block just to the left of the battery. My buddy is coming over on Sunday to put the connector ends on the harness where it connects at the glove box.


----------



## leftovers (Dec 29, 2010)

A while back I picked up these Dorbitz cups to use with the Slam Specialties RE5 air bags. I believe the previous owner put them in raw and they were a little crusty. So, I powder coated them. 



Having never installed an air suspension before...and just reading on the Dorbitz website...I assumed this would be a straight bolt in deal. Well, that's not really the case. When I went to put the rear bags in last weekend, I noticed the short section of pipe doesn't really fit over the nubbin on the lower arm very well. There's all kinds of slop in it, which means I'd be relying on the bolt to keep the bag centered. I wasn't happy with that setup.





After asking a question here on the forum, I opted to add a piece of 1.25" .120 wall DOM to the lower mount. This made it fit so much better. Unfortunately, it meant I had to start over with the powder coating.



Here it is after I blasted it.



Just out of the oven.



And done.



I'm planning to install the rear bags tonight and run the air lines.


----------



## leftovers (Dec 29, 2010)

Did some more work tonight. 



New Bilstein shocks...and one new bumpstop. The original one crumbled to pieces when I took the shock off. 



Now that I have the right tool for cutting air lines, I went through and redid all of them. I was using side cutters for wiring. I though I was making clean cuts, but I now see that I was wrong. 



More progress tomorrow.


----------



## leftovers (Dec 29, 2010)

Here is the revised base plate. 





I hammered a washer into the opening above the top mount. I really didn't want to cut it out. I then used a magnet to fish the washer over the stud of the Dorbitz setup. I was also able to fish the nut onto it...and I used a swivel to get it all tightened down. I was dreading that part of the job, but it really wasn't bad. I was even able to reuse the stock plug.





And here it is all mounted up. I thought I took another finished picture with the shocks, but I guess not.


----------



## leftovers (Dec 29, 2010)

I spent several hours the other night trying to figure out where I'm going to mount these ride height sensors. It felt very unproductive. I'm sure even the e-level people have problems with this, too. It's complicated trying to work around wheel clearance and determine the full range of the suspension travel. My friend and I gave up looking at the friend and decided to tackle the rear, thinking it would be easier. Well, it wasn't.

I did finally come up with this awesome cardboard template though.



I then used that to draw it up in Pro/E.



The same guy that is helping me with the programming also has a plasma table, which is fantastic for this sort of stuff. From computer to reality:


----------



## jonpwn (Aug 13, 2010)

Awesome work and fabrication! Is there any chance your friend is willing to make the source code for the management open source on github or something? (If you're unsure what that means just ask him, I'm pretty sure he would understand)

:thumbup:


----------



## mk4_austin (Mar 8, 2013)

Sweet man!! Glad this worked!


----------



## leftovers (Dec 29, 2010)

jonpwn said:


> Awesome work and fabrication! Is there any chance your friend is willing to make the source code for the management open source on github or something? (If you're unsure what that means just ask him, I'm pretty sure he would understand)
> 
> :thumbup:


I'm sure he would. We just need to get it dialed in first. Hit me up after you see some updates where the Arduino is actually parked in the glove box.


----------



## leftovers (Dec 29, 2010)

A spent a couple of hours putting in the rear ride height sensors last night. I welded a small drilled/tapped bracket to the top of the coil spring tower. This gave me a place to mount the sensor bracket. Since I made the bracket so the sensor can be clocked, I needed a way to easily unbolt it and make adjustments. That's why I didn't just weld the mounting bracket itself straight to the tower.

I cycled the suspension a few times to verify I wasn't exceeding the range of the sensor. I was concerned about that, but it looks like it will be fine. Now I just need to pull those brackets off and powder coat them before final installation.

Up next...figuring out the fronts.


----------



## leftovers (Dec 29, 2010)

Progress: One step forward...two steps back.

I had a heck of a time getting the upper control arms out of the passenger knuckle. I finally got it, but when I put it back together, it cracked. Bummer. 



I picked up a used one on ebay for $85 shipped, which wasn't bad. It's in good condition. I don't know what they used to clean it, but it looks fantastic. 

I picked up some Moog adjustable upper arms a couple of weeks ago and started installing those at the same time.



Here's the notch I made to allow the arms to travel up far enough. It only took me a few minutes with an angle grinder. 



I opted not to reinstall the 90k mile wheel bearing. So, now I have wait for the new ones to show up before I can make some more progress.


----------



## Hombre3000 (Jan 12, 2010)

I would recommend smoothing and rounding the edges of the knuckle cutout to avoid a stress concentration. Otherwise - carry on!


----------



## leftovers (Dec 29, 2010)

Hombre3000 said:


> I would recommend smoothing and rounding the edges of the knuckle cutout to avoid a stress concentration. Otherwise - carry on!


Some other people have made a similar recommendation. Fortunately, I haven't reinstalled it. I'll dial it in a little better and post new pictures.


----------



## leftovers (Dec 29, 2010)

This weekend I worked on installing the electrical components onto the display that will go into the glove box. Getting those tiny fasteners and stand offs dialed in was more work than I thought it would be. 

I can't remember if I mentioned this or not, but thanks to some encouragement from drumnjuny, I decided to add Bluetooth to this project. If we can get it all figured out, it should work very similar to the I-level system. I'm pretty excited about that. Here you can see the Bluetooth shield added to the top of the Arduino Mega.



Here's the final setup with the screen, relay board, and Ardunio mounted. 



Test fitting the connection cable to make sure I still have room.



I also redid the cutout for the adjustable control arms. I rounded everything and smoothed it out with a flap disc.



The adjustable control arms are now in. I also reinstalled everything...including new wheel bearings.



Yesterday I spent some time knocking out this awesome cardboard template for mounting the passenger front ride height sensor. Unfortunately, I will not be able to use the same mount on the driver side. I'm limited in what I can install over there, because I have factory bi-xenons and the OEM ride height sensor is in my way. I'll get it figured out, but it is going to take some more time.


----------



## Hombre3000 (Jan 12, 2010)

I've run into some of the same issues with the standoffs too - it seems simple but it's not always easy getting those things screwed down.


----------



## leftovers (Dec 29, 2010)

Small update here. My buddy finished up the sensor harness over the weekend, which was basically the last harness that needed to go in.

Here it is with all the branches in it, based on the measurements I gave him:



Loomed and ready to go in:



This isn't a very good picture, but it does show the harness attached to the rear ride height sensor. We spent a couple of hours installing it last night...routing it to each corner of the car, running it through the firewall, and putting the right connectors on it. 



And here's that new bracket I designed to mount the passenger front sensor....powder coated and installed:



I have the last ride height sensor mount designed. The plan is to cut it this week and get it installed soon.


----------



## goofydug (Feb 5, 2004)

Great attention to detail, fabrication, and electrical work :thumbup:


----------



## Aaron994 (May 18, 2009)

Is there a reason you decided to go with a separate relay board and use actual relays rather than transistors? You could even put it all on a protoboard and use stacking headers to minimize the footprint.


----------



## leftovers (Dec 29, 2010)

Aaron994 said:


> Is there a reason you decided to go with a separate relay board and use actual relays rather than transistors? You could even put it all on a protoboard and use stacking headers to minimize the footprint.


Not worried about this size for a one off project, as long as it fits inside the glove box. 

Relay board is a time and money saver. $7 and no additional time to make it work. Whereas Transistors you need a BJT to drive a PNP FET and 2 resistors. Then multiply that by 8 for each solenoid. Also, we can’t stack anything more on what we have. It would be too tall.


----------



## Aaron994 (May 18, 2009)

leftovers said:


> Not worried about this size for a one off project, as long as it fits inside the glove box.
> 
> Relay board is a time and money saver. $7 and no additional time to make it work. Whereas Transistors you need a BJT to drive a PNP FET and 2 resistors. Then multiply that by 8 for each solenoid. Also, we can’t stack anything more on what we have. It would be too tall.


Well I'm not quite sure you would need all that to make a transistor work. All you would need is a NPN transistor that handles 12v @ 1amp and the correct resistor at the base to control the load connected to the I/O pin on the Arduino.


----------



## leftovers (Dec 29, 2010)

Aaron994 said:


> Well I'm not quite sure you would need all that to make a transistor work. All you would need is a NPN transistor that handles 12v @ 1amp and the correct resistor at the base to control the load connected to the I/O pin on the Arduino.


The reason you need the double transistor per solenoid is that we are using the accuair manifold, which has all the grounds tied together and is grounded to its case. So, we can only control the solenoids by sending positive 12v to each one. In order to do that via a logic level of 5 volts, you should uses an npn bjt to pull the Base of the PNP FET down to send 12v to the solenoid. 

If I had individual wires for the solenoids (power and ground), I could have done what you are suggesting. Tie all the positives together. Then control them through a NPN FET via the ground signals.


----------



## Aaron994 (May 18, 2009)

Regardless of your method I am curious to see your outcome :thumbup:


----------



## leftovers (Dec 29, 2010)

Sorry for the lack of updates. The guy that has been helping me with this project needed to prep his rockcrawler for a week long trip to CO. I spent a solid three weeks helping him out. Now that he's back, we are tackling this project again. 

I've been driving it around with a set of manual switches to control the ride height. I could have shown off the car with it aired out, but I'd rather do that once the computer is in and I can post a video of how it all functions. Last night we uploaded the program and went through a couple of hours of testing and tweaking it. I should be able to do a final install of my glove box over the weekend and post a video shortly thereafter.


----------



## leftovers (Dec 29, 2010)




----------



## leftovers (Dec 29, 2010)




----------



## Hombre3000 (Jan 12, 2010)

Really awesome stuff, I love to see this working! Just a few suggestions (although I'm sure you have more planned) - you could do a little bit of filtering/average the pressure values if you didn't want the screen to be so jumpy. I would also leave the USB port accessible so that you don't have to take it apart to update the code. You can get short (4") USB cables online - might be helpful. How did you do those buttons? They look great!


----------



## leftovers (Dec 29, 2010)

Hombre3000 said:


> Really awesome stuff, I love to see this working! Just a few suggestions (although I'm sure you have more planned) - you could do a little bit of filtering/average the pressure values if you didn't want the screen to be so jumpy. I would also leave the USB port accessible so that you don't have to take it apart to update the code. You can get short (4") USB cables online - might be helpful. How did you do those buttons? They look great!


Thanks for the suggestions. 

I don't know that we'll continue to display the sensor data or not. It's helpful for now, but once it is completely dialed in, we could probably change it to say "target complete" or something similar.

I now have a ~3 ft USB cord that is running out the back of the glove box in the harness with the rest of the wires. In that last picture, I hadn't installed the glove box yet. We just put it there temporarily to work on the program. It's all installed and good to go now though.

Here's a link to the keypad I used. I had a friend at work design and print the new label for me with the symbols:
http://www.newark.com/apem/ac3559/switches-keypad-1-x-4-100ma-30v/dp/51R6328


----------



## Hombre3000 (Jan 12, 2010)

Very cool! Love seeing it work with the Bluetooth too - are you going to keep it as the text interface or will you build a GUI or something for it?


----------



## leftovers (Dec 29, 2010)

Hombre3000 said:


> Very cool! Love seeing it work with the Bluetooth too - are you going to keep it as the text interface or will you build a GUI or something for it?


I've got a guy that is working with us right now to possibly build an iphone app for it. Ideally, it would be a custom version of the ilevel system. Some of that will require additional programming though.


----------



## carsluTT (Dec 31, 2004)

really dig the fab work on this setup and the controller is awesome!


----------



## leftovers (Dec 29, 2010)

Thanks, carsluTT.

I finally had a chance to snap a couple of pictures today when the car was actually clean.


----------



## leftovers (Dec 29, 2010)

Just a quick update on the project...

I switched out the Bluetooth shield for a new one. The Annikken Andee integrates much better with my iphone. You can customize your screens and functions without too much effort. This new setup allows me to adjust my ride heights without having to redo the program and upload it with a laptop.

Oh...I've also added a tank pressure sensor to the mix. I'll now be able to see that information on my phone instead of walking back to the trunk.

Here are some screen shots of the app. I haven't installed it in the car yet, so the tank pressure isn't accurate.

This is the front page when you first open it:



This is the screen that will be used to adjust the different ride heights presets:



And if I decide I want to mess with any of it manually, there is this screen:



Here is a more recent picture of the car:


----------



## vwgliin05 (Aug 1, 2006)

Wow man, fantastic work!!


----------



## crakarjax (Aug 24, 2015)

This is *exactly* what I was hoping to accomplish for my car. Any word on open-sourcing or sharing the arduino code? It sure would save me a bunch of time and I'd be happy to throw it up on github with any improvements that I make to it.

Also, did you choose the cadillac sensors vs bmw or audi sensors because of the simpler wiring?


----------



## leftovers (Dec 29, 2010)

crakarjax said:


> This is *exactly* what I was hoping to accomplish for my car. Any word on open-sourcing or sharing the arduino code? It sure would save me a bunch of time and I'd be happy to throw it up on github with any improvements that I make to it.
> 
> Also, did you choose the cadillac sensors vs bmw or audi sensors because of the simpler wiring?


I'll send you a PM about the code.

The sensors were what I needed, they were inexpensive, and they were easy to get through Amazon. That's why I chose them.


----------



## 12_CC (Aug 28, 2015)

leftovers said:


> I'll send you a PM about the code.
> 
> The sensors were what I needed, they were inexpensive, and they were easy to get through Amazon. That's why I chose them.



Can you send me a PM about the code also. I feel the same way as you did when you started this project.


----------



## 12_CC (Aug 28, 2015)

08-25-2015 03:47 PM #54
Quote Originally Posted by crakarjax View Post
This is *exactly* what I was hoping to accomplish for my car. Any word on open-sourcing or sharing the arduino code? It sure would save me a bunch of time and I'd be happy to throw it up on github with any improvements that I make to it.

Also, did you choose the cadillac sensors vs bmw or audi sensors because of the simpler wiring?
I'll send you a PM about the code.

The sensors were what I needed, they were inexpensive, and they were easy to get through Amazon. That's why I chose them.


*Can u send me a PM about the code also. I feel the same way you did when you started the project.*


----------



## leftovers (Dec 29, 2010)

So, the guy that helped me with the code has been unwilling to share it up to this point. He just has too many hours into the project and he's not sure what he might be doing in the future. He said he would be happy to answer any specific questions about the program once you get started yourself though. We've already done that with a few people. 

If you want any other information about where I bought the connectors, sensors, etc....just let me know. I have all the part numbers and links for that stuff.


----------



## 12_CC (Aug 28, 2015)

Sure, if you can pm me the info that you have and I'll get started. Thanks


----------

