Two MS5607's on one arduino
gsagers
Posts: 4
I'm fairly new to Arduino and the sensor world, but have made a couple of proejcts. My latest idea is to make a 2-zone greenhouse temperarture sensor/logger. I got a good deal on two MS5607 altimeter modules so I plan to use as them as temperature sensors, and either of them works great when connected to an Arduino Leonardo board (specifically, a tinkerkit LCD module). If I connect both to the arduino, neither works.
As near as I can tell, the problem is that both use the same 0x76 address for the I2C bus (verified with an I2C scanner program, one hooked up at a time). Some documentation found around the web suggests that the boards can be changed to use either 0x76 or 0x77, and one post shows a similar 5611 board from a different manufacturer that actually has solder pads to jumper to effect the change. I don't see any way in the datasheet or any place on the boards themselves to change this. Is there a way to change the Parallax mdel so one board uses 0x77?
If that's not possible, I have also seen passing references to "selectively enabling" each device, polling it, and then disabling it to poll the other in software. This would be fine for my purposes, as I only need readings every few minutes. Any suggestions on how to go about selectively enabling?
As near as I can tell, the problem is that both use the same 0x76 address for the I2C bus (verified with an I2C scanner program, one hooked up at a time). Some documentation found around the web suggests that the boards can be changed to use either 0x76 or 0x77, and one post shows a similar 5611 board from a different manufacturer that actually has solder pads to jumper to effect the change. I don't see any way in the datasheet or any place on the boards themselves to change this. Is there a way to change the Parallax mdel so one board uses 0x77?
If that's not possible, I have also seen passing references to "selectively enabling" each device, polling it, and then disabling it to poll the other in software. This would be fine for my purposes, as I only need readings every few minutes. Any suggestions on how to go about selectively enabling?
Comments
Welcome to the forums!
I don't use Arduino, but I think you can just use two pins for each CS (Chip Select), and bring them low one at a time when you what a measurement.
After reading the Data Sheet again, you are correct. The CS pin is only enabled in SPI mode, odd.
Do you have enough pins available to run two separate I2C busses?
Do you have the Parallax #29124 module? It supports all of the pins for either I2C or SPI modes.
Tracy,
I think that was one of the original question in the OP. Can you change the address on the Parallax product. I don't see a way to do that.
The CS is brought out on pin 7 and by default is pulled high by a resistor on the module. In I2C mode that selects address $76. Pull it low and you have address $77.
Pin 3 on the module (PS) selects the interface. By default it is pulled high by a resistor on the module. That selects the I2C interface and makes the pins SDA and SCL active. Pull PS low to select the SPI interface. In SPI mode, CS becomes chip select, and SDA and SCL become SDI and SCLK respectively.
But Publison made me think of an interesting point: can you have more devices as long as you can dynamically control the CS pin? I'm thinking you keep all the devices in $76 address. When you want to read a single device, you set it's CS pin to $77 address. It seems like this should work. The $76 devices don't put anything on the bus, and only respond to requests for the $76 address which will never come.
If it's possible, it seems to only be a pin savings if you have an odd number of sensors that you want to use. If you have an even number you might as well just use multiple I2C buses (at least with the Propeller).
Tracy,
Where did you find that information? I could not find it in any of the documentation Parallax supplied.
This need to be added to the Data Sheet.
Jim
It's on page 11 of the MS5607 datasheet:
I'll have to bring that into the "reading room" in the morning to digest that..
It would be interesting to try pulling the pin low when needed, rather than permanently, to save pin count, but for my application, I don't suppose I'll bother; I have headers to spare.
The prototype in action....
I've also used the MS5803 version of the pressure sensor, which is packaged in a TO5-size can and filled with gel for environmental protection, same firmware.
SRLM's suggestion could be implemented with a shift register or i2c port exander, so as not to use up so many CPU pins. I can imagine where you might want muliple pressure sensors for test chambers or something like that.