M2VoltageMonitor - Help Us Collect Data!
What data is collected?
The program will monitor the voltage of the vehicle during engine ignition along with immediately before and after. The results of the test are stored locally on the microSD card in two files called "data.txt" and "stats.txt"
This file stores the voltage (V) versus time (ms) data in a CSV format. None of the data in this file needs to be submitted, however if you're curious what the voltage response of the vehicle looks like during engine ignition (like the graph below) the data is formatted nicely to be able to import into a program like Microsoft Excel.
This file stores the important data which we're interested in, the average initial voltage (AvgI), the minimum voltage (Min), and the average final voltage (AvgF).
Why is this data useful?
Many people have done it before or known someone who's done it: leaving your headlights on and coming back to a dead battery. When developing electronic devices for cars a similar problem can occur with high power devices such as cellular modems. Therefore it would be advantageous to keep the high power devices off until the car is turned on, which raises the question, how can we tell when the car is turned on?
There are a multitude of ways to approach this problem, one possible solution is to monitor the voltage level of the vehicle and watch for the characteristics of engine ignition. See below:
In the graph above we can identify 3 distinct regions:
Pre Engine Ignition (t<~32,000ms)
During this period nothing very interesting is happening, the vehicle is just sitting and the battery is putting out a little over 12 volts. We'll call this the average initial voltage, or AvgI for short.
Engine Ignition and Alternator Spinup (~32,000ms<t<~34,500ms)
When the key is turned (or the start button pushed) the starter motor begins turning over, dragging the vehicle voltage down to a minimum (Min) of about 9 volts. After the engine starts we can see the voltage begins climbing as the vehicle's alternator kicks in to recharge the battery.
Engine Idle (t>~34,500ms)
At this point the vehicle is idling stably and the voltage is steady at about 14.5 volts, thanks to the alternator. We'll call this the average final voltage, or AvgF for short.
Assuming the voltage response observed here is reasonably indicative of the majority of cars, we can roughly define a single car's voltage response as a function of three values: the average initial voltage before startup, the minimum voltage during startup, and the average final voltage after startup (AvgI, Min, and AvgF, respectively).
How to Run the Program and Collect Data
Upload the "M2VoltageMonitor.ino" sketch to the M2 and then remove from computer.
Format the microSD card as FAT32 and insert.
Confirm that the AC in the vehicle is turned off.
Without starting the car, insert the M2 into the OBDII port.
1 red LED will light on the M2, it is now recording the initial battery voltage.
Press button 1, the red LED will turn off and then all LEDs will turn on, the M2 is now standing by for the car to start.
Start the car.
Press button 1, the LEDs will begin to turn off one at a time while the M2 records idle battery voltage.
Once all LEDs are off, data collection is done and the M2 can be removed.
Running Multiple Tests
- After step 9 above, another test can be run without removing the M2 and the results will be appended to the ends of the "data.txt" and "stats.txt" files.
- Turn off the engine.
- Press and hold button 1 until the red LED begins flashing (~3 seconds).
- Release button 1 and wait for the red LED to change from flashing to solid (~10 seconds).
- Perform the test normally from step 5 of the original instructions.
Submitting Test Data
- The results of the test will be stored in the "stats.txt" file on the microSD card:
- Submit the results, along with the year, make, and model of the vehicle here :
- That's it! Thanks for your help!
Visualizing the "data.txt" Data with Microsoft Excel
If you're curious what your own vehicle's voltage response looks like you can generate a graph very quicly and easily with the "data.txt" file and Microsoft Excel
- In a new workbook, select the option to import data "From Text/CSV":
- Select the "data.txt" file from the microSD card:
- Select "Comma" for delimiter type:
(Depending on your version of Excel this stage may look a little different, however just try adjusting the settings until the data forms two columns as shown below)
- Press the "Load" button and the data should be added in a new sheet:
- Select both columns A and B and then insert a scatter plot: