# 2 LED Logic probe for CAN bus

Discussion in 'The Projects Forum' started by cork_ie, Jan 13, 2016.

1. ### cork_ie Thread Starter Member

Oct 8, 2011
348
58
Hi all,
It's been a while since I posted on here but I am back again looking for help and ideas.
My project is to build a quick and simple logic probe for CAN bus.
I have all the oscilloscopes, CAN interfaces etc. , but I often just want to do a quick test to see if the bus is running or not.

What I really want is to make a small battery powered logic probe with two flickering LED's that will tell me that data is running on both the CAN Low and CAN High lines of the bus.
I don't want to unduly load the bus so I need something with a fairly high impedance input, 10K or greater.
The two signal lines of the bus, CANH and CANL, in the quiescent recessive state, are passively biased to ≈ 2.5 V. The active state on the bus takes CANH ≈ 1V higher to ≈ 3.5V, and takes CANL ≈ 1V lower to ≈ 1.5V, creating a typical 2.0V differential signal.
I have looked at several DIY logic probe circuits and unfortunately 2.5V is smack in the middle of the area of uncertainty between high and low in most logic circuits and a standard logic probe circuit is unlikely to be reliable.

Last edited: Jan 13, 2016
2. ### Papabravo Expert

Feb 24, 2006
10,138
1,789
Yeah. What you want is a dual comparator with thresholds set to >4V and <1V for example. The outputs can drive separate LEDs or be wire-ORed together. Should be a straightforward circuit.

3. ### #12 Expert

Nov 30, 2010
16,267
6,778
I would make the deadband from 2V to 3V with a high impedance divider to set the unconnected input at 2.5V. Using 5V CMOS R-R Dual op-am. Buss can pull the input high (3.5V) or low (1.5V). I poked the internet 2 or 3 times today looking for an excellent battery for this, and my google-fu doesn't seem to be working. (3) AA batteries? A Lithium at 3.6V? Not really sure what the limits are today. A probe should be convenient in your hand, but I can't seem to imagine the batteries correctly.

What number is that 2.5V regulator chip that MikeML is so good with? I think I'm going to need one for this.

Found it. TL431

Last edited: Jan 13, 2016
4. ### AnalogKid Distinguished Member

Aug 1, 2013
4,530
1,248
Do you want to test each line independently for signal activity (2 LEDs), or only indicate that the bus is changing between valid 0 and 1 states (1 LED)?

ak

5. ### #12 Expert

Nov 30, 2010
16,267
6,778
Something like this:

File size:
10.4 KB
Views:
14
6. ### cork_ie Thread Starter Member

Oct 8, 2011
348
58
I have just been looking at LM339 spec sheet which should do the trick, it is a quad comparator and I can use the two spare outputs to drive a buzzer to also give an additional audible signal indicating bus activity.
For the battery I am considering 2 x 3V button cells in series with a simple momentarily push to make switch as I will only to operate it for a few seconds .
I will try and prepare a circuit diagram and post it for evaluation , all comments welcome.

7. ### #12 Expert

Nov 30, 2010
16,267
6,778
The LM339 eats 600 ua and it's a quad. Part of my frustration was about the awfully low current the button cells can provide. That's why I was thinking about a 5V Cmos dual.

File size:
163.2 KB
Views:
3
8. ### cork_ie Thread Starter Member

Oct 8, 2011
348
58
Thanks for your schematic, I will need to check both the CANH and CANL bus lines at the same time so I will need 2 inputs , but you have given me a good indication where to start from.

#12 likes this.
9. ### #12 Expert

Nov 30, 2010
16,267
6,778
Just divorce the op-amps at the center strap and make another input line with it's own meg to a 2.5V reference.

10. ### cork_ie Thread Starter Member

Oct 8, 2011
348
58
Yes I need two inputs , One for CANH and one for CANL , they are basically the same signal but inverted.

11. ### cork_ie Thread Starter Member

Oct 8, 2011
348
58
Thanks. What you say makes perfect sense, I will study the schematic and try redraft it.
What is the function of the 1M resistor? Is it connected at the 2.4K and 12K resistor joint?

12. ### #12 Expert

