Quantcast
Channel: ThingSpeak IoT Community - Forum: Arduino
Viewing all articles
Browse latest Browse all 172

habapa on What is wrong with I2C on edison with HTU21DF or MPL3115A2 or BMP280 ?

$
0
0
Hi everybody,

 

I am trying to build an teaching IoT-micro-weatherstation and I am facing problems with I2C sensors  or more probably Edison I2C behavior. I had faced some hardware problems few weeks ago so I have bought a new Edison mini-breakout and a set of new sensors from isweek:

HTU21DF

BME280

MCP9808

SI1145

MPL3115A2

BMP280

(I have also some other ones that are not involved in this question...)

 

First of all I am pretty sure that some months ago I have been abl to easily handle an HTU21D-F sensor with mraa and upm, then came the change in mraa that added a check on the communication between the Edison and the device that we overcome. But now the problem is worse the HTU21D-F is not detected any more !

 

I am using a level shifter to be shure to provide 1.8v signal on SDA and SCL pins of my minibreakout.

I am as sure as possible that my wiring is correct because I am using a breadboard with

SI1145 / MCP9808 / BME280 that are detected (I have not tried yet to get measurements)

on I2C bus 6 or BUS 1  I have activated bus 6 with these instructions:

echo 28 > /sys/class/gpio/export 

echo 27 > /sys/class/gpio/export 

echo mode1 > /sys/kernel/debug/gpio_debug/gpio28/current_pinmux 

echo mode1 > /sys/kernel/debug/gpio_debug/gpio27/current_pinmux

 

i2cdetect -y -r 6

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00:          -- -- -- -- -- -- -- -- -- -- -- -- --

10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- --

20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

70: -- -- -- -- -- -- -- 77                       

 

If I try to wire any of The three others one by one or in any combination I getno detection

i2cdetect -y -r 1

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00:          -- -- -- -- -- -- -- -- -- -- -- -- --

10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

70: -- -- -- -- -- -- -- --                 

 

Same result on bus 6 or 1 !!

 

I have tested the sensors on an arduino, they perform very well, I have tested HTU21D-F on an arduino breakout it does not work with the adafruit IDE test program and sends the message no sensor detected. With the demo program the sensor is detected but the values read are wrong (probably empty buffer).

 

I have read a little bit the forum and have seen that there are many questions dealing with I2C  buses, I can proove that "in many cases" everything works as expected but in some cases  the communication situation seems locked between the sensor and the edison. It is just like if the Edison was not able to "bring the sensor to communicate with him" To confirm this hypothesis I removed the

MPL3115A2 and left it away, after some minutes when I plugged it back It was detected without changing anything  :

 

i2cdetect -y -r 1

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00:          -- -- -- -- -- -- -- -- -- -- -- -- --

10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

70: -- -- -- -- -- -- -- --     

 

Just if the sensor came back spontaneously to a good state... I tried to plug the BMP280 and....It was detected!!!!!!!

 

i2cdetect -y -r 1

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00:          -- -- -- -- -- -- -- -- -- -- -- -- --

10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

70: -- -- -- -- -- -- -- 77

 

I am getting mad on this question, do you have any suggestion, as this is for teaching  K9-12 teachers I cannot resonably tell them : "unplug, wait for 4'47", then plug again it will work...."

 

Any help will be greatly appreciated, if needed I can do some tests and in teh meantime I will write the code to reas and compare measurements between sensors...

Thanks in advance and many thanks to all contributors and intel facilitators in this nice community.

 

G.


Viewing all articles
Browse latest Browse all 172

Trending Articles