ESP32 powering on/off from a canbus

I am checking the feasibility of a project where an ESP32 will be reading data from a canbus of a car. The canbus pin#16 continuously provides 12V even when the car's engine is not running
(see canbus pins in the picture) canbus_pinout
After converting the 12V to 5V of pin#16, the ESP32 can be powered. The issue is that how to power-off the ESP32 when the car's engine is not running? My idea, so-far, is to put the esp32 to sleep when there is no activity in the canbus for a certain period of time. I will be grateful if someone can advise or share his/her experience.

Don’t power off the canbus connector direct . Use a relay off an ignition switched part to power your circuit

And perhaps you should explain the reason for your advice? :worried:

If my understanding is correct, Hammy's idea is to trigger the power on/off of the arduino using "signals" from other pins than pin#16. I think this can be possible if we use a MOSFET. The trigger will come from pin#6 or pin#14 which voltage swings between 5V and 2V when the engine in running (?? still to check). I will draw and attach a circuit to explain how the power on/off trigger would work.

1 Like

I found an article that describes a solution for power latching. I will try it for my case and revert.

I was proposing you use a feed from say the radio /windscreen wipers or some other ignition switched part, to power a relay that in turn connects power to you Arduino from the OBD socket .

I tried the following in a circuit simulator (iCircuit).


I use the 555 timer to trigger the powering (on) of the esp32 via a relay. The power off is triggered by esp32 when the car engine is powered off (rpm=0).
Any comment is appreciated.

Update: I changed BC547 by BC337.
Typo: In the image: the power-on pulse is from pin#6 not pin#4

A bit complex for what you need !

Take a feed from an ignition switched fuse, run that to the coil of a relay . Contact of relay switches the 12v from the OBD port to you circuit

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.