Nov 30, 2010
16,267
6,778
The junction of the K level resistors is a 2.5V reference on that particular regulator chip. The meg resistor floats the inputs at 2.5 volts so they are in the dead zone for a can buss. The meg of impedance insures that the can buss can drag the voltage away from 2.5 volts.

Last edited: Jan 13, 2016

Nov 30, 2010
16,267
6,778
Try this.

File size:
11 KB
Views:
11
14. ### AnalogKid Distinguished Member

Aug 1, 2013
4,530
1,248
They're supposed to be inverted versions of the same signal, but that is one of the conditions to monitor. I was asking about output, not the inputs. If you want to detect not only bus activity, but valid bus activity, then you need to put the two comparator outputs through what are basically exclusive-OR gates, so the LEDs come on only when both inputs are in one of the two valid states.

ak

#12 likes this.
15. ### #12 Expert

Nov 30, 2010
16,267
6,778
You are ahead of me on the definition of Can buss. That's why my schematic is so lacking. When I see what you just said, I realize I had a very wrong belief about the signals.

16. ### #12 Expert

Nov 30, 2010
16,267
6,778
@AnalogKid
The way you talk, I am guessing the CANH signal can go high OR low, and the same with the CANL signal. I thought CANH can only be 2.5V or high and CANL can only be 2.5V or low. Wanna clear this up for me?

17. ### AnalogKid Distinguished Member

Aug 1, 2013
4,530
1,248
They should be as you describe, but if they are then you don't really need a monitor. Testing for what they might do, it is entirely possible for both signals to swing the full 0V-5V and beyond. If you proclaim a 1.0 V 0/1 threshold and that signals above +5 V and below 0 V are ok (for example, a CANH signal at 5.7 V), then you have a basic tester with two single comparators, one on each line (no true window comparators): CANL trips at 1.5 V and CANH trips at 3.5 V.

Power the monitor with 6 V or 9 V
1 - LM358
1 - CD4093
1 - LM4040-4.1 or some other reference

EDIT: OR, replace the 4093 with two 1N914's. Yup.

Connect the two LEDs inverse parallel between the two LM358 outputs with 1 current limit resistor and two 1N914's in series. Flip over one of the two 358 inputs and you get the decode logic for free. The idea here is that if only one comparator trips the output voltage difference is not enough to light an LED with a 914 in series to increase the total Vf.

As alluded to above, a better circuit would have a true window comparator circuit on each CAN line.

ak

• ###### CAN-Bus-Mon-1-c.pdf
File size:
10.7 KB
Views:
5
Last edited: Jan 14, 2016
cork_ie and #12 like this.
18. ### #12 Expert

Nov 30, 2010
16,267
6,778
I totally agree. My first rule of trouble shooting is, "Electricity will either be where it shouldn't be or not be where it should be." If that wasn't true, you wouldn't be troubleshooting!

Of course, this part comes after the Safety Rules like, "Never stand behind an electrician's elbow."

19. ### cork_ie Thread Starter Member

Oct 8, 2011
348
58
I have looked up the datasheet for the TL431 and you understand what you mean. Irrespective of whether I use them in this project or not they are very cheap and handy to have, so I will order a few.

You are quite correct, I know there are different flavours of CAN but I only work on automotive CAN and it is tightly specified in ISO 11898
I have never seen a CAN transceiver that operates at above 5V and quite a few of the newer ones are 3.3V. The voltage levels for CAN H & L are as described in my original post. The Bus is terminated by 2 120 Ohm resistors, one at either end, giving an ideal bus impedence of 60 Ohm .
I don't doubt that modules get wet,& plugs get corroded etc. but generally the CAN transceivers are tolerent of short circuits up to vehicle system voltage 12V DC.

All I need in this probe is a quick Go/NoGo bus monitor that I can quickly determine if data is being transmitted on the bus or not. I have thousand of Euros worth of scopes and CAN interfaces available if I need to delve deeper. I just need a quick bus monitor so that I can very quickly see if the bus is active or not as I disconnect different nodes .

20. ### cork_ie Thread Starter Member

Oct 8, 2011
348
58
Thanks for the schematic and all your help.
I understand most of what you are saying but am not sure what the CD4093 (NAND Schmitt Trigger) does or how the four 1N914's do the same thing