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

  • Thread starter georgeh
  • Start date
In summary: LabVIEW is a software development environment that is used for data acquisition and instrumentation control. It is written in C language and runs on Windows, Mac, and Linux platforms.- WarrenGeorgeh,Allright, so I got the details now. i am using a Ni-DAQ 6033-E card on a pchooked up to a connector block. I plan on using labview 8.0 and g code...LabVIEW is a software development environment that is used for data acquisition and instrumentation control. It is written in C language and runs on Windows, Mac, and Linux platforms.
  • #1
georgeh
68
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
  • #2
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
 
  • #3
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
 
  • #4
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.
 
  • #5
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
 
  • #6
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.
 
  • #7
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
 
  • #8
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.
 
  • #9
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

  • SHTxx_driver.m
    196.4 KB · Views: 187
Last edited:

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

1. What is a serial clock and how does it work?

A serial clock is a timing device used in electronic systems to synchronize the flow of data. It works by sending out regular pulses at a specific frequency, which is used to control the timing of data transmission. This ensures that data is transmitted and received accurately and at the same speed.

2. What is the purpose of a serial clock in a circuit?

The purpose of a serial clock in a circuit is to ensure that data is transmitted and received accurately and at the same speed. It also helps to control the timing of various operations within the circuit, making it more efficient and reliable.

3. How is a serial clock different from a regular clock?

A serial clock is different from a regular clock in that it is specifically designed for use in electronic systems to synchronize data transmission. Unlike a regular clock, which tells time, a serial clock is used to control the timing of data flow.

4. What are the components of a serial clock circuit?

The components of a serial clock circuit typically include a clock signal source, a counter, and a digital-to-analog converter. The clock signal source generates the pulses that control the timing, the counter keeps track of the number of pulses, and the digital-to-analog converter converts the digital signals into analog signals for transmission.

5. How is serial clock speed measured?

Serial clock speed is typically measured in hertz (Hz), which represents the number of pulses per second. The higher the frequency of the clock, the faster the data transmission speed. Serial clock speed can also be measured in bits per second (bps) or kilobits per second (kbps).

Similar threads

  • Electrical Engineering
Replies
34
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
1K
  • Other Physics Topics
Replies
2
Views
1K
  • Electrical Engineering
Replies
1
Views
881
Replies
27
Views
2K
Replies
1
Views
350
  • Electrical Engineering
Replies
2
Views
3K
Replies
23
Views
2K
Replies
5
Views
2K
  • Electrical Engineering
Replies
4
Views
1K
Back
Top