05.08.2012 Views

1-wire bus using Digitemp on Usb-serial TTL adapter with DS18B20 ...

1-wire bus using Digitemp on Usb-serial TTL adapter with DS18B20 ...

1-wire bus using Digitemp on Usb-serial TTL adapter with DS18B20 ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Inspired by<br />

http://h-wrt.com/en/doc/of<br />

Ebay <strong>adapter</strong>s < 3 USD:<br />

1-<str<strong>on</strong>g>wire</str<strong>on</strong>g> <str<strong>on</strong>g>bus</str<strong>on</strong>g> <str<strong>on</strong>g>using</str<strong>on</strong>g> <str<strong>on</strong>g>Digitemp</str<strong>on</strong>g> <strong>on</strong> USB-<strong>serial</strong> <strong>TTL</strong> <strong>adapter</strong><br />

<strong>with</strong> <strong>DS18B20</strong> temperature sensors and ADC<br />

This <strong>adapter</strong> is small in size. It ha s DSR, RTS, CTS, DCD, RI signals that can be soldered. This can be used<br />

to switch relays and have PIR input.<br />

http://www.mikroc<strong>on</strong>troller.net/articles/Ports_benutzen_%28GCC%29<br />

1EUR/piece or Maxim samples for free.<br />

Circuit below is not needed http://www.lecad.fs.uni-lj.si/~le<strong>on</strong>/other/wlan/wrt54ow/


Testing<br />

Miraculously works <strong>with</strong>out any transistors !!!<br />

Simplest and cheapest way to get your temperature !!!<br />

You need:<br />

1) <str<strong>on</strong>g>Digitemp</str<strong>on</strong>g> <strong>on</strong> OpenWRt router WR703N<br />

2) CP2102 USB-<strong>serial</strong> bridge <strong>TTL</strong> board. 2 USD <strong>on</strong> Ebay<br />

3) 1-<str<strong>on</strong>g>wire</str<strong>on</strong>g> sensors <strong>DS18B20</strong> & DS2438<br />

C<strong>on</strong>nect GND and 5V to <strong>DS18B20</strong>.<br />

c<strong>on</strong>nect RX and TX together and to the data line of 1-<str<strong>on</strong>g>wire</str<strong>on</strong>g>.<br />

C<strong>on</strong>nect pull-up 4.7 k from 5 V to data line. Actually I did not need pull-up resistor.


Multisensor <strong>with</strong> 3 m cable<br />

Finished low cost soluti<strong>on</strong>!<br />

3 m cable, single <strong>DS18B20</strong>. Covered <strong>with</strong> shrink tubing. Silic<strong>on</strong>e inside for sensor operati<strong>on</strong> outdoors or<br />

in water.


Programming<br />

opkg update<br />

opkg install digitemp<br />

# It is installed in this directory:<br />

cd /usr/bin<br />

/usr/bin/digitemp_DS9097 -i -s /dev/ttyUSB0<br />

DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane<br />

GNU Public License v2.0 - http://www.digitemp.com<br />

Turning off all DS2409 Couplers<br />

..<br />

Searching the 1-Wire LAN<br />

28CC5F0E0200005C : <strong>DS18B20</strong> Temperature Sensor<br />

26E27927010000E5 : DS2438 Temperature, A/D Battery M<strong>on</strong>itor<br />

ROM #0 : 28CC5F0E0200005C<br />

ROM #1 : 26E27927010000E5<br />

Wrote .digitemprc<br />

# read sensors and store in file<br />

digitemp_DS9097 -a -A -l 1<str<strong>on</strong>g>wire</str<strong>on</strong>g>_log<br />

# display file<br />

cat 1<str<strong>on</strong>g>wire</str<strong>on</strong>g>_log<br />

Jan 01 00:45:19 Sensor 1 VDD: 4.94 AD: 1.40 CAD: 3 C: 34.75<br />

Jan 01 00:45:25 Sensor 0 C: 24.88 F: 76.78<br />

Jan 01 00:45:26 Sensor 1 VDD: 4.93 AD: 1.38 CAD: 30 C: 34.25<br />

Jan 01 00:45:47 Sensor 0 C: 24.75 F: 76.55<br />

DS2438<br />

AD is humidity sensor<br />

CAD is photodiode<br />

C is built in temperature sensor<br />

VDD is battery m<strong>on</strong>itor

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!