GTR Forum banner

1 - 20 of 73 Posts

·
Registered
Joined
·
2,145 Posts
Discussion Starter #1 (Edited)
Since I got the Link G4+ I have been looking at display options using CAN Bus.

Currently I am experimenting with an Atmel microcontroller/Arduino CAN signal reciever/processor, and an Adafruit OLED display, looks promising so far. Just mocking things up at this stage, but the OLED is a nice size to replace one of the stock submeters on the main dashboard. The idea is that there will be a momentary switch to allow you to cycle through different layouts , for my purposes AFR and Boost on the same gauge is really handy.

Total cost so far £70 ish

 

·
Registered
Joined
·
2,392 Posts
Hey Alex - I like that.
How easy is it to get working?
I've been playing with the idea of replacing the centre gauges in mine to something a little different and this could be a great little (extra) project for me :)
 

·
Registered
Joined
·
2,145 Posts
Discussion Starter #4
Hey Alex - I like that.
How easy is it to get working?
I've been playing with the idea of replacing the centre gauges in mine to something a little different and this could be a great little (extra) project for me :)
I did a lot of searching for options. With arduino there is so much variety its hard to find exactly what you need for your prpject. The main board could have been standard Arduino with a dedicated separate canbus board, the display could be monochrome oled, lcd, segment led or tft even touch screens can be had for fairly sensible money.

The key is finding things that are well supported with demo projects with working code to base a project on. I am a software dev by trade but the coding required to interface with a display from scratch is beyond me.

The display is faulty (a couple of dodgy columns of pixels) so needs to go back at some point but it works for now. The graphics library I am using to draw to the oled isn't great, the font is too clunky, there is another I am going to try though, but hey clunky is retro.

The mechanics are easy enough, 8 wires to solder joining the display to the controller, decent soldering gear needed as its all tiny. Two more wires for power, two for CAN. Plug in the laptop, hack some code based on the free samples and upload it to the board.

The time goes into reading up so its the right wires you solder and the right code you write!

I havent yet tried to get the actual CAN communications working and i know that can be a pain, but Link have some info in the help files on PC Link and again I have sample projects to hack.

Figuring out how to fit the thing nicely into the clocks is another job, and I seem to have a mental block about that kind of thing. Hot glue and trim tape....

There's a mix of "must haves" and "nice to haves" floating around in my head atm, so I'm going to try to narrow down the essentials otherwise I'll never finish the thing.
 

·
Registered
Joined
·
2,392 Posts
Thanks for the info - and thoughts...
I know what you mean about finishing a project - all to well ;)
How complex is the coding? I'm not averse to trying stuff (working in IT for over 18 yrs) but I'm defiantly more infrastructure than a Developer.

Got any more pics?
 

·
Registered
Joined
·
2,392 Posts
Appreciate that Alex - thanks.
If you need any soldering - shout. I started soldering when I was young, and continued for about 5 years with my first job (god I feel old), though I no longer have the same rig for some micro chip repairs.

Depends how small you class small ;)
 

·
Registered
Joined
·
2,145 Posts
Discussion Starter #8
Appreciate that Alex - thanks.
If you need any soldering - shout. I started soldering when I was young, and continued for about 5 years with my first job (god I feel old), though I no longer have the same rig for some micro chip repairs.

Depends how small you class small ;)
There are two sides to it, the electronics and comms stuff is something a IT network engineer type would pick that up easy, on the other hand the code is C++, someone that has never written code before could get bogged down trying to do anything more meaningful than flashing a LED, the community and resources are out there to help but there is a learning curve but if you have the time to pick apart a bunch of examples you would pick up the basics.

I remember maplin/radio shack electronic project kits from the 80's. I could never make the circuits work, really put me off electronics for a long time. But this microcontroller based stuff is great, as it really simplifies the electrical and leaves you just connecting modules where someone with a degree in EE has done the hard work of figuring how to make everything talk to each other and you are just doing plumbing.

