Arduino interface project

Audio, Electronics and Lighting questions and answers

Moderators: timk, Stu, zombie, Andrew, -alex, miata

User avatar
droo
Fast Driver
Posts: 286
Joined: Fri Apr 18, 2008 10:32 am
Vehicle: NA8
Location: The People's Republic of Bendigo

Arduino interface project

Postby droo » Mon Nov 19, 2012 12:39 pm

Howdy all
The past few weeks i've been busy learning more code and electronics to play with on my roadster.
The main motivation was randomly finding some large RGB 20x4 character LCDs off ebay - i dont know what made me look for it, but I found it, and havent seen any since. Its not common to find many LCDs with RGB backlights, so I thought about what projects i could make...

One of these projects is my "Sensor metrics" display.

This is something i've wanted to do for a VERY long time (20+ years) but never really had the means or access to knowledge to do it. Enter the Arduino microcontroller and everything changes! I started playing with these about 2 years ago but my programming really sucked.. I was only using what was demo'ed on various websites, its taken me a while to find out how to go a bit deeper into it.

The programming heart of what i've done here involves having a menu structure made, and without that, the functionality of everything is very limited and if functionality *is* there, the code becomes hideously messy. Once i worked out how Arduino tabs worked and linking to them, i was able to make progress - neat code, neat menus, everything sectioned off nicely in the programming.

Then there was the matter of making pushbutton switches that didnt "bounce" and result in screwing up button presses.

Driving the LCD and interfacing the switches is straight forward, very few components.
Yep there are a lot of jumper cables but most are for linking the LCD and it's backlights. When you're building the bits in sections, honestly it does all make sense and isnt complicated despite it looking a little overwhelming in this pic...
Image

Image



a video of the menu structure demo is here. (mp4 video)


The best bit about this is the code is easily able to extend beyond 4 options, and i can also nest in submenus where they're needed.
I also wanted to control various lighting and other random bits from a simple three button interface, (up, select, down).

A goal is to keep the final menu structure ergonomic with no unnecessary complication.
As this is still in development, i'm likely going to move, merge or remove some options depending on their importance.

I wanted to get readings of various temperatures around the vehicle, as well as read the AFM and TPS
signals to see what i can learn off them as i get nerdy curious about various things every now and then..


a video of the AFM/TPS demo is here. (mp4 video)


The issue there is i needed to isolate the TPS/AFM signals from the arduino so the arduino didn't effect the voltages required for the ECU! Directly hooking them in did work but also made the car run rich, and also had the unfortunate impact of killing the engine when the arduino was turned off/unplugged. Not good!!


