Weblog Tomasza Przechlewskiego [Zdjęcie T. Przechlewskiego]


scrum
random image [Photo gallery]
Zestawienie tagów
1-wire | 18b20 | 1wire | 2140 | 3rz | alsamixer | amazon | anniversary | antypis | apache | api | applebaum | arm | armenia | astronomy | asus | atom.xml | awk | aws | bachotek | bakłażan | balcerowicz | balta | bash | berlin | bibtex | bieszczady | biznes | blogger | blogging | blosxom | bono | borne-sulinowo | breugel | bt747 | budapeszt | bursztyn | canon | cedewu | chello | chiller | chillerpl | chown | chujowetaśmy | ciasto | cmentarz | contour | cron | css | csv | curl | cycling | d54250wykh | dbi | debian | dejavu | dhcp | dht22 | dia | docbook | dom | ds18b20 | dyndns | dynia | ebay | economy | ekonomia | elka | elm | emacs | emacs23 | english | ess | eu | excel | exif | exiftool | f11 | fc | fc11 | fc15 | fc29 | fc5 | fc8 | fedora | fedora21 | fenix | ffmpeg | finepix | firefox | flickr | fontforge | fontspec | fonty | food | fop | foto | france | francja | fripp | fuczki | fuji | fuse | gammu | garmin | gawk | gazwyb | gdańsk | gdynia | gender | geo | geocoding | georgia | gft | git | github | gmail | gmaps | gnokii | gnus | google | googlecl | googleearth | googlemaps | gotowanie | gphoto | gphoto2 | gps | gpsbabel | gpsphoto | gpx | gpx-viewer | greasemonkey | gruzja | grzyby | haldaemon | handbrake | historia | history | hitler | holocaust | holokaust | hpmini | humour | iblue747 | ical | iiyama | ikea | imap | inkscape | inne | internet | j10i2 | javascript | jhead | k800i | kajak | kamera | kleinertest | kml | kmobiletools | knuth | kociewie kołem | kod | kolibki | komorowski | konwersja | krutynia | kuchnia | kurski | latex | latex2rtf | latex3 | lcd | legend | lenny | lesund | lewactwo | liberation | linksys | linux | lisp | lisrel | litwa | lizbona | logika | ltr | lubowla | lwp | lwów | m2wś | malta | mapquest | mapsource | marvell | math | mathjax | mazury | mbank | mediolan | mencoder | mh17 | michalak | michlmayr | microsoft | monitor | mp4box | mplayer | ms | msc | mssql | msw | mswindows | mtkbabel | museum | muzyka | mymaps | mysql | nanopi | natbib | navin | nekrolog | neo | neopi | netbook | niemcy | niemieckie zbrodnie | nikon | nmea | nowazelandia | nuc | nxml | oauth | oauth2 | obituary | okular | olympus | ooffice | ooxml | opera | osm | otf | otftotfm | other | overclocking | ozbekiston | panoramio | pdf | pdfpages | pdftex | pdftk | perl | photo | photography | picasa | picasaweb | pim | pine | pis | pit | plotly | pls | plugin | po | podróże | politics | polityka | polsat | portugalia | postęp | powerpoint | prelink | problem | propaganda | pstoedit | putin | python | r | radio | random | raspberry pi | refugees | relaxng | ridley | router | rower | rowery | rpi | rsync | rtf | ruby | rugby | russia | rwc | rwc2007 | rwc2011 | rzym | samba | sem | sernik | sheevaplug | sienkiewicz | signature | sks | skype | skytraq | smoleńsk | sqlite | srtm | sshfs | ssl | staszek wawrykiewicz | statistics | stats | statystyka | stix | stretch | suwałki | svg | svn | swanetia | swornegacie | szwajcaria | słowacja | tbilisi | terrorism | tex | texgyre | texlive | thunderbird | tomato | totalnaopozycja | tourism | tramp | trang | truetype | ttf | turkey | turystyka | tusk | tv | tv5monde | twitter | typetools | ubuntu | uchodźcy | udev | ue | ukraina | umap | unix | upc | updmap | ups | utf8 | uzbekistan | varia | video | vienna | virb edit | vostro | wammu | wdc | wdfs | webcam | webdav | wh2080 | wiedeń | wikicommons | wilno | win10 | windows | windows8 | wine | wioślarstwo | word | wordpress | wrt54gl | ws1080 | wtyczka | ww2 | www | wybory | wybory2015 | włochy | węgry | xemex | xetex | xft | xhtml | xine | xml | xmllint | xsd | xslt | xvidtune | youtube | yum | zakopane | zakupy | zdf | zdrowie | łeba | świdnica | żywność
Archiwum
O stronie
wykorzystywany jest blosxom plus następujące wtyczki: tagging, flatarchives, rss10, lastbuilddatexhtmlmime. Niektóre musiałem dopasować nieco do swoich potrzeb. Więcej o blosxom jest tutaj
Subskrypcja
RSS 1.0
Raspberry Pi: BMP085 pressure/temperature sensor




