RaspberryPi I2C sensor – capacitor’s role

capacitori2craspberry pisensor

I'm new here and the same goes to my electronics "history". I like to understand things I'm dealing with even if I wasn't provided with a sufficient knowledge background at schools.

What I'd like to ask is: is the capacitor a proper element on SDA line between the external sensor and the Raspberry Pi's SDA line?

I want to use a sensor interfacing it with I2C. I supply the voltage from 3V3 Pi's GPIO pin, the sensor works with both 3V3 and 5V levels. So far so good then. But I was told that due to the lack of more than one fuse/protection on Raspberry Pi, it's recommended to put the capacitor on SDA line, as close to the sensor's output pin as possible and of the biggest Voltage I'll find around. An I'd like to understand why, because what I know about the capacitors doesn't make it clear for me.
I know that the intention was to prevent unexpected peek (please correct me if I'm wrong) from damaging Pi's SDA pin. But isn't it true that the capacitor will stop as many Volts it has written on it and then it'll let the current go through, to the Pi's SDA input?

I'll be very grateful for some clarification or pointing me to the right directions, maybe topics I should understand on the way to find the answer.

Best Answer

isn't it true that the capacitor will stop as many Volts it has written on it

No.

Capacitors

It's the opposite of what you want. You want the protection device to pass low voltages and block or attenuate high voltages.

Capacitors are not designed to be used as fuses, therefore you cannot really use one as a substitute for a voltage or current limiting device to protect IC pins.

The voltage rating on a capacitor can't really be relied on in that way. I wouldn't be surprised if a specific 60V capacitor that passes a 60V AC signal also passes a 120V AC signal. The rating only means the manufacturer won't guarantee the cap works above 60 V, they certainly don't guarantee that it fail at exactly 61 V (say).

IO Protection

What you are looking for is a "voltage clamp" or perhaps a polyfuse or similar.

Arduinos also have this problem of unprotected IO. There are variants that include better protection which seem to me to be a useful example

From here

"Every I/O pin is protected by a 5.1V zener diode and 220 ohm 30mA PTC (resettable fuse). The equivalent circuit is shown in this figure" enter image description here

You'd have to adjust component values for a 3.3 V microcontroller or SoC such as the Rpi.


See also Pi GPIO protection - using (sacrificial?) buffers with ESD protection on a daughterboard.

Related Topic