| |
| |
Introduction | |
| |
| |
| |
Arduino Engineering Basics | |
| |
| |
| |
Getting Up and Blinking with the Arduino | |
| |
| |
Exploring the Arduino Ecosystem | |
| |
| |
Arduino Functionality | |
| |
| |
Atmel Microcontroller | |
| |
| |
Programming Interfaces | |
| |
| |
General I/O and ADCs | |
| |
| |
Power Supplies | |
| |
| |
Arduino Boards | |
| |
| |
Creating Your First Program | |
| |
| |
Downloading and Installing the Arduino IDE | |
| |
| |
Running the IDE and Connecting to the Arduino | |
| |
| |
Breaking Down Your First Program | |
| |
| |
Summary | |
| |
| |
| |
Digital Inputs, Outputs, and Pulse-Width Modulation | |
| |
| |
Digital Outputs | |
| |
| |
Wiring Up an LED and Using breadboards | |
| |
| |
Working with Breadboards | |
| |
| |
Wiring LEDs | |
| |
| |
Programming Digital Outputs | |
| |
| |
Using For Loops | |
| |
| |
Pulse-Width Modulation with analogWrite() | |
| |
| |
Reading Digital Inputs | |
| |
| |
Reading Digital Inputs with Pulldown Resistors | |
| |
| |
Working with "Bouncy" Burtons | |
| |
| |
Building a Controllable RGB LED Nightlight | |
| |
| |
Summary | |
| |
| |
| |
Reading Analog Sensors | |
| |
| |
Understanding Analog and Digital Signals | |
| |
| |
Comparing Analog and Digital Signals | |
| |
| |
Converting an Analog Signal to a Digital One | |
| |
| |
Reading Analog Sensors with the Arduino: analogRead() | |
| |
| |
Reading a Potentiometer | |
| |
| |
Using Analog Sensors | |
| |
| |
Working with Analog Sensors to Sense Temperature | |
| |
| |
Using Variable Resistors to Make Your Own Analog Sensors | |
| |
| |
Using Resistive Voltage Dividers | |
| |
| |
Using Analog Inputs to Control Analog Outputs | |
| |
| |
Summary | |
| |
| |
| |
Controlling Your Environment | |
| |
| |
| |
Using Transistors and Driving Motors | |
| |
| |
Driving DC Motors | |
| |
| |
Handling High-Current Inductive Loads | |
| |
| |
Using Transistors as Switches | |
| |
| |
Using Protection Diodes | |
| |
| |
Using a Secondary Power Source | |
| |
| |
Wiring the Motor | |
| |
| |
Controlling Motor Speed with PWM | |
| |
| |
Using an H-Bridge to Control DC Motor Direction | |
| |
| |
Building an H-bridge Circuit | |
| |
| |
Operating an H-bridge Circuit | |
| |
| |
Driving Servo Motors | |
| |
| |
Understanding the Difference Between Continuous Rotation and Standard Servos | |
| |
| |
Understanding Servo Control | |
| |
| |
Controlling a Servo | |
| |
| |
Building a Sweeping Distance Sensor | |
| |
| |
Summary | |
| |
| |
| |
Making Sounds | |
| |
| |
Understanding How Speakers Work | |
| |
| |
The Properties of Sound | |
| |
| |
How a Speaker Produces Sound | |
| |
| |
Using tone() to Make Sounds | |
| |
| |
Including a Definition File | |
| |
| |
Wiring the Speaker | |
| |
| |
Making Sound Sequence | |
| |
| |
Using Arrays | |
| |
| |
Making Note and Duration Arrays | |
| |
| |
Completing the Program | |
| |
| |
Understanding the Limitations of the tone() Function | |
| |
| |
Building a Micro Piano | |
| |
| |
Summary | |
| |
| |
| |
USB and Serial Communication | |
| |
| |
Understanding the Arduino's Serial Communication Capabilities | |
| |
| |
Arduino Boards with an Internal or External FTDI USB-to-Serial Converter | |
| |
| |
Arduino Boards with a Secondary USB-Capable ATMega MCU Emulating a Serial Converter | |
| |
| |
Arduino Boards with a Single USB-Capable MCU | |
| |
| |
Arduino Boards with USB-Host Capabilities | |
| |
| |
Listening to the Arduino | |
| |
| |
Using print Statements | |
| |
| |
Using Special Characters | |
| |
| |
Changing Data Type Representations a | |
| |
| |
Talking to the Arduino | |
| |
| |
Reading Information from a Computer or Other Serial Device | |
| |
| |
Telling the Arduino to Echo Incoming Data | |
| |
| |
Understanding the Differences Between Chars and Ints | |
| |
| |
Sending Single Characters to Control an LED | |
| |
| |
Sending Lists of Values to Control an RGB LED | |
| |
| |
Talking to a Desktop App | |
| |
| |
Talking to Processing | |
| |
| |
Installing Processing | |
| |
| |
Controlling a Processing Sketch from Your Arduino | |
| |
| |
Sending Data from Processing to Your Arduino | |
| |
| |
Learning Special Tricks with the Arduino Leonardo (and Other 32U4-Based Arduinos) | |
| |
| |
Emulating a Keyboard | |
| |
| |
Typing Data into the Computer | |
| |
| |
Commanding Your Computer to Do Your Bidding | |
| |
| |
Emulating a Mouse | |
| |
| |
Summary | |
| |
| |
| |
Shift Registers | |
| |
| |
Understanding Shift Registers | |
| |
| |
Sending Parallel and Serial Data | |
| |
| |
Working with the 74HC595 Shift Register | |
| |
| |
Understanding the Shift Register Pin Functions | |
| |
| |
Understanding How the Shift Register Works | |
| |
| |
Shifting Serial Data from the Arduino | |
| |
| |
Converting Between Binary and Decimal Formats | |
| |
| |
Controlling Light Animations with a Shift Register | |
| |
| |
Building a "Light Rider" | |
| |
| |
Responding to Inputs with an LED Bar Graph | |
| |
| |
Summary | |
| |
| |
| |
Communication Interfaces | |
| |
| |
| |
The I<sup>2</sup>C Bus | |
| |
| |
History of the I<sup>2</sup>C Bus | |
| |
| |
I<sup>2</sup>C Hardware Design | |
| |
| |
Communication Scheme and ID Numbers | |
| |
| |
Hardware Requirements and Pull-Up Resistors | |
| |
| |
Communicating with an I<sup>2</sup>C Temperature Probe | |
| |
| |
Setting Up the Hardware | |
| |
| |
Referencing the Datasheet | |
| |
| |
Writing the Software | |
| |
| |
Combining Shift Registers, Serial Communication, and I<sup>2</sup>C Communications | |
| |
| |
Building the Hardware for a Temperature Monitoring System | |
| |
| |
Modifying the Embedded Program | |
| |
| |
Writing the Processing Sketch | |
| |
| |
Summary | |
| |
| |
| |
The SPI Bus | |
| |
| |
Overview of the SPI Bus | |
| |
| |
BP! Hardware and Communication Design | |
| |
| |
Hardware Configuration | |
| |
| |
Communication Scheme | |
| |
| |
Comparing SPI to I<sup>2</sup>C | |
| |
| |
Communicating with an SPI Digital Potentiometer | |
| |
| |
Gathering Information from the Datasheet | |
| |
| |
Setting Up the Hardware | |
| |
| |
Writing the Software | |
| |
| |
Creating an Audiovisual Display Using SPI Digital Potentiometers | |
| |
| |
Setting Up the Hardware | |
| |
| |
Modifying the Software | |
| |
| |
Summary | |
| |
| |
| |
Interfacing with Liquid Crystal Displays | |
| |
| |
Setting Up the LCD | |
| |
| |
Using the LiquidCrystal Library to Write to the LCD | |
| |
| |
Adding Text to the Display | |
| |
| |
Creating Special Characters and Animations | |
| |
| |
Building a Personal Thermostat | |
| |
| |
Setting Up Ute Hardware | |
| |
| |
Displaying Data on the LCD | |
| |
| |
Adjusting the Set Point with a Button | |
| |
| |
Adding an Audible Warning and a Pan | |
| |
| |
Bringing It All Together The Complete Program | |
| |
| |
Taking This Project to the Next Level | |
| |
| |
Summary | |
| |
| |
| |
Wireless Communication with XBeo Radios | |
| |
| |
Understanding XBee Wireless Communication | |
| |
| |
XBee Radios | |
| |
| |
The XBee Radio Shield and Serial Connections | |
| |
| |
3.3V Regulator | |
| |
| |
Logic Level Shitting | |
| |
| |
Associate LED and RSSI LED | |
| |
| |
UART Selection Jumper or Switch | |
| |
| |
Hardware vs. Software Serial UART Connection Option | |
| |
| |
Configuring Your XBees | |
| |
| |
Configuring via a Shield or a USB Adapter | |
| |
| |
| |
Using the Uno as a Programmer (Not Recommended) | |
| |
| |
| |
Using the SparkFun USB Explorer (Recommended) | |
| |
| |
Choosing Your XBee Settings and Connecting Your XBee to Your Host Computer | |
| |
| |
Configuring Your XBee with X-CTU | |
| |
| |
Configuring Your XBee with a Serial Terminal | |
| |
| |
Talking with Your Computer Wirelessly | |
| |
| |
Powering Your Remote Arduino | |
| |
| |
USB with a Computer or a 5V Wall Adapter | |
| |
| |
Batteries | |
| |
| |
Wall Power Adapters | |
| |
| |
Revisiting the Serial Examples: Controlling Processing with a Potentiometer | |
| |
| |
Revisiting the Serial Examples: Controlling an RGB LED | |
| |
| |
Talking with Another Arduino: Building a Wireless Doorbell | |
| |
| |
System Design | |
| |
| |
Transmitter Hardware | |
| |
| |
Receiver Hardware | |
| |
| |
Transmitter Software | |
| |
| |
Receiver Software | |
| |
| |
Summary | |
| |
| |
| |
Advanced Topics and Projects | |
| |
| |
| |
Hardware and Timor Interrupts | |
| |
| |
Using Hardware Interrupts | |
| |
| |
Knowing the Tradeoffs Between Polling and Interrupting | |
| |
| |
Ease of Implementation (Software) | |
| |
| |
Ease of Implementation (Hardware) | |
| |
| |
Multitasking | |
| |
| |
Acquisition Accuracy | |
| |
| |
Understanding the Arduino's Hardware Interrupt Capabilities | |
| |
| |
Building and Testing a Hardware-Debounced Button Interrupt Circuit | |
| |
| |
Creating a Hardware-Debouncing Circuit | |
| |
| |
Assembling the Complete Test Circuit | |
| |
| |
Writing the Software | |
| |
| |
Using Tuner Interrupts | |
| |
| |
Understanding Timer Interrupts | |
| |
| |
Getting the Library | |
| |
| |
Executing Two Tasks Simultaneously(ish) | |
| |
| |
Building an Interrupt-Driven Sound Machine | |
| |
| |
Sound Machine Hardware | |
| |
| |
Sound Machine Software | |
| |
| |
Summary | |
| |
| |
| |
Data Logging with SD Cards | |
| |
| |
Getting Ready for Data Logging | |
| |
| |
Formatting Data with CSV Files | |
| |
| |
Preparing an SD Card for Data Logging | |
| |
| |
Interfacing the Arduino with an SD Card | |
| |
| |
SD Card Shields | |
| |
| |
SD Card SPI Interface | |
| |
| |
Writing to an SD Card | |
| |
| |
Reading from an SD Card | |
| |
| |
Using a Real-Time Clock | |
| |
| |
Understanding Real-Time Clocks | |
| |
| |
Using the DS1307 Real-Tune Cock | |
| |
| |
Using the RTC Arduino Third-Party Library | |
| |
| |
Using the Real-Time Clock | |
| |
| |
Installing the RTC and SD Card Modules | |
| |
| |
Updating the Software | |
| |
| |
Building an Entrance Logger | |
| |
| |
Logger Hardwire | |
| |
| |
Logger Software | |
| |
| |
Data Analysis | |
| |
| |
Summary | |
| |
| |
| |
Connecting Your Arduino to the Internet | |
| |
| |
The Web, the Arduino, and You | |
| |
| |
Networking Lingo | |
| |
| |
IP Address | |
| |
| |
Network Address Translation | |
| |
| |
MAC Address | |
| |
| |
HTML | |
| |
| |
HTTP | |
| |
| |
GET/POST | |
| |
| |
DHCP | |
| |
| |
DNS | |
| |
| |
Clients and Servers | |
| |
| |
Networking Your Arduino | |
| |
| |
Controlling Your Arduino from the Web | |
| |
| |
Setting Up the I/O Control Hardware | |
| |
| |
Designing a Simple Web Page | |
| |
| |
Writing an Arduino Server Sketch | |
| |
| |
Connecting to the Network and Retrieving an IP via DHCP | |
| |
| |
Replying to a Client Response | |
| |
| |
Putting It Together Web Server Sketch | |
| |
| |
Controlling Your Arduino via the Network | |
| |
| |
Controlling Your Arduino over the Local Network | |
| |
| |
Using Port Forwarding to Control your Arduino from Anywhere | |
| |
| |
Sending Live Data to a Graphing Service | |
| |
| |
Building a Live Data Feed on Xively | |
| |
| |
Creating a Xively Account | |
| |
| |
Creating a Data Feed | |
| |
| |
Installing the Xively and HttpClient Libraries | |
| |
| |
Wiring Up Your Arduino | |
| |
| |
Configuring the Xively Sketch and Running the Code | |
| |
| |
Displaying Data on the Web | |
| |
| |
Adding Feed Components | |
| |
| |
Adding an Analog Temperature Sensor | |
| |
| |
Adding Additional Sensor Readings to the Datastream | |
| |
| |
Summary | |
| |
| |
Appendix: Deciphering the ATMega Datasheet and Arduino Schematics | |
| |
| |
Reading Datasheets | |
| |
| |
Breaking Down a Datasheet | |
| |
| |
Understanding Component Pin-outs | |
| |
| |
Understanding the Arduino Schematic | |
| |
| |
Index | |