DIY CAN Gauge with Teensy 4.0
I am creating a DIY CANbus gauge that will pull info from the CAN lines coming from a MS3x and display any useful information I wish. I am roughly following the idea of an instructables post I found here. The main difference being they created the user interface (ui) in the raw code and are only pulling info from the sensors that are already in place.
The general functionality of these gauge will be a single 1.28" round display that can fit in any of the three small gauge spots in the miata dash, I am choosing to use the coolant temp hole. The idea is to have multiple screens that can be switched through to see different info about the car. The sky is the limit here as MS can broadcast just about anything you can dream of. A simple push button will need to be mounted to get the gauge to switch screens and can be incorporated in any way the user would like. Hardware is as follows...
It is very possible you may have a lot of this on hand already, which is great you can lower your all-in cost that way. You will also need a means of soldering wires and of course a computer to code on, perferably a laptop as the board will become difficult to remove once installed. You can also find the .stl files for the mount linked in the instructables above. Below is a preview of the ui's two screens that I have created and will be using, but following posts will show how to use the software to create custom screens and code screen switching functionality into the file that will be flashed to the teensy. https://cimg5.ibsrv.net/gimg/www.mia...9f91739569.png https://cimg4.ibsrv.net/gimg/www.mia...82f4b83ec0.png edit: added ui version 2 to github with afr The next post will mark the beginning of the project and the organization should be as follows...
|
Have a puttin-tat Sir and Godspeed.
Teensy is the bomb. |
A really cool concept, I might tackle it if I didn't already have the Link unit.
You might consider making this all a shopping list on Amazon for easier 1-click, if you're smart you could even find a way to make a few pennies. Total came out to ~$150, but like you said there's a few places you could save some dollars. |
Originally Posted by curly
(Post 1648601)
A really cool concept, I might tackle it if I didn't already have the Link unit.
You might consider making this all a shopping list on Amazon for easier 1-click, if you're smart you could even find a way to make a few pennies. Total came out to ~$150, but like you said there's a few places you could save some dollars. Yes, definitely lots of money to be saved with the adhesive, tape, bolts, wiring, etc. Good news is I got my ui uploaded to the teensy successfully and it showing on my lcd display. Screen switching and dimmer features both work too. I should have those first three parts written up this evening, including pictures and videos!! |
This is super neat looking. Cat given! Interested to see what it looks like installed.
@curly I've been wanting to code one of these since the CANChecked I use has some bugs with the Link. I can't promise a date, but when I get something written I'll make it open source. ninja edit: I just saw the bottom of your post. Ignore my question. |
LETS BEGIN
1. HARDWARE SETUP Getting the teensy and LCD wired up together is not too difficult. Take your time, get the pins soldered into the teensy and wires to the display. If you will be following the rest of this thread the wires from the LCD can be connected to the Teensy as follows.
https://cimg9.ibsrv.net/gimg/www.mia...326e071b79.jpg https://cimg1.ibsrv.net/gimg/www.mia...c2c86788a9.jpg |
2. Initial software setup and coding
You are going to need arduino IDE, which you can download from here. I am using version 2.3.2. You will also need to install "teensyduino" in order to load arduino sketches to your teensy. The link will walk you through the process. A. Display and Teensy setup Getting the display setup involves two key components, getting a library downloaded and setting up our speficic setup in the UserSetup.h file. Open arduino IDE and on the left side there will be a tab for your library manager. Open it, search for tft_eSPI and install the latest version. Next you need to use your file manager to navigate to your arduino folder that was installed with the IDE, find the libraries folder within that, then the TFT_eSPI folder within that and locate the UserSetup.h file. Open it with something like notepad and get ready to make some small edits.
Pictures of the finished .h file for your reference. https://cimg2.ibsrv.net/gimg/www.mia...bf6b327333.png https://cimg3.ibsrv.net/gimg/www.mia...1b5bab7e98.png |
2 Attachment(s)
Some sneak peeks at the ui on the display before I put together a square line studio tutorial video.
|
Originally Posted by Eli_Swer
(Post 1648660)
Some sneak peeks at the ui on the display before I put together a square line studio tutorial video.
|
Originally Posted by redursidae
(Post 1648661)
I'm sold on the UI. What is the boot time at the moment?
Not sure how quickly it might fetch values from the CANbus though. |
That's not bad. The CANChecked takes about that long to start showing values. Tuned in for the rest of the development!
|
Appreciate it! Thinking I'll have time tomorrow to share the UI design in squareline studio and explain how to use its different features. Also will be sharing a touch of coding in arduino for screen switching and dimming function. I am definitely going to be making a video for it, I would just end up with too many screenshots if I tried to do a write up. Also, I've got the actual ui file as well as the squareline project for my exact gauge up in a GitHub . Although, you can't download the singular ui file, upload it to a teensy, and get rolling, downloading the squareline project and following my instructions for export from squareline studio will create all the files you need to get the gauge up and going.
edit- To succesfully download the SquarelineStudio project from github, download both the .spj and .sll files then when you go to import the project into Squareline select the .spj and open it. |
2.b and 3. Squareline studio tutorial and bench testing the UI
|
Updated ui, also on github.
https://cimg2.ibsrv.net/gimg/www.mia...725dd161c3.png |
Found this on Facebook, super cool project! I'm making something similar to display GM CAN messages for LS\LFX swapped cars. I bought a Pi since I didn't want to deal with designing a UI for a microcontroller, but it looks like squareline takes care of all the hard work.
|
Facebook, interesting. Mind sending the link lol, I didn't post anything there. Anyway yeah squareline is pretty easy but is not really being developed anymore. The library it uses (lvgl) stopped working with squareline a few software updates ago. It still works just fine but will fall out of date some day. Nextion displays and their software does something similar I think that may be EVEN easier.
Also as an update I nearly have my MS3x built. Been following brains instructions on trubokitty. Just need to finish the wiring harness, then I can get it in my car and iron out a base map. I will be messing with the CAN stuff after that! |
Originally Posted by Eli_Swer
(Post 1649941)
Facebook, interesting. Mind sending the link lol, I didn't post anything there. Anyway yeah squareline is pretty easy but is not really being developed anymore. The library it uses (lvgl) stopped working with squareline a few software updates ago. It still works just fine but will fall out of date some day. Nextion displays and their software does something similar I think that may be EVEN easier.
Also as an update I nearly have my MS3x built. Been following brains instructions on trubokitty. Just need to finish the wiring harness, then I can get it in my car and iron out a base map. I will be messing with the CAN stuff after that! |
All times are GMT -4. The time now is 03:52 AM. |
© 2024 MH Sub I, LLC dba Internet Brands