You are on page 1of 4

A simple JeeNode Barometer

By David Taylor, GM8ARV


I had been looking for a way to record a few weather parameters on a casual basis for some time, and had already found indoor and outdoor temperature probes available on the Internet, and later an indoor temperature and humidity probe. However, pressure seemed to elude the Chinese makers of these probes, so in late 2011 I bought a wireless weather station which would have been ideal, were the software up to the same standard as the hardware. nfortunately, though, while the indoor display panel worked most of the time, it was so unreliable when interrogated by software that I sent the unit back for a refund. !uring my Internet e"plorations, I discovered a low# cost pressure sensor which was an add#on hardware to an $rduino compatible computer. %he discovery was the &ee'ode from &ee(abs) http*++,eelabs.com+products+,eenode -eeing .uy /artin0s recent article made me realise that this alternative approach may be of interest to .12 members, as only a very limited amount of non#surface#mount components is re3uired, and the programming model is the widely supported $rduino.

The JeeNode
&ee(abs offer a variety of formats of hardware, all designed for 4physical computing5 6i.e. real#world measurements7 and the hardware is designed to be very easy to connect together. %he main computing part is designed around $rduino compatibility, so there0s plenty of software available, and there is an e"tensive library of software to support the hardware boards you can add to a &ee'ode. I wanted to drive this from a 8C, so I chose a &ee'ode with a -9 port, but there is 3uite an interest in battery#powered &ee'odes which can be interrogated remotely with an :;: /H< => signal. %he &ee'ode can be programmed with the standard $rduino development environment, which is well described and well supported. %here is forum where you can get help if it0s needed. http*++arduino.cc+en+.uide+1nvironment %he development environment communicates with the &ee'ode via the -9 lead with a serial C2/ port emulation. 2nce your program 6in $rduino nomenclature, your sketch7 is running on the &ee'ode, the same C2/ port is available for the 8C to communicate with the &ee'ode.

Hardware
>or this pro,ect, I chose a &ee'ode with a -9 interface*

http*++,eelabs.net+pro,ects+hardware+wiki+&ee'ode? -9 http*++,eelabs.net+attachments+download+2;2 6photo7 and a 48ressure 8lug5* http*++,eelabs.net+pro,ects+hardware+wiki+8ressure?8lug http*++,eelabs.net+attachments+download+11@ 6photo7 which is based on a 9/80:A chip. Bou can get various multi#pin connectors to solder to the board to adapt the configuration to best suit your own needs C I used ,ust a single ;#pin header so that I could unplug the pressure sensor if re3uired. Bou can buy these boards ready#made 6as I did7, and there are some kit options if you have surface#mount facilities 6which I do not7.

Software
Getting data from the JeeNode
%here is sample code provided to drive the 9/80:A in a &ee'ode configuration, and all I had to do was to provide serial access to that data. /ost of the listing in $ppendi" 1 is simply copied from the sample provided. $s this is my first $rduino and first &ee'ode program likely I could have done things in a much better way. %he function I wanted was to be able to send a serial character to the board, and get back the pressure data. (ine D2 in the e"ecution loop waits until a character is received on the serial line. $ny character will do to elicit a response. (ines D;#@A get the current pressure 6and temperature7 reading, and calibrate it into the e"pected values. (ines @:#A; send the values back to the serial port, including a prefi" of the characters 49/85 and a carriage return suffi" so that you could read the data a line at a time.

Using the data


$s regular readers may recall, I am a fan of /=%. for simple graphing of data over both short and long intervals, so I wrote a small program which interrogates the &ee'ode, and returns data in a suitable form for /=%.. 8lease ask if you wish a copy of this program. $n alternative, should you wish a stand#alone unit such as .uy /artin described in .12#Euarterly D@, would be to add a compatible .raphics 9oard from the &ee(abs shop and program it appropriately. http*++,eelabs.com+products+graphics#board

Photos

&ee'ode9araometer.,pg C general view &ee'ode9araometer#8lan.,pg C looking down on the board. %he -9 connection is on the right, and the 6unused7 => interface on the left. %he pink wire is the antenna for the => interface. %he 8ressure 8lug is the s3uare board left of centre, and you can ,ust see a few of the pins from the surface#mount processor to the right of that board. %he chip right of centre is the >%!I serial to -9 chip. %here are red and green (1!s which flash when serial data is sent or received. &ee'ode9araometer#1levation.,pg C shows how the 8ressure 8lus is mounted above the main &ee'ode -9 board. %he black item is a multi#way socket allowing the 8ressure 8lug to be removed and different hardware substituted.

Appendix 1 code listing


(0 ) (1 ) (2 ) (+ ) (- ) (5 ) (0 ) (7 ) (8 ) (9 ) (10) (11) (12) (1+) (1-) (15) (10) (17) (18) (19) (20) (21) (22) (2+) (2-) (25) (20) (27) (28) (29) (+0) (+1) (+2) (++) (+-) (+5) (+0) (+7) (+8) (+9) (-0) (-1) (-2) (-+) (--) (-5) (-0) (-7) (-8) (-9) (50) (51) // Ports demo, reads out a BMP085 sensor connected via I2C // 2009-02-17 !c"#i$$%er&n%' (tt$)//o$ensource&or*/%icenses/mit-%icense&$($ // // // // 2010-05-22) 2010-05-25) 2010-00-17) 2010-00-2-) added su$$ort ,or a%% reso%ution modes e.tended to a%so /roadcast a%% readin*s over #ire%ess add $o#er savin* %o*ic, s(ou%d reduce consum$tion /1 over 902 im$roved $o#er savin*s, severa% 3(ot s$ots3 o$timi4ed

// see (tt$)//ne#s&!ee%a/s&or*/2010/00/20//atter1-savin*s-,or-t(e-$ressure-$%u*/ // see (tt$)//ne#s&!ee%a/s&or*/2010/00/+0/*oin*-,or-*o%d-#it(-t(e-/m$085/ 5inc%ude 5inc%ude 6ee7i/&(' PortsBMP085&('

PortI2C t#o (-)8 BMP085 $sensor (t#o, +)8 // u%tra (i*( reso%ution // 9(is $o#er-savin* code #as s(ame%ess%1 sto%en ,rom t(e rooms&$de s:etc(, // see (tt$)//code&!ee%a/s&or*/vie#vc/svn/!ee%a/s/trun:/!eemon/s:etc(es/rooms/ void setu$() ; <eria%&/e*in(57000)8 <eria%&$rint(3=n>/m$085demo?3)8 A $sensor&*etCa%i/@ata()8

void %oo$() ; // sensor readout ta:es some time, so *o into $o#er do#n #(i%e #aitin* // int+2Bt tra# C $sensor&measure(BMP085))9DMP)8 // int+2Bt $ra# C $sensor&measure(BMP085))PED<)8 i, (<eria%&avai%a/%e()) ; c(ar c( C <eria%&read()8 $sensor&startMeas(BMP085))9DMP)8 de%a1(10)8 int+2Bt tra# C $sensor&*etEesu%t(BMP085))9DMP)8 $sensor&startMeas(BMP085))PED<)8 de%a1(+2)8 int+2Bt $ra# C $sensor&*etEesu%t(BMP085))PED<)8 struct ; int10Bt tem$8 int+2Bt $res8 A $a1%oad8 $sensor&ca%cu%ate($a1%oad&tem$, $a1%oad&$res)8 // t(is code is not needed ,or use as remote node, :ee$ it ,or de/u**in* <eria%&$rint(3BMP 3)8 <eria%&$rint(tra#)8 <eria%&$rint(F F)8 <eria%&$rint($ra#)8

(52) (5+) (5-) (55) (50) (57) (58) (59) (00)

<eria%&$rint(F F)8 <eria%&$rint($a1%oad&tem$)8 <eria%&$rint(F F)8 <eria%&$rint($a1%oad&$res)8 <eria%&$rint(3=n3)8 A de%a1 (+00)8 A

You might also like