Leanpub Header

Skip to main content

IoT Programming

From Novice to Advanced

Bridge the gap between software and the physical world with this comprehensive hands-on guide to the Internet of Things. From essential electronics to edge computing, cloud, and AI, you’ll master the full stack of technologies needed to build professional IoT solutions. Start reading—and start building.

Minimum price

$19.00

$29.00

You pay

$29.00

Author earns

$23.20
$

...Or Buy With Credits!

You can get credits with a paid monthly or annual Reader Membership, or you can buy them here.
PDF
EPUB
WEB
About

About

About the Book

This book fills the gap between hobbyist tinkering and professional engineering. It guides you through the entire IoT stack—from the fundamentals of electronics and microcontrollers to Raspberry Pi programming, edge computing, and cloud integration. Moving beyond theory, you will build AI-powered systems and gain practical skills to solve real-world physical problems!

Author

About the Author

Reza Ghafari

Software developer, architect, and IoT university teaching assistant with 20+ years of experience building high-traffic, cloud-native systems.

Contents

Table of Contents

About the Author

Chapter 1: Introduction

  1. Who is this book for?
  2. Defining the Internet of Things
  3. The Connected Ecosystem
  4. IoT Market Trends and Adoption Rates
  5. Applications: From Cities to Cells
  6. Case Study: The Limits of Connectivity
  7. Setting Up Your Lab: Hardware Shopping List
  8. Arduino Uno
  9. ESP32
  10. Raspberry Pi
  11. Alternative to Hardware: Virtual Pi
  12. The Companion Code
  13. Next Steps

Chapter 2: Basic Electronics

  1. Introduction: You Don’t Need a Degree
  2. The “Holy Trinity”: Voltage, Current, and Resistance
  3. Power (Watts)
  4. Schematics
  5. Series Circuits
  6. Parallel Circuits
  7. Breadboard
  8. Resistors
  9. Diodes & LEDs
  10. Capacitors
  11. Transistors
  12. Batteries
  13. Sensors (The Inputs)
  14. Actuators (The Outputs)
  15. Digital Signals
  16. Analog Signals
  17. Current Types
  18. Current Type vs. Signal Type
  19. Microcontroller (The Chip)
  20. Development Board

Chapter 3: Microcontrollers (Arduino & Friends)

  1. Meet the Arduino Family
  2. Anatomy of the Arduino Uno
  3. Understanding the Pinout
  4. Arduino Shields: Expanding Capabilities
  5. Safety First: Working with Electronics
  6. The Integrated Development Environment (IDE)
  7. Connecting the Board
  8. Our First Sketch
  9. Understanding the Code Structure
  10. The “Blink” Sketch (Internal LED)
  11. Your First Circuit: The External LED
  12. A Library at Your Fingertips: Built-in Examples
  13. Variables and Data Types
  14. Control Structures
  15. Functions
  16. Project: Making Noise (Buzzer)
  17. Project: Push Button
  18. Project: Analog Input (Potentiometer Dimmer)
  19. Project: Serial Communication
  20. Project: Fading LED (PWM)
  21. Project: Traffic Light
  22. Project: Temperature Sensor
  23. Arduino Libraries
  24. Project: WiFi Test
  25. Arduino Programming Cheat Sheet
  26. ESP32 - Arduino Alternative
  27. Raspberry Pi Pico (RP2040)
  28. STM32 “Blue Pill” (STM32F103)
  29. BBC micro:bit
  30. ESP8266

Chapter 4: Single Board Computers (Raspberry Pi & Friends)

  1. What is Raspberry Pi?
  2. A Brief History
  3. Anatomy of the Hardware
  4. The Operating System (OS)
  5. Installation: Setting Up Your Pi
  6. SSH (Command Line Access)
  7. The Linux Terminal: A Survival Guide
  8. VNC (Visual Desktop Access)
  9. Virtual Raspberry Pi on Virtual Machine
  10. Your First Python Script
  11. Controlling Hardware (GPIO)
  12. Reading System Info
  13. Raspberry Pi vs Arduino
  14. Raspberry Pi Alternatives

Chapter 5: Edge Computing

  1. What is Edge Computing?
  2. How Does It Work?
  3. What is a Sensor Node?
  4. Why Use Edge Computing?
  5. Edge Hardware
  6. Building a Mini Edge Gateway
  7. Containerization

Chapter 6: Connectivity and Network Standards

  1. The Nervous System of IoT
  2. Network Categories
  3. Personal Area Network (PAN)
  4. Local Area Network (LAN) & Wi-Fi
  5. Wide Area Network (WAN) & LPWAN
  6. Choosing the Right Network
  7. Future Trends: Matter & Thread
  8. Further Reading

Chapter 7: Data Management and Messaging Protocols

  1. The Challenge of Data
  2. Understanding “Big Data”
  3. Classifying IoT Data
  4. IoT Data Management
  5. Data Formats
  6. Web Servers
  7. APIs (Application Programming Interfaces)
  8. Connectivity: Messaging Protocols
  9. HTTP (Hypertext Transfer Protocol)
  10. MQTT (Message Queuing Telemetry Transport)
  11. CoAP (Constrained Application Protocol)
  12. Databases
  13. Setting up MariaDB (MySQL) on Linux/Raspberry Pi
  14. IoT Rules

Chapter 8: Cloud Platforms

  1. The Evolution of Cloud Computing
  2. Core Cloud Capabilities
  3. Service Models (The “Stack”)
  4. Service Level Agreements & Shared Responsibility
  5. Cloud Storage
  6. IoT Cloud Architectures
  7. ThingsBoard
  8. Device Management and Registration
  9. Device Twin (Shadow)
  10. Serverless Computing
  11. Cloud vs. Edge Comparison
  12. OTA (Over-the-Air) Updates
  13. Opportunities and Challenges

Chapter 9: Security and Privacy

  1. The “Wild West” of Connected Devices
  2. The Security Lifecycle
  3. Threat Modeling: Thinking Like a Hacker
  4. Device Hardening: Securing the Physical Layer
  5. Network Security: Protocols and Transport
  6. Privacy and Data Ownership
  7. Case Studies: When IoT Goes Wrong
  8. Regulatory Compliance
  9. Emerging Solutions
  10. Lab: Hardening a Raspberry Pi

Chapter 10: Data Analytics and Visualisation

  1. Transforming Data into Wisdom
  2. The Scope of IoT Big Data
  3. The IoT Data Deluge
  4. Specialized Storage: Time-Series Databases
  5. The Analytics Pipeline: Preparing Data
  6. Stream Processing: Windowing
  7. Hands-on: Python for IoT Data Analysis
  8. Data Visualisation Platforms
  9. From Analytics to Alerts: Automated Action
  10. Machine Learning: The Next Step
  11. Digital Twins: Simulation and Diagnostics
  12. Geospatial Analytics
  13. The Lambda vs. Kappa Architecture

Chapter 11: AI and Machine Learning

  1. The Brain of the System
  2. The AI Hierarchy: Where Does Thinking Happen?
  3. TinyML: “Just Enough” Thinking
  4. Specialized Hardware: The “Muscle”
  5. Machine Learning Basics for IoT
  6. Optimizing for the Edge: Fitting an Elephant in a Fridge
  7. Key AI Technologies in IoT
  8. Advanced Concept: Federated Learning
  9. MLOps: Managing Intelligence at Scale
  10. Hands-on: The “Magic Wand” Workflow
  11. Tools of the Trade
  12. Generative AI: The New Frontier (AIoT)
  13. The Human Element: Ethics and Safety
  14. Conclusion

Chapter 12: Real World Applications

  1. Beyond the Hype
  2. Industry 4.0: The Fourth Revolution
  3. IIoT in Action: Smart Manufacturing
  4. Smart Agriculture (Precision Farming)
  5. Smart Cities and Transport
  6. Case Study: Ambient Assisted Living
  7. Future Trends: Ethics and Sustainability
  8. Capstone Preparation Checklist
  9. Conclusion: The Convergence

Chapter 13: Practical Project

  1. Project Selection
  2. Project 1: The Smart Greenhouse
  3. Project 2: The Secure Visual Security System (Mini-Walkthrough)
  4. Project 3: Industrial Machine Monitor (Mini-Walkthrough)
  5. Project 1: Detailed Walkthrough: The Smart Greenhouse
  6. System Design: From Idea to Architecture
  7. Implementation Plan
  8. Phase 1: The MQTT Broker (Docker)
  9. Phase 2: The Sensor Node (ESP32)
  10. Phase 3: The Edge Controller (Python)
  11. Phase 4: Cloud Integration (MicroDB)
  12. Phase 5: The Web Dashboard (Flask)
  13. Phase 6: Additional Weather Logic
  14. Phase 7: SMS Alerts
  15. Phase 8: Future-Proofing with Gen AI
  16. Final Words: The End of the Beginning

IoT Glossary

References & Further Reading

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 earned over $14 million writing, 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

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub