How Can I Understand and Use Serial Clock for Humidity Sensor Communication?

  • Thread starter Thread starter georgeh
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around understanding and implementing the serial clock (SCK) communication protocol for a humidity sensor, specifically addressing the challenges faced by a participant who is unfamiliar with electrical engineering concepts. The conversation includes technical details about interfacing with the sensor, programming considerations, and hardware connections.

Discussion Character

  • Technical explanation
  • Homework-related
  • Debate/contested

Main Points Raised

  • One participant seeks clarification on how to manipulate the data line (SDA) while the serial clock (SCK) is high, indicating a lack of understanding of the serial communication process.
  • Another participant identifies the communication method as similar to I2C but notes that the specific humidity sensor's interface is not compatible with I2C.
  • There is a discussion about the physical implementation of the SCK and SDA lines, with questions about whether this is done through hardware like a breadboard or via programming.
  • Several participants discuss the need for a microcontroller to drive the SCK and DATA lines, emphasizing the importance of writing a program to control these outputs.
  • One participant mentions using LabVIEW for testing the sensor and inquires about the connection method to the PC, highlighting the need for a digital I/O card.
  • Another participant shares their experience with using a specific DAQ device and provides insights into their LabVIEW implementation, including sample code and configuration details.

Areas of Agreement / Disagreement

Participants express differing views on the specifics of the communication protocol and the hardware setup required. While some agree on the necessity of a microcontroller and digital I/O for interfacing, there is no consensus on the best approach or the exact implementation details.

Contextual Notes

Limitations include potential misunderstandings about the compatibility of the humidity sensor's communication protocol with standard interfaces like I2C, as well as the specifics of hardware connections and programming requirements that remain unresolved.

Who May Find This Useful

This discussion may be useful for individuals interested in sensor interfacing, programming microcontrollers, or using LabVIEW for data acquisition and control in experimental setups.

georgeh
Messages
67
Reaction score
0
http://www.sensiron.com/images/getFile?id=25
I am reading the following datasheet for a humidity sensor. But what I don't understand is how to "lower the data line while SCK is high, then following a low pulse on SCK and raising DATA again while SCK is still high"
SCK=serial CLock
where can i read how a serial clock works?
I am suppose to write a program for it, but i haven't taken any EE classes yet. :\
any help is appreciated.
 
Last edited by a moderator:
Engineering news on Phys.org
What you're describing is a two-wire interface called "I2C", or Inter-IC Communication. It's a standard, and was developed by Philips. The specification is not long, and is available on Philips' website. The following document is a little shorter than the spec, and will also answer any questions you might have:

http://www.mcc-us.com/i2cHowToUseIt1995.pdf

I can also answer any specific questions you might have about the interface.

- Warren
 
I should add that your assignment sounds like it might be fairly simple: the interface consists of two wires, one called SCK (serial clock) and one called SDA (serial data). To "lower" a wire is to drive it to a voltage near zero. A wire that is "high" is carrying a greater voltage, usually 2.5V, 3.3V, or 5V.

- Warren
 
in page2 of the humidity sensor pdf it states on the bottom:
The serial interface of the SHTxx is optimized for sensor readout and power consumption and is not compatible with I2C interfaces, see FAQ for details.
 
Okay, so it's not I2C, it's something else. It does, however, sound similar. "Lowering SDA while SCK remains high," in fact, is how one starts a transaction on an I2C bus.

I'm still not sure exactly what sort of help you need. Can you clarify?

- Warren
 
Well, the lower of the sck stuff. Is this done physically? meaning, via a breadboard or some electronics? If so, where can i read on this? I apologize for not being clear.
 
You connect two integrated circuits together. Perhaps your sensor will be read by a microcontroller (a small standalone processor). The microcontroller will have output drivers that can drive the SCK wire either high or low, at the request of a program. You write your program to control those output drivers in the proper fashion.

- Warren
 
georgeh said:
I am suppose to write a program for it, but i haven't taken any EE classes yet. .
What language are you writing in, and for what target processor? Are you writing for a particular microcontroller?

From the specs, it looks like you will need to bit-bang two lines with your uC. Your uC code needs to take care of driving the two IO lines to create the waveforms for SCK and DATA, and also take care of tri-stating the DATA line when you are supposed to be reading data back in from the transducer. Your program writes data to the IO port where you've mapped SCK and DATA, in order to make the waveforms shown in Figure 5 of the datasheet.
 
berkeman said:
What language are you writing in, and for what target processor? Are you writing for a particular microcontroller?
From the specs, it looks like you will need to bit-bang two lines with your uC. Your uC code needs to take care of driving the two IO lines to create the waveforms for SCK and DATA, and also take care of tri-stating the DATA line when you are supposed to be reading data back in from the transducer. Your program writes data to the IO port where you've mapped SCK and DATA, in order to make the waveforms shown in Figure 5 of the datasheet.
I plan on testing the humidity sensor using labview code. Platform? regular pc to test it out.
 
  • #10
georgeh,

But you haven't specified how you're going to connect your sensor to your PC. That seems to be the critical piece of the puzzle you're missing.

- Warren
 
  • #11
chroot said:
georgeh,

But you haven't specified how you're going to connect your sensor to your PC. That seems to be the critical piece of the puzzle you're missing.

- Warren
Agreed. Are you going to use a DIO card? Which one? What language are you going to be writing the code in? Labview CVI? I'm pretty sure that you will need to overlay an input with an output to get your bidir DATA signal, and I'm not even sure that you can tri-state a DIO output easily on the fly...
 
  • #12
If I were doing it, I'd use a Cypress EZ-USB microcontroller to connect it via USB to my PC. But that's just me.

- Warren
 
  • #13
For the purposes of this low-speed project, however, you could also use your PC's parallel port, or perhaps, with some clever coding, one of its serial ports.

- Warren
 
  • #14
Allright, so I got the details now. i am using a Ni-DAQ 6033-E card on a pc
hooked up to a connector block. I plan on using labview 8.0 and g code to make to test the sensor out.
 
  • #15
I sure hope you didn't pay for that NI card yourself! I have little experience with LabView though, so I cannot help you with your program. I can help you with the digital logic, however, if you need more help.

- Warren
 
  • #16
I wrote some LabView 8 code to communicate with the SHT15 with an NI USB-6008 DAQ device. I use the digital I/O lines. One line as SCK, two lines for DATA (one for writing, one for reading, both connected to the DATA line of SHTxx)
I used the sample code for microcontroller written in C (found on the website of Sensirion) to write the LabView driver. In the llb-file is a main.vi and main2.vi as a sample program.
The in the SubVi "DAQ_initialize.vi" you must change the "lines" to the lines you use in your DAQ-card (in the block diagram).
You need DAQmx from NI for your DAQ-card, but i think you use it already.
The maximum read-out rate with my DAQ-device is about every 660ms.
I hope i can help you.

*****RENAME the SHTxx_driver.m to SHTxx_driver.rar*******

Tessar :smile:
 

Attachments

Last edited:

Similar threads

  • · Replies 34 ·
2
Replies
34
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
27
Views
4K
  • · Replies 19 ·
Replies
19
Views
7K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 26 ·
Replies
26
Views
3K