BacktoBasics: I2C and Long distances

I usually get asked this by clients, “We want to use I2C to communicate with our sensors X meters away” where X is usually a large number. Please understand that this is usually a bad practice. You can do it but it’s not designed for it.


I2C or Inter-Integrated Circuit, when Philips Semiconductors invented it in the 1980s, it was meant to be used as a method to connect and send data between ICs inside a single PCB. It is intended for small distances inside the area of a PCB. Its goal was to reduce the number of parallel lines needed for talking between multiple chips dropping the required connection to just 2 lines. It was never meant for inter-PCB or long-distance communication.

Now for the cases you really want to use it for long ranges, here are 3 options I know of(If you know of any other tricks, drop them in the comments)

1. Use I2C repeaters like TIs P82B715, or LTC4311 or NXPs PCA95 series of chips. These act as buffers and can potentially drive signals to a distance of 50m when used as a twisted pair with individual return GND wires

2. Reduce I2C clock speed. The usual default speed is around 400KHz, you can keep dropping that to small speeds to increase the distance slightly but it will be in the 1-3m range

3. Have a strong I2C pullup on the lines(meaning lower resistance and pulled up to Vcc), this means that the RC time constant will be smaller and faster rise time. Search my older posts on the website on how to select the pullups for I2C. But this is not a great solution as you will increase your idle system power draw.

So the point is you can use I2C for longer lengths but look into it if you really want to, other serial protocols are designed specifically for long-range like CAN, Ethernet, Serial with RS485, etc. The next-gen of I2C, which is I3C, is looking to address this long-wire approach in the future specs of I3C.

If you liked the post, Share it with your friends!

BacktoBasics: LiPo Battery Protection Circuits

You have all heard that Lithium polymer batteries are dangerous if not handled properly. It’s so because of its high energy density and the chemical/mechanical structure of the battery. You have to ensure that the operating specs are maintained all the time. ie) Cell voltage shouldn’t exceed an upper or a lower limit, the current draw is maintained within a limit to adhere to the temperature specs. All these are made possible by a Battery Management System (BMS).


The most common chip you use for protection is a small 6-pin chip known as DW01(Available for less than $0.02). Check the schematic images. It’s usually paired with a Dual back-to-back MOSFET arrangement that gets controlled by DW01. You usually get this as a single IC package In normal operation both these MOSFETs are ON. For large charge/discharge currents, just connect multiple of these paired MOSFETs in parallel or use a pair of large power MOSFETs. You have 2 MOSFETs instead of one, because current can flow into a battery and out of it. When the MOSFET is OFF to disconnect, there can still be current flowing via the body diode which is prevented with with the Dual MOSFET setup.

Lets assume a charger that charges post the nominal cell voltage of a battery, the MOSFET M2 is turned OFF and the battery is cutoff from the charger. It’s turned ON when the battery either self-discharges or its voltage drops below a limit via a load. For the over-discharge case, when the battery falls below say 2.5V or so, M1 turns OFF and the load is disconnected from the battery. Now it turns back only when a charger pulls the voltage above 3V. It also has a short circuit current detector to cut off when a temp short happens.

So use the small protection circuit whenever you use a bare Lipo or Li-Ion cell. It’s very cheap to implement or buy off the shelf to add to your cell. Please don’t use a cell without it. It’s simply not worth the risk. I only talked about single-cell protection, for battery packs there are a lot of considerations, that I can go into in the future if there is interest.

If you liked the post, Share it with your friends!
1 36 37 38 39 40 118