Feb
13
2013
0

Update – Bosch BMP085 Source (Raspberry Pi)

I have updated my code to Read data from a Bosch BMP085 with a Raspberry Pi to correct some bugs reported back to me.

The main bug was that I’d forgotten to close the i2c file at the end of bmp085_ReadUP() – This shouldn’t have caused any problems if you were calling the function once per execution, but if calling it multiple times, it may crash. On the same note, if you are calling the functions multiple times, you may want to move the opening and closing of the i2c file outside of the functions so the files aren’t opened and closed multiple times. Thanks to Radu P for reporting these issues.

It looks like lm-sensors.org is back up now, but if not, you can find a locally hosted copy of smbus.c and smbus.h in this earlier blog post.

Note that I’ve written a number of posts on using this sensor. Here is a link to all posts on the topic.
(more…)

Written by John Burns in: Electronics,Projects,Raspberry Pi,Weather Station |
Dec
17
2012
0

Update – Reading data from a Bosch BMP085 with a Raspberry Pi

Since my earlier post on Reading data from a Bosch BMP085 with a Raspberry Pi, the lm-sensors.org website has gone down.

If you need smbus.c or smbus.h, here are copies from back in August 2012.

Note that I have made some changes to smbus.c:

  • Defined NULL
  • Changed the path for including smbus.h

Here are the two files:

Written by John Burns in: Electronics,Projects,Raspberry Pi,Weather Station |
Nov
01
2012
5

Update – Reading data from a Sensirion SHT1x with a Raspberry Pi

After a few comments regarding my code to read data from a Sensirion SHT1x with a Raspberry Pi, I’ve got some updated code.

Please see my previous post for general information, but use the code here.

The list of changes are:

  • Added Dewpoint calculation from Page 9 of Datasheet
  • Updated Humidity calculation Coefficients to recommended (12 bit) figures from Page 8 of Datasheet
  • Updated Temperature calculation Coefficients to recommended (3.3 Volt Interpolated) figures from Page 9 of Datasheet

Any references to the datasheet refer to the Version 5, Dec 2011 datasheet found on Sensirions website.

Also note that the bcm2835 GPIO library has been updated and is now version 1.8 – Get the updated version from http://www.open.com.au/mikem/bcm2835/.
(more…)

Aug
26
2012
4

La Crosse TX23U Anemometer Communication Protocol

I’ve previously documented the protocol of the La Crosse TX20 Anemometer, but mine recently failed.

The La Crosse TX23U Anemometer is almost half the price of the TX20, so I decided to buy one and see if I could decode the protocol.

The big difference between the TX20 and the TX23U is that the TX20 will send a datagram every two seconds (when the DTR line is pulled low), while the TX23U won’t send anything until triggered by briefly pulling the Data line low.

Here’s everything you’ll ever want to know about the pin out and the communications protocol of the La Crosse TX23.
(more…)

Written by John Burns in: Electronics,Projects,Raspberry Pi,Weather Station |
Aug
13
2012
7

Reading data from a Sensirion SHT1x with a Raspberry Pi

Note: An updated version of my code is available at http://www.john.geek.nz/2012/11/update-reading-data-from-a-sensirion-sht1x-with-a-raspberry-pi/

The Sensirion SHT1x range of sensors provide a rather convenient way to accurately measure Temperature and Relative Humidity.

They aren’t the cheapest sensors as they typically sell for around $40, but they seem very accurate. I obtained a Sensirion SHT11 a while back as a free sample. I’d managed to get it working with an AVR ATMEGA328P for a planned project to build an Incubator, but now I wanted to read data from it using the GPIO of a Raspberry Pi.

I decided to keep the SHT11 allocated to my Incubator and bought an SHT15 for my weather station. The sensors are very similar. The data sheet shows that the SHT11 has an accuracy of ±3% Relative Humidity and ±0.4° Centigrade while the SHT15 is slightly better at ±2%RH and ±0.3°C. The communication interface is identical so no problems changing sensors in the future.

Before you can use my code sample, you’ll need to get the latest BCM2835 Raspberry Pi GPIO Library from http://www.open.com.au/mikem/bcm2835/ and wire up the sensor to the Raspberry Pi GPIO port.
(more…)

Aug
02
2012
9

Reading data from a Bosch BMP085 with a Raspberry Pi

Update(2): I’ve fixed some reported bugs in this code. Please use the newer version here.

