Skip to content

JT2AW15/Arduino-Vehicle-Datalogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arduino Vehicle Datalogger

This code, along with some shields, turns your Arduino Uno R4 or R3 into a combination CAN bus and Analog data logger.

⚠️ Warning ⚠️

Ensure that the voltage of analog inputs does not exceed the limits of the hardware you are using!

Configuration

include\shield.h

This is where settings based on hardware are configured.

Check that chip select pins, status LEDs, input buttons, etc. are assigned appropriatly.

RTC note

The type of RTC chip being used needs to be configured on line 18 of src/main.cpp.

include\options.h

This is where settings based on data collection are configured.

Up to six CAN messages can be filtered for, or no filter can be set and all CAN messages recorded. Up to four analog data channels can be recorded. Pins A4 and A5 are used for I2C communication, so it is not possible to also record data on these pins. Pacing for analog data can be configured, to only record analog data every nth CAN message recieved.

Building for Uno R3

In the file .pio/libdeps/uno_r3/mcp_can/mcp_can_dfs.h, defining DEBUG_MODE as 0 on line 41 can help save memory if you are building with SERIALLOGGING defined in include\options.h.

Data Processing

Data saved is in a binary format, following the structure defined in include/tCAN.h. For simplicity, analog signals are saved the same as CAN messages, with their message ID being equal to the value of the pin.

There is an example script, datapostprocessing/bintolog.py, that converts binary files into human readable text logs of all message data.

Shield Modification

Ensure that there are no overlapping chip select pins I moved the chip select pin of the SD card on the RTC board to D6, cutting the trace, and using the provided breakouts.

Ensure that devices have appropriate pullups/downs I wired 4.7kΩ pullup resistors to the SDA and SCL lines of the DS1307's I2C bus, using the provided breakouts on the RTC board. Uno R3 does not have input pulldowns, so depending on your analog inputs, you may want to add pulldown resistors to prevent floating.

Reccomended Shields

CAN bus

Any MCP2515 based shield can be made to work, but here are some suggestions:

Image + Link Description Price Tested
Shield with CAN connectivity, built in LEDs, and a joystick for input. $39.95
Much more affordable, but lacks extra peripherals. $6.99

RTC

Any RTC chip supported by RTClib should work, but here are some suggestions:

Image + Link Description Price Tested
A clone of an older Adafruit design, has an SD card port which I find preferable to microSD. Also has plenty of space to add LEDs or buttons. $7.99
An updated version of the board the one above was based on. Uses a different RTC, PCF8523 instead of DS1307. $13.95

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors