Simple/cheap CAN logger ?

Introduction and miscellaneous that we haven't created categories for, yet
Post Reply
mikeselectricstuff
Posts: 120
Joined: Sun Nov 08, 2020 11:33 am
Been thanked: 2 times

Simple/cheap CAN logger ?

Post by mikeselectricstuff »

Saw a comment in another thread that it would be useful to have a very simple standalone CAN logger which would simply dump CAN data to an SD card, and not much else. Simple & cheap enough to be able to send to someone offering to log from their car to help reverse-engineering.
I'd thought about this in the past and just assumed someone had done it, but can't find much out there - "Low cost" seems to still be over £100

Assuming it doesn't already exist, how useful would something like the following spec be :

Records CAN traffic to SD or maybe USB stick. Preferably CSV format for SavvyCAN, assuming SD card bandwidth is not an issue
500kBaud ( how common are other rates?)
Power: any of 12V, 5v ( USB powerbank), or LiPo cell
Configure via text file on SD card - filters, trigger criteria, baudrate etc.
Button/external trigger input, configurable to control logging or insert bookmarks in the log
UI : 1 button, 1 RGB LED.
Physical - just a PCB, maybe heatshrink it, or a PCB sandwich.
Firmware update via SD card

BOM cost under a tenner.

I already have some of the software stuff needed from various other projects, so could probably cobble something together fairly easily if there would be enough interest.
I don't want to get into a feature-creep situation as it would never get done, just want to capture the bare minimum hardware functionality. Obviously more software goodies could be added later.

Comments ?
Does it already exist?
Would it need a "real" time clock or would relative timestamps suffice?
User avatar
celeron55
Posts: 776
Joined: Thu Jul 04, 2019 3:04 pm
Location: Finland
Has thanked: 28 times
Been thanked: 110 times
Contact:

Re: Simple/cheap CAN logger ?

Post by celeron55 »

I was thinking something like this should be made. I, however, didn't have any existing project that would have the bandwidth to capture and write full bus traffic so I didn't end up trying to design it.

One hardware option could be raspberry pi with a canbus hat. Way powerful, already exists, very easy to develop and well under $100, but not $10, boots slowly and needs an expensive 2.5A powerbank to run.

I think a $10 open source easy to use 500kbps capable canbus recorder would be a game changer.

Definitely add some analog or digital inputs to be recorded with the bus data. It would enable easy synchronization with other signals in the target system. Would also help with not having a real time clock.
User avatar
zilion
Posts: 58
Joined: Tue Feb 02, 2021 7:50 am
Location: Poland

Re: Simple/cheap CAN logger ?

Post by zilion »

for a hardware platform you can use this:
https://mouser.com/ProductDetail/Olimex ... XINO-STM32

It has 3.7V lipo connector and charger, but CAN wont work.
For CAN you have to connect to external power input 9-30V tolerant.

And for STM32F1 you can't use USB and CAN simultaneously. They share same memory block, but you can log to SD with no problem.

Here is some code to begin with:
https://github.com/onesk/olimexino_can

It transmits to UART1, but you can add SD logging.
I smell lithium in the air. It's not lithium, it's glycolium.
mikeselectricstuff
Posts: 120
Joined: Sun Nov 08, 2020 11:33 am
Been thanked: 2 times

Re: Simple/cheap CAN logger ?

Post by mikeselectricstuff »

Yes, definitely a couple of analogue ins (0-15V range) , probably a UART in as well to log from other random hardware.
Dedictated hardware - using existing stuff will always be a compromise. I have a pick & place machine.
Will be based on the PIC32MX5xx as I'm very familiar with PIC32MX ( and unlike ST these days, you can actually buy them) and I already have bootloaders etc.
Leaning towards USB rather than SD, as more robust & less fiddly, also maybe better transfer rates - need to do some tests on this.
Power probably just 5V USB or 12V for simplicity - lipo cells get messy.
User avatar
muehlpower
Posts: 575
Joined: Fri Oct 11, 2019 10:51 am
Location: Germany Fürstenfeldbruck
Has thanked: 12 times
Been thanked: 103 times

Re: Simple/cheap CAN logger ?

Post by muehlpower »

I found that https://github.com/akpc806a/CAN_Logger

maybe order at JLCPCB and copy software
davefiddes
Posts: 213
Joined: Mon Jan 18, 2021 12:39 pm
Location: Edinburgh, Scotland, UK
Has thanked: 14 times
Been thanked: 38 times

Re: Simple/cheap CAN logger ?

Post by davefiddes »

That's a nice device. I might wish it had a more robust PSU (a MOV, a zenner and phat resistor) to survive on a vehicle 12V. Also selectable CAN termination with a jumper would be good. Removing the termination resistor and adding one on the screw terminals if required isn't hard.

Very fair price if you consider a £10 GBP BOM cost is $14 multiply by the usual 2.5 (to get a retail price that washes it's face) you get $35 sale price.
mikeselectricstuff
Posts: 120
Joined: Sun Nov 08, 2020 11:33 am
Been thanked: 2 times

Re: Simple/cheap CAN logger ?

Post by mikeselectricstuff »

muehlpower wrote: Thu Jun 10, 2021 10:19 am maybe order at JLCPCB and copy software
..except there is no stock anywhere of that MCU, Farnell expecting next January!
Post Reply