Update: If the LM Sensors website is still down, you can get smbus.c and smbus.h from here.

I needed a way to measure air pressure as part of my Raspberry Pi controlled weather station.

I decided to use the Bosch BMP085 as it is very sensitive (down to 0.03hPa, or 3Pa) and SparkFun Electronics offer it already soldered to a break out board making it relatively easy to interface.

The breakout board includes pull up resistors on the Data and Clock lines, so it’s a simple four wire connection to the Raspberry Pi.

Breakout Board pin Raspberry Po GPIO Pin
SDA P1-03 / IC20-SDA
SCL P1-05 / IC20_SCL
XCLR Not Connected
EOC Not Connected
GND P1-06 / GND
VCC P1-01 / 3.3V

I had real trouble talking to the sensor using the standard file write and file read commands. I was having to do multiple reads to get usable data, but I noticed that the i2cget and i2cset commands worked perfectly every time.

I took a look at the i2cget and i2cset source code and noticed it was using smbus to talk to the sensor. A little further delving and I had a working solution.
(more…)

Written by John Burns in: Electronics,Raspberry Pi,Weather Station |
Jul
05
2012
0

A new toy to play with

Look what I received in the mail today….

A shiny new Raspberry Pi single board computer.

These things are revolutionising the world of embedded electronics – They have a 700MHz ARM processor, 256MB RAM, Two USB Ports, HDMI and Composite video outputs, Audio output, use an SD Card for storage, use less that 3.5 Watts of power and (drum roll please…..) 100 Megabit ethernet built in.

All this for under $50 New Zealand Dollars.

Oh I almost forgot, they also provide 8 GPIO pins plus access to I²C, SPI and UART Interfaces through a 26 pin Header on board.

First up, get it connected to a Sensirion SHT1x (SHT10, SHT11, SHT15) Temperature and Humidity sensor using the GPIO – Then I’ll be back on track to completing my Weather station project.

Watch this space….

Written by John Burns in: Projects,Raspberry Pi,Weather Station |
Jan
16
2012
0

Painting the Stevenson Screen

Over the weekend I finished building my Stevenson Screen. It’s based around a 300mm (1 foot) cube with a 45 degree pitched roof. The sides are covered with solid wood blinds with plenty of slots to keep the air moving.

My wife has been busy painting it for me. Ideally it should be painted in white, but I had plenty of light yellow paint (Dulux Weathershield X10) I purchased to paint my bee hives and I figure it’s pretty close to white.

If you're interested, the color is called "Cape Kidnappers" from the Dulux colours of New Zealand.

Written by John Burns in: Projects,Weather Station |
Jan
14
2012
0

Running the network cable for the Anemometer

Those who know me, know I don’t like doing things properly, so it was only natural that the Anemometer for my weather station was wired rather than using an RF link such as an XBee and a solar panel.

I obtained 100 metres of Underground rated CAT5E network cable. A lot of techie people have heard of Underground rated four core cable as it’s used by telephone companies to run the telephone cable through your front lawn to your house. The cable has a hard thick sheath to resist the elements and it’s filled with a sticky gel substance with the consistency of Vaseline.

Underground rated CAT5E network cable has a thick sheath and is filled with a waterproof Gel.


(more…)

Written by John Burns in: Projects,Weather Station |
Jan
08
2012
0

Earthing the Anemometer Pole

Once you’ve gone to the effort to install a six metre high Lightning Conductor in the middle of a paddock, you probably want to give it a good earth connection before wiring it into your home network.

I have a very handy source of steel framing, so a 2.4m (8 foot) length of Galvanised steel Cee section was used.

I initially thought I would be able to cut a point on the piece of steel and drive it into the ground – We’d had lots of rain recently so I figured they would drive in easy. The theory was sound down to about 30cm (1 foot) where it just wouldn’t budge. I wanted to drive it to just below ground level so ended up having to dig a 2.5m (8 foot, 4 inches) deep hole with my hand auger and then compress the soil back around the steel.

The earth stake is 2.4m (8 foot) long

Once the earth stake was in place, it was a simple task of running a very thick piece of copper wire to the pole – Unfortunately I never took photos of this, but I took about ten lengths of think copper flex, stripped off the insulation and then effectively plaited them into a “Super Macrame Wire(TM)”. This was attached to the steel stake using a number of bolts and to the pole using a big washer attached to the bolts that hold the pole up.

My assistant just stood there and ate dirt

Written by John Burns in: Projects,Weather Station |