Notifications
Clear all

I2C help

5 Posts
3 Users
1 Reactions
54 Views
ZefD
 ZefD
(@zefd)
Member
Joined: 2 months ago
Posts: 13
Topic starter  

As many of you may know, I am working on a bot that uses the I2C communication system. I am not finding information to answer a question.

Information on the bot system, there will be 4 platforms, each with an Arduino to process various things. Platform one(base) uses a slave Mega 2560 and will run the four motors with encoders and sensors for collision avoidance.  Platform two uses a master Mega 2560 to coordinate all bot operations. Platform three will use a slave Arduino (board spec undecided) to process sensor data. Platform four will also use a slave Arduino (board spec undecided) to process sensor data and operator input. The I2C lines will be a bus with distribution nodes about 10 inches (2.54cm) apart on each platform to allow connection of up to 14 devices on each platform. (see photo below).

Back to the question, the I2C lines need to have pull-up resistors, the question is what value and where to put them on the lines? Do I put them only next to the master, as several pages suggest? Or should I put them on each node PCB? Also, should I add a power filter capacitor to each node as well?

20250501 145230

   
Quote
(@magicchristian)
Member
Joined: 4 years ago
Posts: 11
 

1. The location of the pullup Resistors can be where you like. On Data as well as Clockline there is only one  pullup nessary.

2. The value of that resistors depends on the capacity of the bus lines and the speed. For 100 or 400 KHz of clock speed and a capacity of about 100 pF 2 to 4 kOhm should be used.

3. There are detailed description for this issue in the Specification of I2C from Philips /NXP 

https://www.nxp.com/docs/en/user-guide/UM10204.pdf

Regards    Christian


   
ReplyQuote
ZefD
 ZefD
(@zefd)
Member
Joined: 2 months ago
Posts: 13
Topic starter  

@magicchristian Thank you for the data sheet, very informative. Also, thank you for the resistor information. I will see what values I have in my bin. I suspect a 1/4 watt with be enough? Or do I need to go high like a 1/2 watt?


   
ReplyQuote
(@davee)
Member
Joined: 4 years ago
Posts: 1963
 

Hi @zefd,

  The short answer is, your 1/4 Watt resistors will be fine as I2C pulldowns.

------

  To decide the power dissipation rating of a resistor, it is usually wise to do a quick (and approximate) calculation.

e.g. for an I2C pull up resistor, the maximum ("worst case") dissipation calculation, assume the I2C supply voltage is continuously placed across the resistor, which will occur if the driving chip(s) are pulling the line down to 0V.

--

Say the resistor is 2 kOhms (which is 2000 Ohms), and I2C voltage is 5V, then the formula is power dissipation P (in Watts) =  (V * V / R)

where V = 5V and R = 2000 Ohms

P = (5 * 5) / 2000 = 25/2000 = 1 / 80  .... 1/80th of a Watt  = 0.0125 W

So, a 1/4 Watt resistor can handle up to 20 times this amount of power.

...

And if you had chosen a 4 kOhm resistor, then the same calculation method would give:

P = (5 * 5) / 4000 = 25 / 4000 = 1/160 ... 1/160th of a Watt .... which is an even lower requirement.

------------

I hope this helps ... you might like to spend a few minutes trying to understand the method, as similar calculations occur very frequently, when designing electronic circuits.

Best wishes, Dave


   
ReplyQuote
ZefD
 ZefD
(@zefd)
Member
Joined: 2 months ago
Posts: 13
Topic starter  

@davee Thank you. I will be studying the formula and method for a deeper understanding. When I was in tech school, they only scratched the surface of theory. The focus was basic understanding of the control circuits and mostly programming of industrial robotics.


   
DaveE reacted
ReplyQuote