Wiring help for 28018 Sensirion to Propeller BOE
smithdavidp
Posts: 146
I can't seem to find an entry point for Data lines to Pin28 (SCL 12C Clock) or Pin 29 (SDA 12C Data). The spin code shows both of these lines being used as clock reference and data output. I know that there is clock access at socket X at the J5 header (Serial side 4th on the right) but it seems that the data side is not accessable. Would the data pins at the AD/DA header (Sockets 0 and 1)be connected to pin 29? Did I buy the wrong thing?
Comments
Pins 28 and 29 are accessible on the bottom the PropBOE (you didn't mention which board you're using, so I assumed the PropBOE since your other post mention it). The "Surface Mount Playground" has all the Prop pins except 20 and 21 broken out to it.
You don't have to use pins 28 and 29 to communicate with the sensor. If you change the pins in the object and add pull-up resistors to those lines, you can use other Prop IO pins.
I think the object in the OBEX for the Sensirion humidity sensor is a bit out of date (though it should work). I think I may have a modified version using F32 which is the faster, smaller floating point object than the floating point object used in the OBEX version.
I'll see if I can find it and post it here.
The clock line is used to transfer data. The sensor will not work with the clock grounded.
I'll walk you through this if you'd like.
Are you using a serial LCD? If so what size?
The code I have uses a 4 x 16 (4 x 20 I don't remember right now) LCD. I have other LCDs as well.
If I can match your hardware, then we should be sure my software will work with your hardware.
Once I know your LCD size, I'll modify my code to match your hardware.
I'll use a different set of pins to communicate with the sensor than pins 28 and 29. Which two pins do you want to use?
I used P5 for I2C clock line and P6 for I2C data.
I used 10K pull-up resistors on both lines. (I'm not sure if they are needed or not.)
Here's want the output looks like.
The values are checked once a second. If there is a change from the previous values the new values are written to the terminal window.
This demo doesn't use the built in heater at all. I'm not sure if the object supports using the heat or not.
I tried this out on my PropBOE so hopefully it will work with yours.
@smithdavidp: Don't bother with anything related to the heater unless you plan on using it in a very high humidity environment or near/below freezing. I have a lot of code examples scattered across the forums, just use a google site restricted search using "sensirion" or "SHT" or "SHT11" as keywords. So enter this in a google search box:
sensirion sht site:forums.parallax.com
Also, I have some information and links to several other sites related to using the Sensirion on my former SHT11 Module page and on the forum thread about it.
Temp F = 85.7 F
Humidity = 15.8%
Dew Point = 1-1 C, 34.0 F
It works great!!!!! You sre the man Duane!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I'm glad it's working.
I'm not sure how much you know, so I don't know if you know what a "pull-up resistor" is.
Normally you wouldn't "replace" a pull-up resistor with a jumper wire, you'd just remove the pull-up resistor since it is used in addition to a jumper wire.
I should have explained the wiring I used better.
I used 3.3V for Vdd as you have it now. Vss connected to "GND" header.
The data lines were connected as you have them plus a 10K resistor running from the breadboard data and clock lines (one each) up to 3.3V.
I2C usually has both lines (clock and data) pulled high with the devices communicating driving the lines low when needed. This lets multiple devices share the same clock and data lines. Each device has an address to know when the uC is trying to communicate with it and not some other device on the bus.
You're welcome for the demo. I want to make it clear, I just wrote a little interface program to display the data to PST. The people who wrote the objects I used did, by far, most of the work.
@Andrew, Thanks for you kind words. I've used several of your projects as starting points for my own projects. Thanks for posting your work.