Topic: Lemony Cheap DIY Arduino Remote Telemetry
Not sure who's tried to integrated the cheapest of microcontrollers into the cheapest of race series, but here's my project as it's unfolding. Hope to have it ready for Bowling Green.
Arduino Vehicle Telemetry System
Most remote telemetry systems are in the hundreds of dollars and would seem so out of place on a 24 Hours of Lemons racer. But with advances in modern technology, there is no reason we can’t use an Arduino to do what we want.
• Monitor vehicle information
• Signal alarms to driver when alarm thresholds are crossed
• Transmit vehicle information trackside for monitoring
I intend to separate the monitoring/alarming hardware from the transmission hardware just to prevent a communications lockup from protecting the vehicle.
Most importantly- this system DOES NOT HAVE CONTROL. It is simply supervising indications that the driver already has at his disposal (coolant temp, oil pressure, RPM) but also can monitor signals from the ECU such as timing advance, throttle position, and lambda/ fuel-air exhaust mix.
Ultimately, I’d like to have a system that looks like this:
Step 1: Setting Up Data Transmission
I started the data transmission build first simply because parts were available. I have some signal conditioning required in order to get the vehicle signals within the 0-5V Arduino analog input range. So I’ll cover that later when my parts arrive.
• 2x Arduino Uno
• 2x HC-12 Serial RF Module (https://www.elecrow.com/433mhz-serial-r … p-874.html)
• Computer with Arduino IDE
• Mini-PCI to SMA Adapter (optional)
• 433Mhz Amplifier (optional)
• SMA Antenna (optional)
I got my parts directly from China, so all told I think this cost something like $20.
The key component here is the HC-12 Serial over RF module. This is module has the protocols embedded, so you can send it serial commands like you would any other device and it will transmit those values to any other HC-12 within range.
There are five connections to this board:
SET: Pull to GND in order to access configuration, discussed below
GND: Return for the +5VDC
The manual for the HC-12 tells you the default settings, it is important to keep in mind it will default to 9600 baud rate. That will be useful for connecting to the board.
Basically, both circuits should look something like this:
NOTE: The Rx pin from the HC-12 should be connected to the pin you choose as the Tx in your Arduino SoftwareSerial code. Likewise, the Tx pin from the HC-12 should be connected to the pin you choose as the Rx in your Arduino code.
I highly recommend checking out Tom Helyen’s videos for more instructions and helpful activities: https://www.youtube.com/watch?v=DGRPqeacJns
Theoretically you can use the code I’ve attached (PROGRAMMER_MODE.ino) with the SET pin connected to Pin 2 on the Arduino and it will be driven LOW and allow you to access the configuration on the HC-12. I never got this to work and ended up powering off the Arduino, connecting SET to GND, powering on, and then configuring. I wasted a lot of time trying to get the pulldown feature to work.
You can use the commands in the HC-12 manual (https://www.elecrow.com/download/HC-12.pdf) to configure or use the HC-12 configuration utility attached.
My first attempt at this will be at 9600 baud without data integrity, gain turned all the way up. For testing I’m using the little spring antenna that came with the board. For the final design, I’ll make sure to use an external 5VDC power source and capacitor across the input to ensure maximum signal strength per the tech manual.
Step 2: Sending USEFUL Data
My original plan was to acquire the data from the serial port on my laptop and display it in Excel. I just didn’t know how well it would work to use Excel to display realtime data. I decided to revisit C# and make a Windows application to display information.
Along the way I found that GenLogic (http://www.genlogic.com) has a free-for-personal-use kit that has an easy connection to C# applications. There is a lot of documentation on their website and the editing program is pretty easy to use:
I realized there are only two important things:
1) Your “canvas” (black background in my case) needs to be named “$Widget” and then you use the set focus tool (white square with arrow going into it on the left hand side) to choose the canvas and add your elements to that. That ensures when you load it that everything is drawn.
2) Choose a unique name for each of the elements and keep good accounting of this. If you choose to use my code, you’ll need to be able to decode these.
I modified the code that comes with the HMI editor because it is designed for demonstrating the functionality. I have attached my Visual Studio project including the HMI display.
I decided so the serial messages could be as concise as possible that I would make each message in the form: #XX$ZZZZ, where XX is the “device number” and ZZZZ is the value. I made a spreadsheet of each of the values I wanted to transmit and assigned them a unique “device” number. The values vary based upon decimal requirements. If I need a decimal, I will just be sure to decode that on my laptop. Since I don’t have any field inputs, I made up some values so my gauges would appear on-scale and used my DC power supply to provide a 0-5V input for the tachometer. Just load BASIC_RECEIVER on the Arduino connected to your computer and load TELEMETRY_TRANSMITTER to the Arduino that will be in your car. I’m still playing around with delays and speeds to balance range with data transfer speeds.
For the time being I think I have a pretty fault-tolerant system and it’s pretty plug and play now. I’ve basically told the program to ignore bad data and catch an update the next time around, and I haven’t had it break for a while.
So I think it’s time to get my data gathering circuits put together!
Attached folders are linked here: https://www.dropbox.com/sh/msih0l8qou8j … 0F_1a?dl=0
Stay tuned to Part 3/4: Signal Conditioning and Data Acquisition
2016 CMP Fall South "Heroic Fix" Winner