{"id":14575,"date":"2013-12-28T18:00:11","date_gmt":"2013-12-28T18:00:11","guid":{"rendered":"https:\/\/www.diaryofanadi.co.uk\/?p=14575"},"modified":"2013-12-28T18:00:11","modified_gmt":"2013-12-28T18:00:11","slug":"raspberry-pi-computer-and-barometers","status":"publish","type":"post","link":"https:\/\/diaryofanadi.co.uk\/?p=14575","title":{"rendered":"Raspberry Pi Computer &#8211; And Barometers"},"content":{"rendered":"<p>The <a title=\"Raspberry Pi\" href=\"http:\/\/en.wikipedia.org\/wiki\/Raspberry_Pi\" target=\"_blank\" rel=\"noopener noreferrer\">Raspberry Pi<\/a> was released about 18 months ago, and I was fascinated by it all the way up to that release. I had one pre-ordered, and it arrived late last summer (2012). For anyone who doesn\u2019t know, it is a tiny, single-board computer which was designed to sell for $25 (or $35 for the higher-spec version). The photo below is misleading \u2013 it looks huge, but the board is only 8.5cm long, which is not much bigger than a credit card.<a href=\"https:\/\/www.diaryofanadi.co.uk\/wp-content\/uploads\/2013\/12\/raspberry_pi.jpg\"><img decoding=\"async\" title=\"The Raspberry Pi mainboard\" style=\"--smush-placeholder-width: 524px; --smush-placeholder-aspect-ratio: 524\/351;border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: left; padding-top: 0px; padding-left: 0px; margin: 5px 10px 5px 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"The Raspberry Pi mainboard\" data-src=\"https:\/\/www.diaryofanadi.co.uk\/wp-content\/uploads\/2013\/12\/raspberry_pi_thumb.jpg\" width=\"524\" align=\"left\" height=\"351\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\"><\/a><\/p>\n<p>It is <a title=\"Raspberry Pi Foundation\" href=\"http:\/\/en.wikipedia.org\/wiki\/Raspberry_Pi_Foundation\" target=\"_blank\" rel=\"noopener noreferrer\">British-designed, and the main purpose<\/a> of the registered charity behind it was to help teaching computers in schools. As of October 2013, <a title=\"1.75 million sold so far - and 1 million made in the UK\" href=\"http:\/\/www.raspberrypi.org\/archives\/5016\" target=\"_blank\" rel=\"noopener noreferrer\">1.75m Pi boards have been sold<\/a> \u2013 1m of which were made in the UK.<\/p>\n<p>Now, as I\u2019ve explained before, I am a gadget freak. For me, owning a gadget is about 80-90% (maybe a bit more) as satisfying as actually using it. To that end, my Raspberry Pi has remained in its original packaging since I got it last year waiting for me to get the necessary urge to take it to the next level.<\/p>\n<p>Changing the subject for a moment, over Christmas I was searching the web for a suitable barometer which would interface with my normal PC so that I could log the data. I <img decoding=\"async\" title=\"BMP085 Module\" style=\"--smush-placeholder-width: 237px; --smush-placeholder-aspect-ratio: 237\/244;border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: left; padding-top: 0px; padding-left: 0px; margin: 5px 10px 5px 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"BMP085 Module\" data-src=\"https:\/\/www.diaryofanadi.co.uk\/wp-content\/uploads\/2013\/12\/bmp085.jpg\" width=\"237\" align=\"left\" height=\"244\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\">didn\u2019t want a full weather station \u2013 I\u2019m not that big an anorak \u2013 just a barometer. But I couldn\u2019t find one.<\/p>\n<p>Next, I had the idea that there might be a module I could buy and tinker with. And there was \u2013 the BMP085. It contains pressure, altitude, and temperature sensors. Things were a bit confusing for a while, because the name \u201cArduino\u201d kept cropping up. Of course, after I actually <a title=\"Arduino\" href=\"http:\/\/en.wikipedia.org\/wiki\/Arduino\" target=\"_blank\" rel=\"noopener noreferrer\">looked it up<\/a>, I realised that it&nbsp; is a single board microcontroller (actually, there are various models), developed in Italy, which is used to experiment with and prototype electronic systems. All of a sudden, the prospect of a nice little nerd project started to grab me by the throat, and I began to curse myself for not looking into this before Christmas because of the delayed post I would now have to live with. But after a few moments at the very shallow end of the Arduino pool, it suddenly occurred to me: I wonder if my Raspberry Pi could do this? And it turns out, it can. So it was time to get it up and running\u2026<\/p>\n<p><strong><span style=\"text-decoration: underline\">Step 1 \u2013 The Parts<\/span><\/strong><\/p>\n<p>These are just to get the Raspberry Pi up \u2013 the barometer will come later (after I get the extra bits delivered):<\/p>\n<ul>\n<li>Raspberry Pi <\/li>\n<li>USB keyboard <\/li>\n<li>USB mouse <\/li>\n<li>SDHC card <\/li>\n<li>HDMI cable <\/li>\n<li>Power supply unit <\/li>\n<li>Ethernet cable <\/li>\n<\/ul>\n<p>I already had all the parts (I bought the PSU at the same time as the Pi). I connected everything up except for the SDHC card, Ethernet, and PSU at this stage, using one of the free HDMI ports on my TV for display purposes.<\/p>\n<p><strong><u>Step 2 \u2013 The Operating System<\/u><\/strong><\/p>\n<p>The Pi has no permanent storage on-board \u2013 no disk drives or anything (though it (Version B) does have 512MB of RAM). The SDHC card is the storage medium, and when you get it it is effectively blank (or contains old stuff if it\u2019s been sitting in your box of bits like mine has). It has to be formatted properly, and then have an OS installed on to it. There is a <a title=\"Setting up a Raspberry Pi with NO\" href=\"http:\/\/learn.adafruit.com\/setting-up-a-raspberry-pi-with-noobs\/you-will-need\" target=\"_blank\" rel=\"noopener noreferrer\">useful guide on Adafruit<\/a> which explains how to do this. Adafruit provides an easy way \u2013 there are plenty of others which revel in command line Linux commands, but that probably explains why the forums are full of people complaining their Pi doesn\u2019t work.<img decoding=\"async\" title=\"My Pi in its swanky new case\" style=\"--smush-placeholder-width: 524px; --smush-placeholder-aspect-ratio: 524\/400;border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: left; padding-top: 0px; padding-left: 0px; margin: 5px 10px 5px 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"My Pi in its swanky new case\" data-src=\"https:\/\/www.diaryofanadi.co.uk\/wp-content\/uploads\/2013\/12\/pi_cased.jpg\" width=\"524\" align=\"left\" height=\"400\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\"><\/p>\n<p>First of all, I downloaded the <a title=\"SD Formatter 4.0 for SD\/SDHC\/SDXC\" href=\"https:\/\/www.sdcard.org\/downloads\/formatter_4\/\" target=\"_blank\" rel=\"noopener noreferrer\">SD Association formatter<\/a> to my PC and installed it. I put my card into my reader and formatted it as explained <a title=\"Quick Start Guide\" href=\"http:\/\/www.raspberrypi.org\/wp-content\/uploads\/2012\/04\/quick-start-guide-v2_1.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">in this document on the Raspberry Pi site<\/a>.<\/p>\n<p>Next, I downloaded <a title=\"New Out Of Box Software\" href=\"http:\/\/www.raspberrypi.org\/downloads\" target=\"_blank\" rel=\"noopener noreferrer\">NOOBS (offline and network install)<\/a>, extracted the files, and copied them on to the SDHC card, all as explained <a title=\"You Will Need\" href=\"http:\/\/learn.adafruit.com\/setting-up-a-raspberry-pi-with-noobs\/you-will-need\" target=\"_blank\" rel=\"noopener noreferrer\">in this link<\/a>. Then I put the card back into the Raspberry Pi\u2019s card port. The card now contains a bootable image which allows the OS to be installed.<\/p>\n<p>I connected the power cable and the Pi booted up first time. Following the instructions in the last link I selected Raspbian as the preferred OS and it installed flawlessly (took about 20 minutes). After rebooting, I followed the instructions <a title=\"Configuring Raspbian\" href=\"http:\/\/learn.adafruit.com\/adafruits-raspberry-pi-lesson-2-first-time-configuration\/overview\" target=\"_blank\" rel=\"noopener noreferrer\">in this link<\/a> to set it up the way I wanted it (I especially made sure I enabled SSH so I could talk to the PI from my PC). After rebooting again, it launched into a desktop similar to Windows.<\/p>\n<p>Next, I connected the Ethernet cable to link the Pi to my Virgin Media Superhub. Again, it immediately connected to the internet (and the system time corrected itself).<\/p>\n<p>Note: Using <a title=\"PuTTY download\" href=\"http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/download.html\" target=\"_blank\" rel=\"noopener noreferrer\">PuTTY on my PC<\/a>, having enabled SSH meant that I could log into my Pi using its IP address and use the command line interface from there.<\/p>\n<p><strong><u>Step 3 \u2013 Making the Pi\u2019s IP Address Static<\/u><\/strong><\/p>\n<p>Referring to <a title=\"Tutorial - How to give your Raspberry Pi a Static IP Address\" href=\"https:\/\/www.modmypi.com\/blog\/tutorial-how-to-give-your-raspberry-pi-a-static-ip-address\" target=\"_blank\" rel=\"noopener noreferrer\">this link<\/a>, I set my Pi to have a static IP address (i.e. one that doesn\u2019t change).<\/p>\n<p><strong><u>Step 4 \u2013 Installing a Remote Desktop Function<\/u><\/strong><\/p>\n<p>This is so I can control my Pi visually from my PC, which will avoid having to have the keyboard and mouse connected to such a tiny computer. I used <a title=\"Remotely Accessing the Raspberry Pi via RDP &ndash; GUI Mode\" href=\"https:\/\/www.modmypi.com\/blog\/remotely-accessing-the-raspberry-pi-via-rdp-gui-mode\" target=\"_blank\" rel=\"noopener noreferrer\">this tutorial to set it up<\/a> \u2013 but only the part where XRDP is installed on the Pi. Windows 7 already has a Remote Desktop program, and by running this and entering my Pi\u2019s login details I connected immediately. The Pi desktop as it appeared on my PC is shown below:<img decoding=\"async\" title=\"Raspberry Pi desktop as seen on PC\" style=\"--smush-placeholder-width: 524px; --smush-placeholder-aspect-ratio: 524\/329;border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: left; padding-top: 0px; padding-left: 0px; margin: 5px 10px 5px 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"Raspberry Pi desktop as seen on PC\" data-src=\"https:\/\/www.diaryofanadi.co.uk\/wp-content\/uploads\/2013\/12\/pi_desk.jpg\" width=\"524\" align=\"left\" height=\"329\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\"><\/p>\n<p>Note that there are limitations&nbsp; &#8211; I couldn\u2019t carry out the next step remotely and had to do it directly on the Pi. Leafpad just didn\u2019t want to open remotely.<\/p>\n<p><strong><u>Step 5 \u2013 Networking<\/u><\/strong><\/p>\n<p>At this stage, although the Pi could connect to the internet via the Superhub (that\u2019s why I could download the necessary programs referred to above), it wasn\u2019t visible as part of the network from my Windows PC. It pinged OK, but that\u2019s all. The Pi needs to have a Server Message Block protocol installed, and I found this link to Samba which provides that. Again, I followed the instructions and it worked first time. The only change I made was to set <font color=\"#008000\" face=\"Courier New\"><strong>public=yes<\/strong><\/font> so that I didn\u2019t have to use a password to access Pi from my PC each time. Now, I can see the entire Pi file set on the SD card via the network on my PC.<\/p>\n<p>The reason I did this was that I plan to write the barometer reading to a file on a regular basis and I want to be able to pick it up on my PC.<\/p>\n<p><strong><u>Next Steps<\/u><\/strong><\/p>\n<p>At the moment I have done as much as I can until the new parts arrive. I\u2019ll write an update when they do. The case has already arrived, and the picture above shows my Pi inside it.<\/p>\n<p>Incidentally, the Raspberry Pi is roughly equivalent to a P2 300MHz (circa 1997) in terms of power, but with better graphics. It certainly looks groovy when you\u2019re using a 50\u201d plasma TV as a monitor. It\u2019s great fun to play with.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Raspberry Pi was released about 18 months ago, and I was fascinated by it all the way up to that release. I had one pre-ordered, and it arrived late last summer (2012). For anyone who doesn\u2019t know, it is a tiny, single-board computer which was designed to sell for $25 (or $35 for the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[90],"tags":[],"class_list":["post-14575","post","type-post","status-publish","format-standard","hentry","category-computer-tech-related"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/diaryofanadi.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/14575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/diaryofanadi.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/diaryofanadi.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/diaryofanadi.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/diaryofanadi.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=14575"}],"version-history":[{"count":0,"href":"https:\/\/diaryofanadi.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/14575\/revisions"}],"wp:attachment":[{"href":"https:\/\/diaryofanadi.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=14575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/diaryofanadi.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=14575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/diaryofanadi.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=14575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}