Canbus Lighting Controller

I am working on a Canbus connected LED Controller.
After looking at the vesc code I want to leverage speed info, battery level, brake and IMU data to control addressable LED & 12V Front & Brake.
Project will be opensource and free to all.
Objectives:

  • Canbus coms with passthrough
  • compact
  • ws2812B using wled code
  • front and rear light control
  • single button control (external)
  • low cost
  • JLBPCB assembly friendly
  • firmware upgradable
    Optional:
  • PPM\UART remote Macro (i.e. Brake 100% 3 times rapidly turns on\off lights)
  • Mobile App
  • Integrated Buck

GITHUB
Info Iinks:

WLED

https://triforce-docs.readthedocs.io/en/latest/canbus/canbus.html

Board will likely be STM based I will be limited to what LCSC.com carry in stock.
My prototype was esp32 based and not very assembly service friendly.
The upside is canbus on STM is a snap but I will need to port the wled code over.

I am in 2 minds.
Option one use the nRF52840
Advantages
LCSC stocked
Inexpensive
Can double as a can connected ble module.
Can be updated by over the air/swd port
Disadvantages
Nordic Dev environment is a skullf##k
Limited storage

Create board with a socket for esp32 module
Advantages
Native support for wled code and libraries
Circuit python support
Wifi web app easier to code.

Disadvantages
Canbus support is tricky but doable
Bulkier design.
Requires user to source seperate part.

Ordered a nrf Dev board with built in canbus transceivers to test the concept. I have also started on the esp32 PCB design. Not all (V)ESC have an IMU so I will add a header to add a built in IMU.

12 Likes

Fuck me this is a lot of reading.
My original plan of doing can bus in software and just hanging some TJA1050 can bus ics off gpio might be not be the best.
New plan add a can bus dedicated controller connect it to the esp32 via spi and it talks to 2x TJA1050.
No bit bashing as it handles all the timings. Adds about a $1 to the design but frees up a lot of heavy lifting from the esp32.

Also looking at Atmel micros
They have the advantage of having in built can bus controller. The library and code are well documented for can bus. I can see why everyone ops for UART comms.

Prefered Controller: (dev bourd ordered)
https://www.microchip.com/wwwproducts/en/MCP2518FD

6 Likes

Instead of making this wireless, and wasting quite a bit of juice staying in contact wirelessly – how about driving it with some cheap wires, or even better - use a conductive INK pen to draw out the circuit, and then once it’s working, paint over it with some kind of protective paint – a clear nail polish would probably work nicely.

2 Likes