Học BeagleBone Black với Python - Ứng dụng thực tế từ Jayakarthigeyan Prabakar

Tôi sẽ tạo meta tags cho bài viết "Beaglebone by example" theo các quy tắc đã đưa ra. Dưới đây là kết quả: { "ai_description": "Beaglebone là một nền tảng

Chuyên ngành

Hệ thống nhúng

Người đăng

Ẩn danh

Thể loại

Sách

2016

262
1
0

Phí lưu trữ

55 Point

Tóm tắt

I. BeagleBone Black and Python An Overview

BeagleBone Black is a low-cost, single-board computer that can be used to build physical computing systems. Python, a high-level programming language, is widely used for its simplicity and readability. This article explores the intersection of these two technologies, providing practical examples and solutions.

1.1. What is BeagleBone Black

BeagleBone Black is a single-board computer developed by BeagleBoard.org. It's known for its low cost, small size, and powerful processing capabilities, making it an ideal choice for DIY projects and prototyping.

1.2. Why Python for BeagleBone Black

Python is a popular choice for BeagleBone Black due to its simplicity, extensive libraries, and strong community support. It's perfect for rapid prototyping and quick development of physical computing systems.

II. Getting Started with BeagleBone Black and Python

Before diving into projects, it's essential to set up your BeagleBone Black and familiarize yourself with Python. This section guides you through the initial setup and provides a brief Python refresher.

2.1. Setting up BeagleBone Black

To set up your BeagleBone Black, you'll need to install the operating system, connect to it via SSH, and set up a Python development environment.

2.2. Python Refresher

If you're new to Python, this section provides a quick refresher on essential concepts and syntax. It also introduces you to some useful Python libraries for BeagleBone Black projects.

III. Building Physical Computing Systems

The real power of BeagleBone Black lies in its ability to interact with the physical world. This section explores various projects that demonstrate this capability using Python.

3.1. Controlling LEDs with Python

One of the simplest ways to interact with the physical world is to control LEDs. This sub-heading guides you through blinking an LED using Python and the BeagleBone Black's GPIO pins.

3.2. Reading Sensor Data with Python

Sensors are crucial components in physical computing systems. This sub-heading demonstrates how to read data from a temperature sensor (LM35) using Python and display it on the BeagleBone Black's terminal.

IV. Connecting BeagleBone Black to the Internet

To make your BeagleBone Black projects more versatile, you can connect them to the internet. This section explores how to give the 'ls' command internet access and upload sensor data to the web cloud.

4.1. Giving ls command internet access

This sub-heading guides you through connecting your BeagleBone Black to the internet and giving the 'ls' command web access using a simple Python script.

4.2. Uploading Sensor Data to the Web Cloud

This sub-heading demonstrates how to upload sensor data to the web cloud using Python, Flask, and a simple web server.

Tóm tắt và mô tả trên trang này được tạo với sự hỗ trợ của AI. Nếu bạn thấy nội dung không chính xác hoặc có vấn đề, vui lòng Báo lỗi nội dung.

14/03/2026

Trích đoạn nội dung tài liệu

vn BeagleBone By Example Learn how to build physical computing systems using BeagleBone Black and Python Jayakarthigeyan Prabakar BIRMINGHAM - MUMBAI icviet.vn BeagleBone By Example Copyright © 2016 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied.

Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: August 2016 Production reference: 1290816 Published by Packt Publishing Ltd.

Livery Place 35 Livery Street Birmingham B3 2PB, UK.com Image source:- BeagleBoard.org Foundation (http://beagleboard.vn Credits Author Project Coordinator Jayakarthigeyan Prabakar Shweta H Birwatkar Reviewer Proofreader Christopher Rush Safis Editing Acquisition Editor Indexer Rahul Nair Hemangini Bari Content Development Editor Graphics Trusha Shriyan Kirk D'Penha Technical Editor Production Coordinator Nirant Carvalho Shantanu N. Zagade Copy Editor Cover Work Sneha Singh Shantanu N. Zagade Safis Editing icviet.vn About the Author Jayakarthigeyan Prabakar is an electrical and electronics engineer with more than three years of experience in real-time embedded systems development. He loves building cloud-connected physical computing systems using Arduino, MSP430, Raspberry Pi, BeagleBone Black, Intel Edison, ESP8266 and more.

Jayakarthigeyan started understanding how computing devices and operating systems work when he started repairing his personal computer on his own in middle school that is when he first got his hands on in electronics. From his third year in the undergraduate degree program, he started building prototypes for various start-ups around the world as a freelancer. Currently, Jayakarthigeyan is a full-time technical lead of the R & D division in a Home Automation startup and works as a consultant to many other companies involved in Robotics, Industrial Automation and other IoT solutions as well; he helps build prototypes to bring their ideas to reality. I would like to dedicate this book to those two strong and wonderful women in my life, my mother Saraswathi and my wife Shivaranjani for believing in me and always encouraging me to do what I like with my crazy ideas.

Thanks to my grandfather Alavandar who has influenced and shaped me to what I am today. Special thanks to Rahul Nair for giving me the opportunity to write this book. Thanks to Mamata Walkar, Trusha Shriyan, Nirant Carvalho and all others at Packt Publishing for their support to me in shaping this book.vn About the Reviewer Christopher Rush is from Preston, UK. He has a degree in computer science and has spent the last 15 years working in the electronics industry.

Christopher is a full- time technical consultant and has an extensive knowledge of the maker industry. Chris is a regular blogger on MAKER.IO (https://www.io/) providing tutorials and guides for popular development boards such as Arduino, Raspberry Pi, BeagleBone, and many more. Chris is also the Author of 30 BeagleBone Black Projects for the Evil Geniu, Programming the Particle Photon: Getting started with the Internet of Things, and Programming the Intel Galileo: Getting started with Internet-Connected Hardware.com eBooks, discount offers, and more Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www. com and as a print book customer, you are entitled to a discount on the eBook copy.

Get in touch with us at customercare@packtpub.com for more details.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks. TM https://www2.com/books/subscription/packtlib Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books. Why subscribe? • Fully searchable across every book published by Packt • Copy and paste, print, and bookmark content • On demand and accessible via a web browser icviet.vn Table of Contents Preface v Chapter 1: Getting Started with BeagleBone 1 Prerequisites 2 BeagleBone Black – a single board computer 3 Getting to know your board – BeagleBone Black 4 Hardware specification of BeagleBone Black 4 Setting up your BeagleBone board 7 Installing operating systems 13 Booting your BeagleBone board from a SD card 20 Logging into the board via SSH over Ethernet 25 Working on Linux Shell 33 Writing your own Python program on BeagleBone board 37 Summary 44 Chapter 2: Circuit Fundamentals and GPIO 45 Prerequisites 46 Usage of breadboards 46 Switches and LEDs 48 Momentary switch 50 Toggle switch 52 GPIOs 54 Adding libraries to Python 55 Using Python to access GPIOs 58 Project – blinking an LED using Python script 63 Summary 65 [i] icviet.vn Table of Contents Chapter 3: Introduction to Physical Computing Systems 67 Prerequisites 68 Introducing physical computing systems 68 Basic elements of physical computing systems 69 Application areas 75 Project – toggle LED using a push button 76 Summary 84 Chapter 4: Real-time Physical Computing Systems Using BeagleBone 85 Prerequisites 86 Materials needed 86 Temperature sensor 86 How do LM35 sensors work? 87 Temperature sensing using a LM35 sensor 88 Summary 98 Chapter 5: Connecting Physical Computing Systems to the Internet 99 Prerequisites 100 Materials needed 100 Giving Internet access to your BeagleBone board 100 Adding Wi-Fi to the BeagleBone board 101 Intermediate level project: An e-mail alert fire alarm 114 Advanced level project: Uploading sensor data to a web cloud 123 Summary 131 Chapter 6: Home Automation Using BeagleBone 133 Prerequisites 134 Materials needed 134 The structure of home automation systems 134 Introduction to web servers 135 Python-Flask on BeagleBone Black 137 Transistors, relays, power switches 148 Advanced project: An Internet controlled power switch – controlling an AC bulb from the Internet 154 Setting up port forwarding 157 Summary 165 [ ii ] icviet.vn Table of Contents Chapter 7: Working with Images Using Computer Vision 167 Prerequisites 167 Materials needed 168 Adding a USB camera to a BeagleBone board 168 OpenCV – introduction and setting up on the BeagleBone board 171 Installing OpenCV on Debian on a BeagleBone board 171 Project: Image capture from a camera using Python and OpenCV 177 Summary 183 Chapter 8: Home Security Systems Using BeagleBone Black 185 Prerequisites 186 PIR sensors 186 How PIR sensors work 187 Motion detection using PIR sensors 189 Sending e-mail with an attachment from BeagleBone Black 192 Advanced project – Motion-based home security alert system 194 Summary 198 Chapter 9: Exploring Robotics 199 Introduction to robotics 200 Elements, structure and operation of robotic systems 202 Application areas 204 Industrial robotics 205 Domestic robots 206 Medical robotics 207 Mobile robots 208 Social and humanoid robots 209 Differential-drive robots 211 Summary 214 Chapter 10: Building Your Own Robot 215 Prerequisites 215 Materials Needed 215 DC motors 216 L293D motor driver IC 217 Live video streaming on the BeagleBone board 220 Advanced project – a telecontrolled robot with live video streaming 231 Summary 241 Index 243 [ iii ] icviet.vn Preface If you are among those who are looking for a simple step-by-step guide to learn basic electronics and start interfacing sensors and actuators with a low-cost Linux development board, such as BeagleBone Black through examples to build internet connected physical computing systems and robots.

This book is for you to get started if you have prior knowledge of basic python programming and little understanding of how a computer works. What this book covers Chapter 1, Get Started with BeagleBone , tells us about the hardware specification of the BeagleBone board, how to set up a BeagleBone board to boot up with a Linux Operating System on microSD card and log in to the Linux command shell from a remote computer, and how to program on Python software running on the BeagleBone board. Chapter 2, Circuit Fundaments and GPIO, talks about the working of basic electronic circuits including switches, LEDs, and battery followed by GPIO pins on the BeagleBone board and elaborates on how you can use these GPIO pins to switch LED status using a python program. Chapter 3, Introduction to Physical Computing Systems, helps you understand the basic structure of physical computing systems with real world examples, build your own physical computing system using a switch as an input and LED as the output device connected to BeagleBone board which works based on the python program that you write.

Chapter 4, Real-Time physical computing systems Using BeagleBone Board, talks about analog sensors using LM35 temperature sensor as an example and works on a more advanced physical computing project using BeagleBone board interfaced with an LM35. [v] Preface Chapter 5, Connecting Physical Computing Systems to the Internet, teaches you how to connect BeagleBone board to Wi-Fi networks, cloud storage and upload sensor data from BeagleBone board to cloud in real-time, and view the trends on the cloud software with time stamps. Build your first IoT. Chapter 6, Home Automation Using BeagleBone, tells you about how to set up your own web server on a BeagleBone board using a Python and Flask framework and how to use the same to control home appliances using an AC relay board interfaced with BeagleBone board from a PC or your mobile phone connected to the internet, similar to any other IoT Home Automation system.

Chapter 7, Working with Images Using Computer Vision, teaches you how to interface a USB camera with BeagleBone board and how to OpenCV to capture images and work with them using Python. Chapter 8, Home Security Systems Using BeagleBone Black, teaches us how to use SMTP with python to send emails, learn about PIR sensors and motion detection, build a smart intruder alert system by interfacing PIR sensor with BeagleBone board to detect motion, and use OpenCV to capture images and email them. Chapter 9, Exploring Robotics, helps you understand the basic structure of robotic systems, their working and application in different areas using real life examples. It also helps us learn about differential drive robots Chapter 10, Building Your Own Robot, teaches us about DC Motors, Motor Driver IC L293D and control of DC motors from Python on BeagleBone Black using this Motor Driver IC, live streaming of video on local server from USB camera connected to BeagleBone board, and building your own Tele Controlled Robot with live video streaming.

What you need for this book Basic Python programming knowledge and little understanding of how a computer works in terms of the electronics inside it. Who this book is for This book is for those who are looking for a simple step by step guide to learn basic electronics and start interfacing sensors and actuators, with a low-cost Linux development board like BeagleBone Black through examples to build IoT and Robot Systems [ vi ] Preface Conventions In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning. Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: " Let's power off our BeagleBone board using the command sudo poweroff, which will shut down the operating system." A block of code is set as follows: <img src="http://192.42:8080/?action=stream"> Any command-line input or output is written as follows: sudo python Blink.py New terms and important words are shown in bold.

Nội dung được bảo vệ bản quyền — Tải xuống đầy đủ