That test didnt last very long before i realised i needed something to buffer it. Also, the TPS/AFM signals would occasionally overload the arduino, apparantly delivering a bit more then 5v from time to time. A little more research and i used a few opamps configured with slightly negative gain, so the readings from the TPS/AFM fell between 0.5 and 4.5 volts (well within the range of the arduino's analogue inputs).
I know the tps/afm readings are meant to be within approximately that range anyway but i was having spurious signals coming through - nothing that effected engine operation, just the arduino..

I then had issues of random spikes along the TPS line and a big spike from the AFM when the vehicle ignition went on. A little more research and i made a 1hz RC filter which took care of all of that. The filters roll off meant that sudden throttle changes would still show but the spikes were gone. And you cant really go from 0 to WOT 10 times in a second short of being electrocuted or experiencing epilepsy.

Clearly the ECU already has such inbuilt filtering and isn't really surprising now that i think about it, with an engine bay being exposed to so much electrical noise from startermotors, alternators, coilpacks etc..


My test circuitry is now looking a little messy but it's working and its solid and I was after a result so i didnt care what it looked like.

This signal filtering applies also to the fuel tank and lambda sensors too. The Fuel tank signal needs averaging over a 30 second period as the fuel sender responds instantly to fuel sloshing about in the tank where as the fuel needle on the dash cluster is heavily filtered and takes about a minute to do a full sweep from empty to full. It's also interfaced via an inverting op-amp with negative gain also. It doesn't read correctly until the car is running as the voltages change by about a volt - enough to screw up readings.

The lambda sensor, will be bar graphed and will have a 0.5- 1 second rms average applied for a digital readout.

With being super anal about mapping my fuel economy the past few months, I've been mapping out the fuel needle versus my mileage and working out a pretty accurate represenatation of litres in the tank versus the needle position. Knowing this allows me to make an older style bmw-esque fuel display.


a video of the Fuel tank demo is here. (mp4 video)


With the RGB backlight, i can change colours, display stuff to screen, sound alarms etc when certain conditions are met. This demo was just starting out what i wanted to do with it and have a little fun.

A little further thought - knowing the litres left, and getting an average reading of afm/tps values means i can then work out a projected mileage based on current driving style.. This is partially reflected later on.


In doing the coding, i learnt to play with loops to make audio from the PWM output.
I made this super annoying TCAS alert sound (mp4 video)- not sure what i'd use it for but the code is only a few lines..


Getting this all together was the next thing, building a veroboard to mount it on was straight forward but putting it in the car was a bit messy, but was necessary to get real world usage and operations under a range of conditions.
Image

Fortunately there were some fairly hot days and leaving my car at work in the sun yielded some 50 degree dashboard temperatures. The LCD liquid didnt deform and was still easily legible in that heat. The arduino which was fully exposed to that heat also functioned flawlessly.

All of the temperature sensors in engine bay along with the TPS/AFM sensor lines are using shielded cables but as the temp sensors run on the I2C serial bus, their signals are more susceptible to electrical noise, specifically coming from my COPS. Im going to investigate using Cat6 shielded twisted pair. (or maybe super duper shielded cat7 network cable.


Earlier in the week, my 3 gauge lid arrived, and i'd began trimming it to suite the dashboard.
I'm really honestly hopeless at this sort of work and lack the skills to do it properly but it didnt stop me from giving it a go.

Image
I didnt think to photograph the original piece, so heres a bad photoshop of what i'd removed..
the rear of the lid was designed to wrap over a lower part of a dashboard, as the NA dash is raised at the rear, i needed to remove a lot of plastic.

Image
this is looking at the top of the lid


Image
This is sort of what the lid looked like when i bought it.. I've tried to make it look like what it was before I trimmed it..

Image
this is it prepped to hold the LCD.

Image
and a slice of perspex to fit over the top

Image
Heres a rough cut of how i need to shape the perspex to fit in.


Image
And the perspex trimmed to fit, heres the LCD viewable area mapped out on the perspex. I'll use this as a mask to paint the surrounding area black. The perspex protector sheet is very uniformly stuck on the perspex so it makes an excellent mask (that was the plan/thought!)


Image
The LCD panel with it's screen protector and desoldered from my test rig setup.

Image
Peeling off the rear cut out for the lcd masking.


Image
spraying the perspex with a light coat to start with.

Image
and after being sun dried with a heavy coat.

I've had to bevel the rear side edges of the perspex to better fit the gauge lid.

Image
Using a scalpel to peel back the mask

Image
still slowly peeling to not upset the paint edge.

Image
now peeling off the front. No spray paint entered the edges here, the perspex protector works a treat, just as i hoped!

Image
oooh perdy!
by this point i was getting a little excited!

Image
having only seen the LCD with its now well worn protector on, it was amazing to see the screen so clean and pristine behind it!

Image
now getting more excited.. a silicon carbide moment..

Image
i cant hold it anymore..

Image
crisis...


at this point after i cleaned up, i soldered on a ribbon cable to the required LCD pins, tested it out on the arduino, then siliconed the display carefully to the perspex, waited to dry, then siliconed the display panel to the gauge lid. The silicon is there to make the surfaces dust proof.
Image
There is one area unsealed between the LCD and perspex, hopefully moisture wont build up and dust one get in. As it's my first time doing this, i wont know until 12 months down the track when this setup has experienced cold weather.

Image
i left this in the sun for a good 6 hours to tack dry before temporarily siliconing it on the dashboard...

At this point, it is still only a test fit, as i have ribbon cabling all over the place but its much safer then having the exposed circuitry on the dash.
The circuitry is now in a small cardboard box in the glovebox, much more accessible and with all the cabling joining it via connectors.

This starts out with a little homage/pisstake of an Aston Martin's V8/V12 Vantage dashboard..
(http://www.youtube.com/watch?v=B7ORWhWEcHc)


(in this video the gauge lid is siliconed in but is also supported by tape to stop it sliding while it dries! - it has since been removed and is less ugly/moar neater!)

When it's time to be made permanent, i'll be drilling the cabling directly through the dashboard to keep it neat and out of sight, adding an antimoisture pack inside the gauge lid and siliconing it all tight.

The best part about this is the extras that arduino can talk with, realtime clocks, GPS, datalogging via SD cards, RFID comms, load sensors, anything off an I2C serial bus. So much awesome but best of all, so much fun to play with. What is seen here is setting a basis for more, and i'll make an effort to update this thread when i add new bits to it.

Also in the works is a switch array which i'll be fitting in a surprisingly nice ergonomic position on the dashboard exploiting an 'issue' many NA owners suffer! This array will be replacing my 3 pushbuttons stuck on beside the gearstick. Again, as this is a physical item, i'm taking my sweet time to make it as nice as possible, as again, i'm really crap at building neat things and i want this one looking decent.

koop21
Fast Driver
Posts: 296
Joined: Tue Aug 23, 2011 12:31 am
Vehicle: NA6
Location: Sydney

Re: Arduino interface project

Postby koop21 » Mon Nov 19, 2012 1:26 pm

looks absolutely amazing! Excellent work :mrgreen:

User avatar
lee
Racing Driver
Posts: 597
Joined: Tue Mar 02, 2010 8:28 am
Vehicle: NA6
Location: Me!bourne

Re: Arduino interface project

Postby lee » Mon Nov 19, 2012 1:49 pm

You are the IC god.

I've got to talk to you about some projects I want to turn into a reality, namely making all this interface with an iOS/WinMobile/Android tablet
'91 Roadster

User avatar
Jeo
Speed Racer
Posts: 3648
Joined: Thu Jun 26, 2008 9:33 am
Vehicle: NB8B
Location: Canberra

Re: Arduino interface project

Postby Jeo » Mon Nov 19, 2012 2:09 pm

Nominated for post of the year.

Definitely want more details. This is amazing.

User avatar
PaulF
Racing Driver
Posts: 1807
Joined: Fri Jan 28, 2011 5:55 pm
Vehicle: NA6
Location: Newcastle, NSW

Re: Arduino interface project

Postby PaulF » Mon Nov 19, 2012 3:07 pm

Nice work droo! I like the way you've mounted the display. Looking forward to seeing what you do with the buttons.

I've played with Arduino a little, it seems to be a very powerful and versatile platform.

User avatar
droo
Fast Driver
Posts: 286
Joined: Fri Apr 18, 2008 10:32 am
Vehicle: NA8
Location: The People's Republic of Bendigo

Re: Arduino interface project

Postby droo » Tue Nov 20, 2012 10:30 pm

Thanks all! : )

Lee, i'd like to help but i haven't the foggiest how to get smart devices to talk to arduino (aside from serial connection/ethernet/html) most of the issue i'd imagine is having a coms app on the smart device to talk to it - that pretty much rules out iOS. I can help out with your one touch windows project tho! : )

I fixed a little issue with my Airflow menu code, the percentage value on the AFM reading wasnt showing the same detail as the AFM bargraph. (shown in the demo videos earlier)

Attached here is some footage (daylight roof on) of the display in action. (Weird/funky thing happening with sound)
*clicky* http://www.praetorianindy.com.au/roadster/arduino/IMG_1923.mp4


So far with this instrumentation on, i've learnt so far:
AFM flow is very similar to what i'd imagine engine vacuum would read.
I'm now doubting the need to install a map sensor as a result, and can see my driving style changing to keep as minimal airflow as possible (to maintain fuel economy)
At the same time, its fun to see the bar graphs dance and because of that, to hell with fuel economy!

With the temp readings:
I have a ARC chamber, which doesnt do jack for top end but i have noted improved fuel economy with it on cautious driving on the highway.
The ARC is connected to a modified AFM which has a large sponge filter fed into the firewall/cowling thing (where the windscreen wipers are) - i've forgotten the terminology for that..
I have a temp sensor located infront of the intake to the filter there as well as a temp sensor infront of the radiator just behind the air dam grill.

With the temp sensors, the front air dam of the car is surprisingly cooler then the cowling temperature
On a cold morning, the temp variance is between 2-3 degrees. It becomes a 5 degree difference after the car has warmed up.
On a hot day, the cowling becomes consistently 8-12 degrees hotter.

When the car is parked at work (in the sun) the bonnet/cowling heats up to 50 degrees but soon cools to 35 degrees when driving at 60kph for a few minutes. Still, the cowling temp is consistently hotter then front air dam temps. I'd expect on highway driving for this to drop down to a few degrees of the air dam.

The thing that surprises me, with the height the front air damn is off the road, i expected ambient road heat to be entering the air dam - generally much hotter then head height air. I noticed this with my previous hot hatch.


I'm curious to install a temp sensor in the air path/inlet before the throttle, as i'd imagine a fair amount of heat soak would be occurring on the thin aluminium of the arc chamber - especially when traveling at slow speeds.

A problem with my car being black (aside from trying to keep clean all the time) is it heats up rather quickly due to it's blackness!
Resulting from this, i'm going to try to insulate the cowling area somehow, and also look into options for venting the bonnet more effectively to release heat.
Breathing in 50 degree air isn't going to do your engine many favours, especially when giving it stick. Less power, more heat stress!



On a purely nerdy note of curiousityness, and total unnecessarinessisms:
With the temp is below 24 degrees, travelling roofless above 80kph feels a little chilly despite it being a warm day..
Also the area in the footwell where your feet and shins are, is 4 degrees hotter then the main cabin air - roof up or roof down! Even tho when you put your hand in the area, you dont feel that heat difference!

Kikuchi
Fast Driver
Posts: 343
Joined: Tue Sep 20, 2011 9:42 pm
Vehicle: ND - 2
Location: Adelaide

Re: Arduino interface project

Postby Kikuchi » Thu Nov 29, 2012 1:53 am

What a great project!
I recently had some exposure to ICs at my work experience place (the place was crap and i ended up leaving before i finished work experience, long story), and was actually meant to interface one of their IC's to wifi, which lead me to this blogger.

http://theiopage.blogspot.com.au/2011/1 ... duino.html

Hope that helps IF you end up wanting to make this project wifi.

I believe arduino actually has a wifi module called the wifi shield, but it is costly.

At the end of the day, anyone who has access to the IP address of the arduino can access it (you can set passwords however), and all you need is a browser, so phones, tablets, pdas, laptops, computers, granted they are close enough, will be able to access the info from the arduino.

Spec sheet on the MRF24...A says it's 1Mbps transfer rate so that should be more than plenty to transfer some numbers.

User avatar
droo
Fast Driver
Posts: 286
Joined: Fri Apr 18, 2008 10:32 am
Vehicle: NA8
Location: The People's Republic of Bendigo

Re: Arduino interface project

Postby droo » Thu Nov 29, 2012 10:47 am

Great find! That is pretty good and i want to look into that more! :D

User avatar
taminga16
Speed Racer
Posts: 3617
Joined: Thu Aug 06, 2009 12:22 am
Vehicle: NC
Location: Central Victoria

Re: Arduino interface project

Postby taminga16 » Thu Nov 29, 2012 7:13 pm

Droo said,
Earlier in the week, my 3 gauge lid arrived, and i'd began trimming it to suite the dashboard.
I'm really honestly hopeless at this sort of work and lack the skills to do it properly but it didnt stop me from giving it a go.

Hi Droo,
A 1mm thick cutting disc in a 4" grinder is a very efficient way to cut plastics, very fast and as such cool with a low melt effect.
Greg.
When you turn your car on, does it return the favour?

User avatar
JayMo
Fast Driver
Posts: 213
Joined: Fri Sep 14, 2012 1:24 pm
Vehicle: NC
Location: Lower Hornsby Shire

Re: Arduino interface project

Postby JayMo » Sat Dec 01, 2012 10:53 am

Fwoar.... this is a bucket of awesome on a stick...

I am too dumb to do that sort of stuff (mech eng)... but I found a dude in the states that did something like this for Forester XT Turbos, then sold cookie cutter kits around the planet to peeps like me with a pre programmed IC ...

something to think about... do you want to keep your awesome to yourself... or spread it round 8)
NC1, Black & Tan, Cow & Canvas
Mazda3 SP25GT, Soul Red Metallic

User avatar
droo
Fast Driver
Posts: 286
Joined: Fri Apr 18, 2008 10:32 am
Vehicle: NA8
Location: The People's Republic of Bendigo

Re: Arduino interface project

Postby droo » Sat Dec 01, 2012 1:33 pm

i'm adding moar menus to it and i dont reckon i'd have this finished this side of january but.
So far, with one of my hardware additions, the demo codes for it didnt actually work properly so i've spend the past few days trying to nut out what is wrong.. progress as of midnight last night on getting the correct readings. I can complete two menu options as a result. Sorry for sounding obtuse but i want to keep the additionals a little surprise for later.

As for sharing the code, happy to (just need to finalise and neaten it all up with loads of rem statements so people can make sense of it).

Almost all the code on this has been sourced and tweaked from arduino forums and youtubes etc..

User avatar
lee
Racing Driver
Posts: 597
Joined: Tue Mar 02, 2010 8:28 am
Vehicle: NA6
Location: Me!bourne

Re: Arduino interface project

Postby lee » Mon Dec 03, 2012 8:22 am

I recently picked up an iPad mini, and it looks like it'll fit perfectly in the NA6 head unit space! Now I just have to figure out how to make a mounting bracket for it.

I have a feeling a tablet like the Nexus 7 may be a little too short in portrait mode to fully occupy the space. Does anyone have a Nexus 7 or similar to see what the fit is like?
'91 Roadster

User avatar
droo
Fast Driver
Posts: 286
Joined: Fri Apr 18, 2008 10:32 am
Vehicle: NA8
Location: The People's Republic of Bendigo

Re: Arduino interface project

Postby droo » Mon Dec 03, 2012 9:59 am

MCM did an iPad install on a subaru dashboard. Mostly by pure chance as the suby had a nearly perfect sized dash for it.

an iPad in there would be sweet!

Kikuchi
Fast Driver
Posts: 343
Joined: Tue Sep 20, 2011 9:42 pm
Vehicle: ND - 2
Location: Adelaide

Re: Arduino interface project

Postby Kikuchi » Sun Dec 09, 2012 1:23 am

There's a guy on ozmazdaclub who recently put an ipad mini into his maz3. looks great.
Image

User avatar
droo
Fast Driver
Posts: 286
Joined: Fri Apr 18, 2008 10:32 am
Vehicle: NA8
Location: The People's Republic of Bendigo

Re: Arduino interface project

Postby droo » Mon Dec 10, 2012 11:50 am

phwoar that looks sensational!


Return to “MX5 Audio, Electronics & Lighting”

Who is online

Users browsing this forum: No registered users and 252 guests