Python Programming for Arduino

Develop practical Internet of Things prototypes and applications with Arduino and Python

Python Programming for Arduino

Pratik Desai

2 customer reviews
Develop practical Internet of Things prototypes and applications with Arduino and Python
Mapt Subscription
FREE
$29.99/m after trial
eBook
$21.00
RRP $29.99
Save 29%
Print + eBook
$49.99
RRP $49.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$21.00
$49.99
$29.99p/m after trial
RRP $29.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781783285938
Paperback400 pages

Book Description

The future belongs to applications and services that involve connected devices, requiring physical components to communicate with web-level applications. Arduino combined with the popular open source software platform Python can be used to develop the next level of advanced Internet of Things (IoT) projects with graphical user interfaces and Internet-connected applications.

Starting with designing hardware prototypes using Arduino, this book will then show you everything you need to know to be able to develop complex cloud applications. You will delve into domain-specific topics with incremental complexity, ending with real-world projects. You will quickly learn to develop user interfaces, plots, remote access, messaging protocols, and cloud connectivity. Each successive topic, accompanied by plenty of examples, will help you develop your cutting-edge hardware applications.

Table of Contents

Chapter 1: Getting Started with Python and Arduino
Introduction to Python
Installing Python and Setuptools
The fundamentals of Python programming
Python operators and built-in types
Introduction to Arduino
Getting started with the Arduino IDE
Introduction to Arduino programming
Summary
Chapter 2: Working with the Firmata Protocol and the pySerial Library
Connecting the Arduino board
Introducing the Firmata protocol
Getting started with pySerial
Bridging pySerial and Firmata
Summary
Chapter 3: The First Project – Motion-triggered LEDs
Motion-triggered LEDs – the project description
The project goal
Method 1 – using a standalone Arduino sketch
Method 2 – using Python and Firmata
Summary
Chapter 4: Diving into Python-Arduino Prototyping
Prototyping
Working with pyFirmata methods
Prototyping templates using Firmata
Prototyping with the I2C protocol
Summary
Chapter 5: Working with the Python GUI
Learning Tkinter for GUI design
Your first Python GUI program
The Button() widget – interfacing GUI with Arduino and LEDs
The Entry() widget – providing manual user inputs
The Scale() widget – adjusting the brightness of an LED
The Grid geometry manager
The Checkbutton() widget – selecting LEDs
The Label() widget – monitoring I/O pins
Remaking your first Python-Arduino project with a GUI
Summary
Chapter 6: Storing and Plotting Arduino Data
Working with files in Python
Using CSV files to store data
Storing Arduino data in a CSV file
Getting started with matplotlib
Plotting random numbers using matplotlib
Plotting data from a CSV file
Plotting real-time Arduino data
Integrating plots in the Tkinter window
Summary
Chapter 7: The Midterm Project – a Portable DIY Thermostat
Thermostat – the project description
Stage 1 – prototyping the thermostat
Stage 2 – using a Raspberry Pi for the deployable thermostat
Summary
Chapter 8: Introduction to Arduino Networking
Arduino and the computer networking
Developing web applications using Python
RESTful web applications with Arduino and Python
MQTT – A lightweight messaging protocol
Getting started with MQTT on Arduino and Python
Summary
Chapter 9: Arduino and the Internet of Things
Getting started with the IoT
The IoT cloud platforms
Developing cloud applications using Python and Xively
Your own cloud platform for the IoT
Summary
Chapter 10: The Final Project – a Remote Home Monitoring System
The design methodology for IoT projects
Project overview
Stage 1 – a monitoring station using Arduino
Stage 2 – a control center using Python and the Raspberry Pi
Stage 3 – a web application using Xively, Python, and Amazon cloud service
Testing and troubleshooting
Extending your remote home monitoring system
Summary
Chapter 11: Tweet-a-PowerStrip
Project overview
Stage 1 – a smart power strip with Arduino and relays
Stage 2 – the Python code to process tweets
Testing and troubleshooting
Extending the project with additional features
Summary

What You Will Learn

  • Design and develop your own hardware prototypes using Arduino
  • Interface Arduino to a computer using the Firmata protocol and Python
  • Acquire hands-on experience in developing applications for a variety of popular sensors
  • Develop graphical user interfaces to control your components and plots to visualize sensor data
  • Access your Arduino prototype from the Internet
  • Implement messaging protocols for Arduino communication
  • Connect your hardware project to cloud-based services
  • Create advanced Internet of Things applications through projects in the book

Authors

Table of Contents

Chapter 1: Getting Started with Python and Arduino
Introduction to Python
Installing Python and Setuptools
The fundamentals of Python programming
Python operators and built-in types
Introduction to Arduino
Getting started with the Arduino IDE
Introduction to Arduino programming
Summary
Chapter 2: Working with the Firmata Protocol and the pySerial Library
Connecting the Arduino board
Introducing the Firmata protocol
Getting started with pySerial
Bridging pySerial and Firmata
Summary
Chapter 3: The First Project – Motion-triggered LEDs
Motion-triggered LEDs – the project description
The project goal
Method 1 – using a standalone Arduino sketch
Method 2 – using Python and Firmata
Summary
Chapter 4: Diving into Python-Arduino Prototyping
Prototyping
Working with pyFirmata methods
Prototyping templates using Firmata
Prototyping with the I2C protocol
Summary
Chapter 5: Working with the Python GUI
Learning Tkinter for GUI design
Your first Python GUI program
The Button() widget – interfacing GUI with Arduino and LEDs
The Entry() widget – providing manual user inputs
The Scale() widget – adjusting the brightness of an LED
The Grid geometry manager
The Checkbutton() widget – selecting LEDs
The Label() widget – monitoring I/O pins
Remaking your first Python-Arduino project with a GUI
Summary
Chapter 6: Storing and Plotting Arduino Data
Working with files in Python
Using CSV files to store data
Storing Arduino data in a CSV file
Getting started with matplotlib
Plotting random numbers using matplotlib
Plotting data from a CSV file
Plotting real-time Arduino data
Integrating plots in the Tkinter window
Summary
Chapter 7: The Midterm Project – a Portable DIY Thermostat
Thermostat – the project description
Stage 1 – prototyping the thermostat
Stage 2 – using a Raspberry Pi for the deployable thermostat
Summary
Chapter 8: Introduction to Arduino Networking
Arduino and the computer networking
Developing web applications using Python
RESTful web applications with Arduino and Python
MQTT – A lightweight messaging protocol
Getting started with MQTT on Arduino and Python
Summary
Chapter 9: Arduino and the Internet of Things
Getting started with the IoT
The IoT cloud platforms
Developing cloud applications using Python and Xively
Your own cloud platform for the IoT
Summary
Chapter 10: The Final Project – a Remote Home Monitoring System
The design methodology for IoT projects
Project overview
Stage 1 – a monitoring station using Arduino
Stage 2 – a control center using Python and the Raspberry Pi
Stage 3 – a web application using Xively, Python, and Amazon cloud service
Testing and troubleshooting
Extending your remote home monitoring system
Summary
Chapter 11: Tweet-a-PowerStrip
Project overview
Stage 1 – a smart power strip with Arduino and relays
Stage 2 – the Python code to process tweets
Testing and troubleshooting
Extending the project with additional features
Summary

Book Details

ISBN 139781783285938
Paperback400 pages
Read More
From 2 reviews

Read More Reviews

Recommended for You

Raspberry Pi Cookbook for Python Programmers Book Cover
Raspberry Pi Cookbook for Python Programmers
$ 26.99
$ 18.90
Mastering Object-oriented Python Book Cover
Mastering Object-oriented Python
$ 26.99
$ 18.90
Arduino Development Cookbook Book Cover
Arduino Development Cookbook
$ 35.99
$ 3.60
Python Machine Learning Book Cover
Python Machine Learning
$ 35.99
$ 25.20
Arduino Robotic Projects Book Cover
Arduino Robotic Projects
$ 26.99
$ 18.90
C Programming for Arduino Book Cover
C Programming for Arduino
$ 29.99
$ 21.00