Jump to content

Arduino + Raspberry Pi = 510 Telemetry System


Recommended Posts

Between upgrading all of my brakes (discs all around), fabbed up new intercooler plumbing, and finally dumping the R33 skyline gauge cluster, I decided that the next major project to tackle would be the big electronic project: the Arduino/Raspberry Pi telemetry and custom gauge cluster system. It doesn't sound like much, since I haven't seen many overly complex Arduino or rPi builds, but this has been a pretty significant undertaking. 

The basic premise of this project is this: 

Use the Arduino to pull data from no less than 16 sources. On a standard Arduino UNO, this is not possible; there are only 6 analog inputs. However, using the magic of multiplexing, there's a way to quickly poll multiple sources over a single analog input; with two 8-channel multiplexers, we get that 16, plus the remaining 4 on the board itself. 

Once the data is pulled (either direct 0-5v values or values drawn from a voltage divider circuit), it is neatly organized into a (name:value) pair, and sent as plain-text serial data via USB into the Raspberry Pi. On the rPI, I'm using Perl/Tk to pull in that serial data and display it graphically on a custom instrument cluster as well as saving the data for future analysis. 

And then all of that is displayed on a 9x5" LCD screen. 

Easy, right? Well, then there's the whole project of packaging it all up. So, that's where the 3d printer comes in. I assembled an ANET-A8 3d printer, learned how to use Blender, and printed out some bits to bring it all together. 

The first thing I needed to print was an enclosure for the LCD driver. It came as a PCB board attached to the LCD screen with a power supply line and a ribbon cable; boxing it up meant printing a custom enclosure that I found and modified on thingiverse.com

 

 

enclosure_01.jpg 
The model online didn't include a lid, so I used Blender + my 3d printer to build one. 

enclosure_02.jpg 
Fits like a glove. 

enclosure_03.jpg 
Perfect! 

The next thing I needed to do was to figure out a way to mount the LCD. It's going to sit in the Datsun 510, so I can't just have it sitting on the dash. I printed these corner brackets, and they seem to work just fine. It's not beautiful, but it is very functional. 

LCD_01.jpg 
Again, using blender to design it. I've used the bracket in several of my 3d prints, as it's perfect for small screws. 

LCD_02.jpg 
Fits the LCD screen. It's a little loose, but maybe I'm compensating for heat distortion? 

LCD_03.jpg 
Test fit. 

LCD_04.jpg 
And screwed down to a piece of plywood. 

The next project was to build a custom Arduino. Because I have a need to take things apart and put them back together, I wanted to do one of those custom "minimalist Arduino" projects where I just use the atmega chip, a few resistors, a crystal, and some capacitors, and voila - homemade Arduino. 

arduino_01.jpg 
Here's a standard arduino UNO. It's the one I used to test all of my code. 

arduino_02.jpg 
And here's the Arduino connected to the two 5041 multiplexers. 

arduino_03.jpg 
Perf board with the chip plugs. Always use these things; soldering down (and then trying to remove) a chip sucks if you have to re-orient later. 

arduino_04.jpg 
Here is my minimalist Arduino board, together with the two multiplexers and a USB interface board. 

5041.jpg 
In case you're nerdy, here's the multiplexer pintout. 

atmega.jpg 
And here's the Arduino atmega chip pinout. 

With 16 inputs, I didn't want a bunch of loose wires everywhere, so I decided to use some JST clips to organize my wiring. I couldn't find any 16-terminal JST plugs, so figured having 4 sets of 4 would work just fine. 

JST_01.jpg 
This is a 4-wire JST clip set. 

JST_02.jpg 
Not satisfied with having the clips dangling about, I did some test printing and built a holster for the clips. 

JST_03.jpg 
Perfect fit! However, this holster was just a proof-of-concept. I wanted to make sure they would fit properly so I can build an Arduino housing model that would incorporate the design. 

arduinoHousing_01.jpg 
And here's a shot of the prototype of the Arduino housing. You can see the brackets that I've reused from the LCD clips, as well as the JST holster. 

arduinoHousing_02.jpg 
And the arduino+multiplexer perf board fits perfectly. 

arduinoHousing_03.jpg 
And here's a tall lid for the enclosure. 

At the time of this writing, I'm still trying to figure out how to pull it all together neatly. Right now, I've just thrown it all onto a piece of plywood. It works, but this is not likely the final product. 

rPI_01.jpg 
On the left is the Raspberry Pi, connected by HDMI to the LCD driver housing in the center. On the right is another project - it's going to be the power supply for the whole thing. The LCD screen requires a 12v power supply - no problem. The Datsun 510, like most cars, has a 12v battery. I'll need to include a voltage regulator circuit to address voltage spikes and reversals, since that'll destroy my electronics. The Arduino and the rPi, on the other hand, only need 5 volts, so I have a switching converter to create a 5v power supply. This is particularly useful because several of my sensors need a 5v source as well: the MAP sensor (boost sensor), for example. The Arduino also accepts 0 to 5 volt inputs, so building voltage divider circuits from here is also important. 

rPI_02.jpg 
Here, I have the Arduino hooked up and ready to go. 

rPI_03.jpg 
The Raspberry Pi is loading... 

rPI_04.jpg 
And we're in X-Windows on the Raspberry Pi. 

rPI_05.jpg 
And here's the Arduino IDE serial monitor, and it's correctly reading the values from the rPi and multiplexers. There's no sensor data at the moment, so all the inputs read high. They would read low if they were grounded, and they would read correctly if they were connected to sensors properly. 

rPI_06.jpg 
And lastly, here's the custom gauge cluster I coded. The tachometer is from an image of a Nissan Skyline tach; the Fuel Level, Oil Pressure, and Water Temp gauges were just cobbled together from some generic images online. I drew up the Boost gauge, and it may change to fit the scheme better. Once I have some data coming in from my accelerometer, I'll have the "g-force meter" working properly as well. This is all done within Perl/Tk. 

Stay tuned. More to come. 

  • Like 9
Link to comment
  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

when I wire chips(wire wrap gun) I put the connecting wires on the other side so ones does not see them

 

I gave that some thought. However, I've got another 20 wires that I have to solder onto the board for the JST clips, and I'm going to put those under the board. That way, I'm keeping my circuitry design and my sensor wires separate from each other.

  • Like 1
Link to comment

Pretty cool. I'm just barely starting to teach myself arduino. Project number one is an rpm switch to control my buddies intake runner flaps and secondary cooling fan.

 

Project two will be a radio controller for a usb/aux/bluetooth sound board and a custom designed speaker output board made from parts hacked out of an 03 Mazda radio. I'm going to stuff all that into a stock Datsun radio body but switching the knobs to rotary encoders to interact with the arduino.

 

So I'm watching this.

  • Like 2
Link to comment

I'm going to have to Google quite a few terms in order to fully understand. But, I'm worried that once i do, i will want to jump down the rabbit hole and my to-do list for the 510 will grow exponentially. That, and my general interest in things is fragmented already...i guess the world is just too big and interesting to stop learning.

  • Like 3
Link to comment
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.