Raspberry Pi: Measure, Record, Explore.
Raspberry Pi: Measure, Record, Explore.
Measure the world, record the data and display it graphically.
About the Book
Getting the real world to meet the digital one...
'Raspberry Pi: Measure, Record, Explore' is a book written to help those who want to get started interfacing computers with the physical world and turning recorded information into visual data.
Is this book an official Raspberry Pi product?
Nope. The Raspberry Pi Foundation is not involved in the production of the book. However, any and all readers should regard raspberrypi.org as the starting point for information on using and enjoying the fantastic products they are producing. They really are awesome and deserving of the success that is the Raspberry Pi.
Is this book for you?
It's not written for experts. It's put together as a guide to get you started if you're unsure about how to make the first move. It reads more like a story as it leads the reader through the basics of using a Raspberry Pi, connecting sensors, recording information into a MySQL database and presenting that data on a web page using d3.js.
Why was Raspberry Pi: Measure, Record, Explore written?
Because in the process of learning things, it's a great way to remember them if you write them down :-).
As a result, learning how to do cool stuff with a Raspberry Pi means that I'm accumulating ways to help me out when the going gets tricky. Making a book out of the information is a no-brainer since that way more people benifit from the process.
So here we are! A collection of tips and tricks for measuring, recording and exploring information written by a noob for people who might consider that they're in the same situation :-).
What's in the book?
I've captured the appropriate code and added in illustrations of what's going on so that you will get more traction at the start of your learning process.
Hang on, there's code?
The code examples that are used in the book are available to download (still free!).
The awesome that is Open Source.
Please consider this an opportunity for you to contribute back to the Open Source community that makes products like the Raspberry Pi possible. If you find something that can be improved about the book or think there's something that can be added, just let me know!
The book has plenty of information in it, but I've tried to pitch it in sections so that if you find something interesting, you can read parts in isolation. I have a little bit more additional material that I want to add, so I'm hoping that publishing using Leanpub will allow readers to get easy notification of when updates and improvements are made.
Download the whole book just to try it out!
I'm making the book available for free because I think it's a great way to give something back to the community as a whole, but if you find some value in the book, please consider contributing 99 cents when you download it so that Leanpub gets something for hosting the book and providing such an awesome service (50 cents is their flat cut of any book sales and 99 cents is the minimum (apart from $0) that they will allow for a sale).
(Don't be put off by the button at the top saying 'Buy the ebook now'. Once you click on it, you can select any price you want including $0!)
Enjoy.
So I hope you get something out of the book, please excuse the sometimes light-hearted conversational manner in which I approach the topic and enjoy measuring, recording and exploring the world in digital!
Bundles that include this book
Table of Contents
-
Introduction
- Welcome!
-
What are we trying to do?
- Measure
- Record
- Explore
- Who is this book for?
-
What tools / equipment will we use?
-
Raspberry Pi
- MySQL
- Apache Web Server
- PHP
- Python
- JavaScript
- d3.js
- Sensors
-
Raspberry Pi
-
Where can I get more information?
- raspberrypi.org
- Google+
- Google Groups
- Raspberry Pi Stack Exchange
- adafruit
-
Setting up the Raspberry Pi
-
Hardware
-
The Raspberry Pi
- Case
- SD Card
- Keyboard / Mouse
- Video
-
Network
- Power supply
-
The Raspberry Pi
-
Operating System
- Welcome to Raspbian
-
Sourcing and Setting Up
- Downloading
- Writing Raspbian to the SD Card
-
Installing Raspbian
- Software Updates
- GUI Desktop
-
Static IP Address
- The Netmask
- Distinguish Dynamic from Static
-
Setting a Static IP Address on the Raspberry Pi.
- Default Gateway
-
Edit the
interfaces
file
-
Remote access
-
Remote access via TightVNC
- Setting up the Client (Windows)
- Setting up the Server (Raspberry Pi)
- Copying and Pasting between Windows and the Raspberry Pi
- Starting TightVNC at boot on the Pi.
-
Remote access via SSH
- Setting up the Server (Raspberry Pi)
- Installing SSH on the Raspberry Pi.
- Setting up the Client (Windows)
-
Remote access via TightVNC
- Setting up a WiFi Network Connection
-
Web Server and PHP
- Tweak permissions for easier web file editing
-
Database
- MySQL
- phpMyAdmin
- Allow access to the database remotely
- Create users for the database
- Create a database
- Backup the Configured SD Card
-
Exploring data with a simple line graph
- The full code
-
PHP
- The code
-
HTML
- CSS
-
JavaScript and d3.js
- Setting up the margins and the graph area.
- Getting the Data
- Formatting the Date / Time.
- Setting Scales Domains and Ranges
- Setting up the Axes
- Adding data to the line function
- Adding the SVG area.
- Actually Drawing Something!
- Wrap Up
-
Hardware
-
Single Temperature Measurement
-
Measure
- Hardware required
- Connect
- Test
-
Record
- Database preparation
-
Record the temperature values
- Code Explanation
-
Explore
- The Code
- Different MySQL Selection Options
-
Measure
-
Multiple Temperature Measurements
-
Measure
- Hardware required
- Connect
- Test
-
Record
- Database preparation
-
Record the temperature values
- Code Explanation
-
Recording data on a regular basis with
cron
-
Explore
-
The Code
- PHP
- JavaScript
-
The Code
-
Measure
-
System Information Measurement
-
Measure
- Hardware required
-
Measured Parameters
- System Load
- Memory Used
- Disk Used
- Raspberry Pi Temperature
-
Record
- Database preparation
-
Record the system information values
- Code Explanation
- load
- ram
- disk
- temperature
- Main program
-
Recording data on a regular basis with
cron
-
Explore
- The Bullet Graph
-
The Code
- HTML / JavaScript
- PHP
-
Measure
-
Basic GPIO Input Sensors
-
Measure
-
Hardware required
- The KY003 Hall Effect Sensor
- Connect
- Test
-
Hardware required
-
Record
- Database preparation
-
Record the events
- Code Explanation
- Start the code automatically at boot
-
Explore
-
The Code
- PHP
- CSS (Styles)
- JavaScript
-
The Code
-
Measure
-
Pressure and Temperature measurement with the BMP180
-
Measure
-
Hardware required
- The BMP180 Sensor
- Connect
- Test
-
Hardware required
-
Record
- Database preparation
-
Record the readings
- Code Explanation
-
Recording data on a regular basis with
cron
-
Explore
-
The Code
- PHP
- CSS (Styles)
- JavaScript
-
The Code
- Bibliography
-
Measure
-
Connecting Analog Sensors to the Raspberry Pi
-
Analog and Digital
- Analog
- Digital
- Analog to Digital Conversion (ADC)
- The Sensor
- Data Visualization
-
Measure
-
Hardware required
- The ADS1015 Analog to Digital Converter
- The Light Dependant Resistor (LDR or Photoresistor) Sensor
- Connect
- Test
-
Hardware required
-
Record
- Database preparation
-
Record the readings
- Code Explanation
-
Recording data on a regular basis with
cron
-
Explore
-
The Code
- PHP
- CSS (Styles)
- JavaScript
-
The Code
- Bibliography
-
Analog and Digital
-
Web Scraping
- OK, so what is web scraping?
-
Measure
- Hardware required
- Software required
- Let the scraping begin
-
Record
- Database preparation
-
Record the reader numbers
- Code Explanation
-
Recording data on a regular basis with
cron
-
Explore
- The Code
-
Description
- Nesting the data
- Wrangle the data
- Cheating with the domain
-
data
vsdatum
-
Setting up the
clipPath
s - Clipping and adding the areas
- Draw the lines and the axes
-
Adding a bit more to our difference chart.
- Add a Y axis label
- Add a title
- Adding the legend
- Link the areas
- The final result
-
Raspberry Pi Tips and Tricks
- Changing the default keyboard layout
- Changing the default local time
- Access the Pi with a ‘name’ or an IP address
-
Transfer files easily to / from the Pi
- Bonus: Edit Files on the Pi from your Desktop Editor
-
Turn the activity light on or off
- Cut to the chase and just do it
- The explanation of how it works
-
Hardware
-
Raspberry Pi A+
- USB Port
- Video Out
- USB Power Input Jack
- MicroSD Flash Memory Card Slot
- Stereo and Composite Video Output
- 40 Pin Header
-
Raspberry Pi B+
- USB Ports
- Video Out
- Ethernet Network Connection
- USB Power Input Jack
- MicroSD Flash Memory Card Slot
- Stereo and Composite Video Output
- 40 Pin Header
-
Raspberry Pi B
- USB Ports
- HDMI Video Out
- Composite Video Out
- Ethernet Network Connection
- USB Power Input Jack
- SD Flash Memory Card Slot
- Audio Output
- 26 Pin Header
-
Cases
-
Multicomp MC-RP002-CLR
- Side views.
- Fitting the Raspberry Pi
- DIY Open Multi-stack Pi
-
Multicomp MC-RP002-CLR
-
Sensors
- DS18B20 Programmable Resolution 1-Wire Digital Thermometer
-
Accessories
- VGA to HDMI Adapter
- In-line switch for USB power supply
- Multiple Outlet USB Power Supply
-
Raspberry Pi A+
-
Linux Command Glossary
-
apt-get
-
apt-get update
-
apt-get upgrade
-
apt-get install
-
-
cat
-
cd
-
chmod
-
chown
-
crontab
-
ifconfig
-
ls
-
modprobe
-
sudo
-
usermod
-
-
Appendices
-
Raspberry Pi Quick Set-up
- Download Raspbian Image
- Writing Raspbian to the SD Card
- Installing Raspbian
- Software Updates
- Static IP Address
-
Remote access via TightVNC
- On Windows
- On the Raspberry Pi.
-
Starting TightVNC at boot.
- Copying and Pasting between Windows and the Raspberry Pi via TightVNC
-
Remote access via SSH
- Setting up the Server (Raspberry Pi)
- Setting up the Client (Windows)
- Setting up a WiFi Network Connection
-
Web Server and PHP
- Adjust permissions for web files
- Database
- phpMyAdmin
- Allow remote database access
- Add users to the database
- Create a database
- Understanding JavaScript Object Notation (JSON)
-
Raspberry Pi Quick Set-up
Other books by this author
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them