obd2
Posted: Fri May 20, 2022 12:29 pm
by sasukiuchiwa
i'm using obd2 connector pins( melting 14/6 for canh nd canl 5/4 for chassis/signal ground ) and i want to communicate a car obd2 with esp32 twai protocale do i need a can transceiver or i just wire obd2 pins into esp32 gpio directly
i tried wiring directly but failed to receive data ( my code may be the problem too)
Re: obd2
Posted: Sun May 22, 2022 4:21 pm
by Craige Hales
I don't know anything about OBD and CAN bus, but it looks like fun. Lots of links on the web...
https://www.seeedstudio.com/OBD-II-CAN- ... -2993.html
https://os.mbed.com/cookbook/OBDII-Can-Bus
My reading: the CAN bus
must have some signal conversion hardware:
... wires are called CAN high and CAN low. When the CAN bus is in idle mode, both of these lines carry 2.5V but when data bits are being transmitted, the CAN high line goes to 3.75V and the CAN low drops to 1.25V. This generates a 2.5V voltage differential between the two lines, so... ... ...maximum data throughput defined by the standard is 1Mbit/s...
https://www.kanda.com/blog/microcontrollers/bus/
None of those numbers are small enough to be a valid low input. 3.75 might be high enough to damage an input. You need some kind of signal conditioning, maybe a differential op-amp circuit.
https://en.wikipedia.org/wiki/Differential_amplifier
I don't think the ADC can handle that data rate either.