Professional Documents
Culture Documents
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.
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.
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