I've just been back out in the garage :) messing around with power supplies. In the video above its powered via the 5v on the usb lead from the lappy. In the car i planned to power via the 12v that comes off the obd/can. The arduino has a tiny regulator on the specs rated for 5-16v. Turns out it gets red hot running 12v so I'll need to add a power supply board of some variety, maybe just a 5v regulator chip as I have one lying around.

Lol soldering, I know my limitations, the stuff you need to work on for this is all through hole so not too bad if you are used to that sort of thing. Sometimes I think i've cracked it and others the solder just won't go where you want it, its all in the prep and keeping everything clean i think.
 

·
Owner of the MSNSPS
Joined
·
5,172 Posts
Appreciate that Alex - thanks.
If you need any soldering - shout. I started soldering when I was young, and continued for about 5 years with my first job (god I feel old), though I no longer have the same rig for some micro chip repairs.

Depends how small you class small ;)
At some point in the not too distant future I will be looking for someone to do a little soldering work on my head-unit/tablet project. Nothing too exciting just sticking some fly leads in place of the OEM power button. I'm too cack handed at soldering to attempt it but if you were willing to try I'd be happy to supply some beer tokens for your troubles. :bowdown1:
 

·
Owner of the MSNSPS
Joined
·
5,172 Posts
Since I got the Link G4+ I have been looking at display options using CAN Bus.

Currently I am experimenting with an Atmel microcontroller/Arduino CAN signal reciever/processor, and an Adafruit OLED display, looks promising so far. Just mocking things up at this stage, but the OLED is a nice size to replace one of the stock submeters on the main dashboard. The idea is that there will be a momentary switch to allow you to cycle through different layouts , for my purposes AFR and Boost on the same gauge is really handy.

Total cost so far £70 ish

Alex will you actually be able to read any of the information which comes up easily? I only ask because I have to incline my head to read those gauges which makes it hard to see the ones at the top of the dash whilst driving quickly. For me it's not a problem as I rarely want to know what the front torque or voltage is.

If you are showing boost info might it be too low down to be able to see when you need it?

On another hand to cycle through through the information you could wire up those 'radio' buttons on the dash - I've been trying to think of a use for them for ages!
 

·
Registered
Joined
·
8,540 Posts
Since I got the Link G4+ I have been looking at display options using CAN Bus.

Currently I am experimenting with an Atmel microcontroller/Arduino CAN signal reciever/processor, and an Adafruit OLED display, looks promising so far. Just mocking things up at this stage, but the OLED is a nice size to replace one of the stock submeters on the main dashboard. The idea is that there will be a momentary switch to allow you to cycle through different layouts , for my purposes AFR and Boost on the same gauge is really handy.

Total cost so far £70 ish


That's really neat!. Looking to get into the whole Aurdino/Rasp Pi stuff myself at some point. Wanted to make myself a very basic F/R brake temp gauge with a pair of thermocouples, a controller and a 2-line LCD/OLED display. Will get round to it at some point I presume!!
Out of interest, is it the Adafruit 1.5" colour display you have used??

Good luck with the project.... Looking great so far!!



TT
 

·
Registered
Joined
·
2,145 Posts
Discussion Starter #12
That's really neat!. Looking to get into the whole Aurdino/Rasp Pi stuff myself at some point. Wanted to make myself a very basic F/R brake temp gauge with a pair of thermocouples, a controller and a 2-line LCD/OLED display. Will get round to it at some point I presume!!
Out of interest, is it the Adafruit 1.5" colour display you have used??

Good luck with the project.... Looking great so far!!

TT
A brake temp gauge sounds a great project.

The two components I am using are:
Leonardo CAN BUS board | L-CANBUS | HobbyTronics

And:
https://learn.adafruit.com/adafruit-1-5-color-oled-breakout-board/overview

Not necessarily the cheapest or best available but just what I settled on.
 

·
Registered
Joined
·
2,145 Posts
Discussion Starter #14
Zada did a project to replace the centre gauges but the club pulled out of pursuing it further.

I'd come across that Zada youtube video and followed through to the website it looked promising but did seem to peter out.

So was that a project that this forum was involved in then?
 

