Arduino pro mini - Atmega168P - I2C

Hello experts, I am quite new to Arduino…

I am struggling with the I2C communication between Arduino Pro Mini (Atmega168P, 3,3V, 8MHz) and Si7021 (humidity and temp sensor). I am not able to run example codes. Serial print is working, values are like I receive zeros.

I am not able to establish the connection. I am not so acknowledged, can you please tell me, if my assumptions are correct? From available information I am confused.

When I would like to use I2C on Arduino pro mini, I have to use pull-ups on SDA and SCL cca 4,7K, am I right? What about internal pull-ups? Are these used or I have to add external one (currently I don!t use them)? Wires are around 10cm (4") long.

Which pins should I define for the I2C communication on the Pro Mini? SHould I define “A4” and “A5” or “4” and “5” only?

Thank you for any kick in the right direction…

Manufacturer’s page of the Si7021 http://www.silabs.com/products/sensors/humidity-sensors/Pages/si7013-20-21.aspx

The pins for I2C are fixed. They are A4 and A5, but you should not define them. Include the Wire library ( #include <Wire.h> ) and call Wire.begin().

10 cm wires is short, that is good.
Use external pullup resistors of 4k7 (or 10k). For testing, the internal pullup resistors is probably good enough.

Which example code did you try ? can you give a link to them ?

Start with the i2c_scanner : http://playground.arduino.cc/Main/I2cScanner
If the sensor is not detected, your I2C bus is not okay.

I thought the "Pro mini's" use the Atmega328 processor? (the 328 has 32k FLASH while the 168 has 16K according to the Atmel Atmega 328 summary datasheet
Section 2.2 Comparison between Processors. At least the "Pro Mini's" I see at Sparkfun.com show the 328

Koepel> Thanks for hints and links. Unfortunatelly I am not so acknowledged with datasheet reading. :frowning: I am trying to improve.

I own Si7021 Breakboard and pulups are presend for both lines. Between VCC and SDA and CLK I measure 10kOhms.

I found this library: GitHub - LowPowerLab/SI7021: Si7021 temperature & humidity sensor arduino library (sorry, don't know how to add this as hyperlink).

I will try the scanner, and then will try to solder it... Currently I am not sure if I have a good contacts in the solderless breadboard.

gpsmikey> I receive it as a gift... Maybe you're right I did not investigate it. Hopefully it is the same regarding pin layout.. :slight_smile: Thank you very much.

A Pro Mini clone with ATmega168P 3.3V 8MHz costs 1.13 euros on AliExpress.
A Pro Mini clone with ATmega328P 3.3V 8MHz costs 1.33 euros on AliExpress.
Someone saved 20 cents !

The only difference between the chips is that the 168 has less memory, but is it officially supported by the Arduino IDE.

Let us know what the scanner detected.

Oh, ok - I had only seen the ones on Sparkfun and not looked at the others. Sounds like both flavors exist in the wild out there (although for 20 cents, I know which I would get - I have NEVER seen memory requirements shrink in any kind of real project :slight_smile: )

I have several of the Chinese versions and found some to have the programming header pins in reverse order. It works OK by just flipping the board or the FTDI over. Also, there are at three different versions regarding the order and location of the pins that are not inline. However, they all worked.