1-Wire Humidity sensor + I/O-module

Around a PIC16F628 microcontroller a circuit is made to connect a SHT-11 
( two wire Humidity sensor of Sensirion ) on a 1-wire ( © Dallas semiconductor ) network.

Besides the Humidity connection there are 13 I/O pins for general I/O and a 32 bits counter available.

Figure 1 Block schematic

Features

  1. 13** TTL-In/Outputs capable to drive 25mA
  2. Connection of a SHT11 Humidity/Temperature Sensor ( see: http://www.sensirion.com/ )
  3. 32 bits counter (resetable) input ( one of the 13 inputs )
  4. 1-Wire input, 64 bits id, multidrop
  5. 4 x 32 bytes Eeprom to store user-info
  6. Simple low cost 'one-IC' design
  7. Low power: 3mA with no I/O port current, 4mA while converting.
  8. Internal 'watchdog circuit', watching for a running processor

** When a SHT11 sensor is used, 11 I/O pins are free

See for the schematic: schematic.gif.  

Information in PDF format: 1-WireIOPort.pdf

HEX-file for a PIC16F628: HexFile  ( after download rename the file to .hex )

 

Figure 2 Prototype of the 1-Wire SHT11 humidity sensor / IO port

The unit is controlled by the 1-Wire protocol of Dallas semiconductor.
Some basic commands are build in the PIC16F628.

Build in commands

ROM-functions:

Read ROM

0x33

Match ROM

0x55

Skip ROM

0xCC

Search ROM

0x0F

Memory / Control commands

Command

Value

Description

Write Scratchpad

0x4E

Till 32 bytes can be written to the internal scratch memory

Read Scratchpad

0xBE

Till 32 bytes can be read from the internal scratchpad ( no CRC )

Copy Scratchpad

0x48

32 bytes are written to the Eeprom ( takes till 50mS ) ( 4 pages )

Recall EEprom

0xB8

32 bytes from Eeprom are copied into the scratchpad ( 4 pages )

     

Convert Sensor

0x44

Starts a conversion of the SHT11 sensor ( Takes apr. 300mS )

Read Sensor

0x45

Reads the SHT11 conversion results ( 10 bytes )

     

Reset Counter

0x01

Resets the 32 bits counter to zero

Read Counter

0x02

Reads the 32 bits counter ( message of 6 bytes ). Counter-input is PortA_4

Read IO-identification

0x03

Read the IO-module identification

     

Setup PortA

0xF3

Sets the Port A pins to be Input or Output

Setup PortB

0xF4

Sets the Port B pins to be Input or Output

     

Read PortA

0xF5

Reads the contents of PortA ( inputs PortA_0..PortA_4), 6 bits

Read PortB

0xF6

Reads the contents of PortB ( inputs PortB_1..PortB_7), 7 bits

     

Write PortA

0xF7

Writes the value to PortA, 6 bits

Write PortB

0xF8

Writes the value to PortB, 7 bits

On request a complete description of the commands can be send.

Applications

  1. Humidity and temperature measurement with one circuit
  2. Extend the number of I/O pins in your ( TINI ) 1-Wire network / circuit
  3. Counter input for windspeed / raingauge
  4. 1-Wire printerport
  5. LCD connection