4
\$\begingroup\$

I'm trying to find a simple way of having software selectable termination on the CAN bus of a device I am making. I think a Solid state relay is the best bet so I have come up with the following circuit.

The typical network this connects to will could have around 15 nodes and could have a bus load of upto 35%.

My device is solely 3v3 and I'm not sure if this panasonic relay will work with 3v3 or if this circuit will even work? The reason for the 90ohm rather than 120 is because the relay has a on resistance of 30ohms.

So my questions are: Will this circuit work? Is there any better alternatives? Is the 10pf output capacitance of the SSR acceptable and what issues will the cause?

This is the relay I plan to use: https://www.panasonic-electric-works.com/cps/rde/xbcr/pew_eu_en/ds_x615_en_aqw227ns.pdf

enter image description here

\$\endgroup\$
  • 1
    \$\begingroup\$ If you are driving pins 1 and 2, the output side are pins 7 and 8, not 3 and 4, which is another input side (opto LED). \$\endgroup\$ – Martin Sep 26 '16 at 11:37
  • 1
    \$\begingroup\$ Assuming the micro can cope change the 1k resistor to 330 ohms. The datasheet values are all for an LED on current for 5mA rather than the 1.5mA you are giving it. Your on resistance may be higher with the current values. Also you are getting close to the maximum rated sustained current on the output side when the bus is in the active state. Since the duty cycle isn't going to be 100% you should be ok but it's closer to the limits than I would like. That said assuming you aren't going to be trying to switch the termination on and off too quickly it looks like it should all work. \$\endgroup\$ – Andrew Sep 26 '16 at 11:40
  • \$\begingroup\$ Can you live with 15 pF (max) across across the switching output terminals when the switch is open circuit? Also, why do you want to switch the termination in and out - are you daisy chaining? \$\endgroup\$ – Andy aka Sep 26 '16 at 11:41
  • \$\begingroup\$ I have just corrected the circuit and added some info. I need selectable termination because its a universal device and in some situations if could be the endpoint sometimes not. I have no idea if the capacitance could be a problem, what issues could it cause? \$\endgroup\$ – Terry Gould Sep 26 '16 at 12:50
  • \$\begingroup\$ Why not make a separate board with a terminator independent of the rest of the system? If a node is added at either end, just move the terminator to the end. A board with a connector and a resistor would be far cheaper than adding a solid state relay to every single board. \$\endgroup\$ – vini_i Sep 26 '16 at 13:50
5
\$\begingroup\$

It looks like it should work if you're not pushing the CAN bus to the limit. You can definitely turn on the LED with 3.3 V since the maximum LED voltage is 1.5 V. It needs about 5 mA, so you can probably drive it directly from a digital output.

I don't like the sloppiness of the output resistance. It can be up to 50 Ω, but we don't know how low it could get. The datasheet only lists a "typical" of 30 Ω. The best you can do is put a 90 Ω resistor in series so that the center of the spread ends up at the desired 120 Ω. However, you don't know how close to 90 Ω the result is.

Without a minimum resistance spec, you have to make sure that the resulting resistance isn't too low for your driver chips to handle. I don't remember what the CAN spec says that a driver chip must be able to do. At the very least, check the specs of the driver chips you are using. However, you can only go with that if all the devices on the bus are known to use that driver chip.

Since you don't know how well the bus is terminated by 120 Ω at each end, keep it short. I would not use this termination method if you are pushing the limit of the bus length for whatever speed you are using.

\$\endgroup\$
  • \$\begingroup\$ "[the LED] can only take 3 mA max" - Incorrect. It can take 50mA (single channel, 40mA dual channel and de-rated at high temperatures, see chart 1). The 3mA is the worst case current required to turn the device on, that is the minimum drive current for reliable operation not the maximum allowed. \$\endgroup\$ – Andrew Sep 26 '16 at 13:27
  • \$\begingroup\$ @Andrew: Oops, fixed. The absolute maximum is as you say. The recommended operating current is 5 mA, and the minimum current guaranteed to operate the device is 3 mA. \$\endgroup\$ – Olin Lathrop Sep 26 '16 at 15:18
0
\$\begingroup\$

You can probably not use that in a reliable way. The main problem is that all manner of relays (and MOSFET drivers etc) have quite a long delay to turn them on/off. Reading the datasheet of AQW227, it is fairly quick but still has a turn-on time of 0.2ms and turn-off time at 0.5ms, given 5mA load. This is still very slow compared to the program execution speed of the average MCU. And I think you can expect higher currents than 5mA too? Making it slower still.

The problem is that the relay must be activated before any CAN traffic can be allowed. Meaning that the program that activates it must do so before any other CAN node has started. And another program in the other end of the bus must do the same. While all other nodes must not start. You need to add a lot of advanced, pointless complexity to manage that.

Sure, you could just have them all trying to send with "brute force" until there are no more bus errors, but that's a sloppy solution. You wouldn't be able to tell the difference between start-up "noise" and real bus errors.

Also the so-called "low" on-resistance of this particular component is actually very high for this application, up to 100 ohm, no accuracy guaranteed. So what actual value you end up with as termination seems quite arbitrary. The CAN bus is rugged, but I bet you could get issues with this at higher baudrates.

All in all, messy and unreliable.

What you could probably use instead, is an analog switch with minimal on-resistance and much faster toggle times. See this similar problem with some suggested parts. (SN65HVD232 means he is using 3.3V levels too)


Now imagine how simple things would be if you would just put a 120 ohm resistor and a header strip with a jumper option on every node :)

\$\endgroup\$
  • \$\begingroup\$ What does the speed of the relay have to do with anything? You don't switch it in and out during transmission, you will turn it on or leave it off when booting and leave it in that state for the duration of the device's powered state. Your comments about trying to figure out whether to have the relay on or off are all valid though. \$\endgroup\$ – akohlsmith Sep 27 '16 at 14:53
  • \$\begingroup\$ @akohlsmith It has to do with everything, because the average embedded system starts up and is ready to go in far less time than 0.5ms. If the relays aren't in the right position by then, you'll immediately get bus errors. And no node can know when both relays are ready. \$\endgroup\$ – Lundin Sep 27 '16 at 14:59
  • \$\begingroup\$ There is nothing saying that the startup time for this application has any such requirement. \$\endgroup\$ – akohlsmith Sep 27 '16 at 15:01
  • \$\begingroup\$ @akohlsmith To have a spec saying that every node must start slower than 0.5ms, while some nodes (at the end) must not, would be a very special, odd requirement. And unacceptably slow in many kinds of applications, because at each CPU reset you would have to use the same weird delay. \$\endgroup\$ – Lundin Sep 27 '16 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.