My BMP085 sensor

Yesterday I have got a letter containing BMP085 pressure sensor which I bought on ebay on November 20th 2012 (yes the post made a history with +50 days delivery from China).

To connect BMP085 to RPI first one has to install (in case both packages are not installed yet):

pi@raspberrystar ~ $ sudo apt-get install i2c-tools
pi@raspberrystar ~ $ sudo apt-get install python-smbus

Now one has to enable i2c in raspbian. First one has to add the user pi to the group i2c:

pi@raspberrystar ~ $ sudo adduser pi i2c

Next one has to check the contents of /etc/modprobe.d/raspi-blacklist.conf and /etc/modules:

pi@raspberrystar ~ $ less /etc/modprobe.d/raspi-blacklist.conf
# blacklist spi and i2c by default (many users don't need them)

blacklist spi-bcm2708
blacklist i2c-bcm2708

pi@raspberrystar ~ $ less /etc/modules
...
i2c-dev
i2c-bcm2708

Some users advocate to remove i2c-bcm2708 from blacklisted modules but this seems unneccessary as:

pi@raspberrystar ~ $ lsmod | grep i2c
i2c_bcm2708             3542  0 
i2c_dev                 5587  0 

so I have i2c_bcm270 w/o modifying /etc/modprobe.d/raspi-blacklist.conf

Reboot now to activate the new settings

Hardware

The board my sensor came on has eight pins. There are boards with 6 pins as well which seems to be more popular. Only four out of 8 pins are used and the connections are as follows (see pictures):
GND goes to Ground on the Pi (P1-05)
3.3 goes to 3V3 on the Pi (P1-01)
SDA goes to SDA on the Pi (P1-02)
SCL goes to SCL on the Pi (P1-03)

In Reading data from a Bosch BMP085 with a Raspberry Pi 6-ping sensor is used and the pins connections are different. I have tried but it does not work for my sensor.

I connect sensor to RPI using wires with female jumpers on both ends.

To check if the sensor (or other i2c device) is connected correctly, one can run i2cdetect:

pi@raspberrystar ~ $ i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- 77                

77 in the last row indicates that sensor is connected properly (otherwise the output will consists of rows of '--' only).

Software

To get data from the sensor one has to install Adafruit-Raspberry-Pi-Python-Code or compile small C program available here:

## Download john.geek's C application:
wget http://www.john.geek.nz/wp-content/uploads/2012/08/testBMP085.c
wget http://www.john.geek.nz/wp-content/uploads/2012/12/smbus.c
wget http://www.john.geek.nz/wp-content/uploads/2012/12/smbus.h

## Compile & run it
gcc -Wall -o testBMP085 ./smbus.c ./testBMP085.c
./testBMP085

## Download >Adafruit's one:
git clone https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git
cd Adafruit-Raspberry-Pi-Python-Code
cd Adafruit_BMP085

## Run
python Adafruit_BMP085_example.py

Note: testBMP085 works with sensor connected to RPi as described in this post (not as described by john geek).

BTW: the pressure is identical as reported by my WH 2080 weather station. Perhaphs WH 2080 use exactly the same sensor!

url | Wed, 16/01/2013 11:12 | tagi: , ,