Introduction

Welcome!

Hi there. Congratulations on being interested enough in the process of learning about measuring temperature with the Raspberry Pi to have gotten your hands on this book.

This will be a journey of discovery for both of us. By experimenting with computers we will be learning about what is happening in the physical environment. I know others have done this sort of thing, but I have an ulterior motive. I write books to learn and document what I’ve done. The hope is that by sharing the journey others can learn something from my efforts :-).

Ambitious? Perhaps :-). But I’d like to think that if you’re reading this, we’ve already managed to make some headway. I dare say that like other books I have written (or are currently writing) it will remain a work in progress. They are living documents, open to feedback, comment, expansion, change and improvement. Please feel free to provide your thoughts on ways that I can improve things. Your input would be much appreciated.

You will find that I eschew a simple “Do this approach” for more of a story telling exercise. Some explanations are longer and more flowery than might be to everyone’s liking, but there you go, that’s my way :-).

There’s a lot of information in the book. There’s ‘stuff’ that people with a reasonable understanding of computers will find excessive. Sorry about that. I have gathered a lot of the content from other books I’ve written to create this guide. As a result, it is as full of usable information as possible to help people who could be using the Pi and coding for the first time. Please bear in mind, this is the description of ONE project. I could describe it in 5 pages but I have stretched it out into a lot more. If we need to recreate the project from scratch, this guide will leave nothing out. It will also form a basis for other derivative books (as books before this one have done). As Raspberry Pi’s and software improve, the descriptions will evolve.

I’m sure most authors try to be as accessible as possible. I’d like to do the same, but be warned… There’s a good chance that if you ask me a technical question I may not know the answer. So please be gentle with your emails :-).

Email: d3noobmail+temp@gmail.com

Cover photo via Good Free Photos.

What are we trying to do?

Put simply, we are going to examine the wonder that is the Raspberry Pi computer and use it to accomplish something.

In this specific case we will be connecting several temperature probes to the Pi, measuring the values that they produce, recording them in a database and then making a graph out of that information that we can view on a web page!

Along the way we’ll;

  • Look at the Raspberry Pi and its history.
  • Work out how to get software loaded onto the Pi.
  • Learn about networking and configure the Pi accordingly.
  • Install and configure a web server and a database.
  • Write some code to interface with our temperature probes.
  • Make a web page that will make a pretty picture of our temperature readings.

Who is this book for?

You!

Just by virtue of taking an interest and getting hold of a copy of this book you have demonstrated a desire to learn, to explore and to challenge yourself. That’s the most important criteria you will want to have when trying something new. Your experience level will come second place to a desire to learn.

It may be useful to be comfortable using the Windows operating system (I’ll be using Windows 7 for the set-up of the devices). You should be aware of Linux as an alternative operating system, but you needn’t have tried it before. Before you learn anything new, it pretty much always appears indistinguishable from magic. but once you start having a play, the mystery falls away.

What will we need?

Well, you could just read the book and learn a bit. By itself that’s not a bad thing, but trust me when I say that actually experimenting with physical computers is fun and rewarding.

The list below is pretty flexible in most cases and will depend on how you want to measure the temperatures.

  • A Raspberry Pi (I’m using a Raspberry Pi Model B 2 / 3)
  • Probably a case for the Pi
  • A MicroSD card
  • A power supply for the Pi
  • A keyboard and monitor that you can plug into the Pi (there are a few options here, read on for details)
  • A remote computer (like your normal desktop PC that you can use to talk to connect to the Pi). This isn’t strictly necessary, but it makes the experience way cooler.
  • Some DS18B20 temperature sensors (the waterproof kind). They are available from lots of places. Google is your friend.
  • A 10k Ohm resister
  • Some soldering equipment
  • Some dupont connectors (that’s what I used, but you could connect to the Pi in different ways)
  • An Internet connection for getting and updating the software.

As we work through the book we will be covering off the different parts required and you should get a good overview of what your options are in different circumstances.

Why on earth did I write this rambling tome?

That’s a really good question. This is another project that I wanted to update from an earlier book (Raspberry Pi: Measure, Record, Explore) and to be brutally honest I picked it at random over other options. Writing the previous books in this series was an enjoyable process, so I thought that I’d carry on and continue to adapt the book for subsequent projects. This is book three in this series and I’ve updated it since it was written, so I suppose it’s a ‘thing’ by now. Will this continue? Who knows, stay tuned…

What I can tell you is that I now have a new benchmark for building my temperature measurement project and you have a book that tells you how I did it :-).

Included is a bunch of information from my books on the Raspberry Pi, Linux and d3.js. I hope you find it useful.

Where can I get more information?

The Raspberry Pi as a concept has provided an extensible and practical framework for introducing people to the wonders of computing in the real world. At the same time there has been a boom of information available for people to use them. The following is a far from exhaustive list of sources, but from my own experience it represents a useful subset of knowledge.

raspberrypi.org

reddit

Raspberry Pi Stack Exchange