One of my projects in lockdown has been automatic recording of every journey using the original Arduino Uno hardware and a few extra components.
The Logger is left permanently connected to the ECM. The total current consumption when ignition is off is measured in micro-amps, which shouldn't drain the battery. A diode isolated sensor wire is taken from terminal 6 of my unused AirCon switch connector (Ignition feed). If your car has A/C you may have to take the ignition feed from elsewhere. There's an Ignition feed to the ECU which could be tapped.
There is 1 changed and 1 extra circuit used:
Changed:
A 2-transistor gated interface circuit between the ECM and Arduino - allows the logger to control when it listens to the ECM.
Also allows the logger software to be downloaded with it assembled.
2-Transistor-Interface.jpg
Extra:
An automatic turn-on and delayed turn-off circuit.
Turns the logger on with the ignition and when the ignition is turned off delays around 7 seconds before power is removed.
There's also an override to switch on manually.
Delay-Circuit-2.jpg
The only non-standard component is a small 12V relay like
this one.The main change to Matts' original software is to continuously poll the ECM whilst listening for Flag 40 Bit 3, which is the "Engine Running" Flag. The presence of the flag dictates opening, recording data and closing the ecm file on the SD card.
There are 4 possible states when an ECM packet is examined:
1. Logger file not open and Flag not set:
Do nothing, the engine's not running and we're not recording.
2. Logger file not open and Flag is set:
Engine just started -
Open a new Logger file and start recording ECM data to it.
3. Logger file is open and Flag is set:
Engine is running -
Continue recording ECM data to the file.
4. Logger file is open and Flag not set:
The Engine is stopped so update the file header and close the logger file.
The Logger is now ready to start recording the next journey.
If the ignition is turned off so fast that the Logger doesn't see the flag cleared (within 1/4 second), the file closing routine is invoked after 12 missed ECM packets (Approx. 3 seconds).
List of enhancements made in version 1.2.X:
.1 Added code to set file creation and update dates on SD card files
.2 Changed filename to use Duodecimal Month: A=Oct, B=Nov, C=Dec
.3 Changed SD Card SPI frequency to high speed to support SDHC Class 10 cards
.4 Used pin 5 (RXD-Enable) to enable & disable receiving from the ECM so that sent data is not reflected back to the Arduino
.5 Polling frequency set to 250ms using reasonably accurate time calculation
.6 Main loop re-written for Multiple File generation based on "Engine Running" Flag (Byte 40 Bit 3)
ElanLogger12.6.zip
You do not have the required permissions to view the files attached to this post.