·
Registered
Joined
·
2,145 Posts
Discussion Starter #15
Alex will you actually be able to read any of the information which comes up easily? I only ask because I have to incline my head to read those gauges which makes it hard to see the ones at the top of the dash whilst driving quickly. For me it's not a problem as I rarely want to know what the front torque or voltage is.

If you are showing boost info might it be too low down to be able to see when you need it?

On another hand to cycle through through the information you could wire up those 'radio' buttons on the dash - I've been trying to think of a use for them for ages!
Good point I'll check, but my seat is incredibly low so I suspect it is pretty much in eye-line, certainly better than the standard triple gauge location which is where the gauge I have been using was sited. If visibility was an issue the water temp would be another candidate to replace since it's total BS anyway. But of course you could locate anywhere you wanted.

Genius idea to use the radio buttons! I'll definitely look into that.
 

·
Registered
Joined
·
8,540 Posts

·
Registered
Joined
·
2,145 Posts
Discussion Starter #18
Some progress to report. I've been on a serious learning curve!

I have live data coming out of the Link G4+ and being displayed on the OLED screen. I have some basic C++ hex data translation to brush up on but the data is there.

When I have got everything working properly, I'll post code and wiring diagrams. In the meantime here are some observations that will only really be interesting to someone trying to build a similar CAN bus display.

1)CAN bus while incredibly simple and robust in theory, turns out to be fragile and fussy in practice (for the average non-electronic engineering graduate).

2)The little ATMEL microcontrollers used in most Arduinos are at the edge of their performance capabilities with this sort of real time datastream and the load needs to be managed carefully. For this reason the more powerful Arduino Due might be a good bet (it looks like a decent CAN bus library exists for the Due).

3)The CAN transceiver and CAN controller are discrete chips (MCP 2551, MCP 2515 respectively) that together consume and present the CAN bus data in a way the Arduino can query. You can buy a standard Arduino microcontroller board and a separate CAN bus "shield" or "break out board" which contains the MCP2551/2515 ready to connect up, or you could make your own "break out board" by buying the two chips and follow their data sheet to wire up the small number of components needed to make them work. The board I chose is unusually in that it combines the arduino and mcp 2551/2515 on one PCB. Either way though the mcp2551/2515 will require well written code to wrap up their functionality; this is fairly time consuming and specialist work, luckily the wonder of the Arduino community is that open source code in the form of "libraries" are available so that a normal human being can interact with them using just a couple of lines of code. The downside of being open source is that the libraries can vary in quality and completeness. Similarly the open source libraries are available that wrap up the functionality of the OLED display (SSD1351 in this case) allowing simple text and graphics to be displayed using a small amount of code.

4)As a parallel project I have got the Link G4+ and my Race Technology logger talking over CAN. This provides a template datastream to work with; which is really handy, however they default to a 1Mb/s baud rate (the "carrier frequency") and 100Hz update rate (how often new values are put out on the bus). Arduino/MCP2551/2515 hardware seems to freeze up above 125Kb/s baud rate. Luckily the Link ECU has two CAN bus outputs, so one can run at 1Mb/s for the logger, and the other are 125Kb/s for the gauge display(s).

5)As a desktop software developer my instinct was to use interrupts to capture and process the arrival of each CAN message BUT it turns out that the rate at which the interrupt fires (~400Hz or every 2.5ms for the 4 CAN "frames") combined with the time time it takes the processor to write values to the display mean the whole things crashes instantly. Instead you simply let the CAN controller manage its small rotating buffer of incoming CAN messages, and pick them up in the main "process loop" on the Arduino when it has the time, if you miss some it doesn't matter; the update rate will still be fine for a value displayed on a gauge (not so good if you are building an engine management system or ABS system). There were many hours of head scratching and tech support emails exchanged before I figured this out.

6)The wiring and soldering involved is very simple and, thanks to the wiring diagrams and sample code supplied, doesn't require specialist knowledge to get something generic working. But to troubleshoot any meaningful application you really need to understand what makes that sample code work and how that relates to the wiring connections you have made.
 

·
Registered
Joined
·
8,540 Posts
Interesting observations there Alex. Very useful indeed...


Good work so far and good luck getting over the final hurdle to completion!!



TT
 
1 - 20 of 73 Posts
Top