Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

IR Tester: Arduino Code for IR Receiver and LCD Display, Lecture notes of Communication

The arduino code for an ir tester that uses an ir receiver to detect signals from an ir remote control and displays the detection status on both the serial monitor and a 16x2 lcd display. The code includes instructions for setting up the liquidcrystal library and configuring the arduino pins.

What you will learn

  • What libraries are required for the Arduino IR Remote Control Tester and Scrolling Marquee Device?
  • What components are needed to build the Scrolling Marquee Device?
  • What is the purpose of the Scrolling Marquee Device?
  • How does the littleBits number module function in the Scrolling Marquee Device?
  • How does the Arduino IR Remote Control Tester work?

Typology: Lecture notes

2017/2018

Uploaded on 05/27/2018

kingrangas
kingrangas 🇹🇿

1 document

1 / 252

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
www.EngineeringBooksPdf.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download IR Tester: Arduino Code for IR Receiver and LCD Display and more Lecture notes Communication in PDF only on Docsity!

Arduino Electronics Blueprints

Make common electronic devices interact with an

Arduino board to build amazing out-of-the-box projects

Don Wilcher

BIRMINGHAM - MUMBAI

Credits

Author Don Wilcher Reviewers Samuel de Ancos Liam Lacey Commissioning Editor Nadeem N. Bagban Acquisition Editor Harsha Bharwani Content Development Editor Ajinkya Paranjape Technical Editor Tejaswita Karvir Copy Editor Dipti Mankame Project Coordinator Harshal Ved Proofreader Safis Editing Indexer Priya Sane Graphics Sheetal Aute Production Coordinator Komal Ramchandani Cover Work Komal Ramchandani

About the Author

Don Wilcher is a passionate educator of electronics and robotics technology and an

electrical engineer with 26 years of experience. He has authored several books on Lego Robotics and Arduinos. His latest book published by Maker Media, titled Make: Basic Arduino Projects , has been approved by the Alabama State Department of Education to be on their reading list. He's also a Certified Electronics Technician (CETa) and Exam Administrator (CA) with ETA International as well as State Certified Teacher for Career Technical Education (CTE) as a Level 2 Specialist in electronics technology. He has worked on industrial robotic systems, automotive electronic modules/systems, and embedded wireless controls for small consumer appliances. While at the Chrysler Corporation, Don developed a weekend enrichment pre-engineering program for inner city kids. He's a contributing writer and webinar lecturer for Design News Magazine. He is also an electronics and robotics technologist who has developed 21st century educational products and training materials for Makers, hardware start-up entrepreneurs, and educators. I would like to thank my wife, Mattalene, and three children, Tiana, D'Vonn, and D'Mar, for their patience and understanding as I worked diligently to build and test Arduino circuits, coding, and writing during family time activities. This book is dedicated to you all. Also, I would like to thank my awesome Packt Publishing editors: Ajinkya Paranjape (content development editor), Harsha, Bharwani (acquisition editor), and Tejaswita V. Kavir (technical editor) for your patience, dedication, comments, and great suggestions on creating a wonderful book. I look forward to working with you all soon on another book project.

www.PacktPub.com

Support files, eBooks, discount offers, and more

For support files and downloads related to your book, please visit www.PacktPub.com. 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.PacktPub. com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@packtpub.com for more details. At www.PacktPub.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.packtpub.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

Free access for Packt account holders

If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.

[ i ]

Table of Contents

Table of Contents

Table of Contents

  • Chapter 1: A Sound Effects Machine Preface v
    • Parts list
    • A sound effects machine block diagram
      • Building the sound effects machine
      • Introducing SPI communication
      • Adding digital logic switches for WAV file selection
    • Adding SD and WAV file libraries to your Arduino sketch
      • The TMRpcm library installation
      • Adding a random function to play sounds automatically
    • Adding an LED bar graph display for selected sound
    • Summary
  • Chapter 2: Programmable DC Motor Controller with an LCD
    • Parts list
    • A programmable motor controller block diagram
      • Building the programmable motor controller
    • Let's build it!
      • Interfacing a discrete digital logic circuit with Arduino
      • Interfacing a small DC motor with a digital logic gate
      • A sketch of the LCD selection cursor
        • without an LCD selection feature The partially programmable DC motor controller program sketch that comes
        • selection feature The partially programmable DC motor controller program sketch with an LCD
    • Summary
  • Chapter 3: A Talking Logic Probe [ ii ]
    • Parts list
    • A talking logic probe block diagram
      • A talking logic probe – testing the EMIC 2 TTS module
      • EMIC 2 TTS module basics
        • EMIC 2 TTS module's key features
        • Electrical connections
    • Let's build it!
      • How does the talking logic probe code work
      • DecTalk speech synthesizer engine
    • Summary
  • Chapter 4: Human Machine Interface
    • Parts list
    • An HMI controller block diagram
      • Testing the transistor motor driver
      • Testing the pushbutton switch
      • Making the web page physical
      • Now serving, the Arduino
    • Getting into the real world using Breakout
      • Pre-lab exercise
      • Setting up the Breakout file directory
      • The motor control HTML script
    • Summary
  • Chapter 5: IR Remote Control Tester
    • Parts list
    • An IR remote control tester block diagram
      • IR signals and communication protocols
    • littleBits electronic modules
      • Wiring the IR receiver module
      • Wiring the Arduino and the LCD
      • IR Tester code
    • Summary
  • Chapter 6: A Simple Chat Device with LCD
    • Parts list
    • A Simple Chat device block diagram
    • Building a serial-based Simple Chat device
      • Serial-based Simple Chat device code
      • The Nordic nRF8001 BLE IC
      • The RedBearLab BLE shield [ iii ]
      • Installing the RBL_nRF8001 library
      • Uploading the BLEControllerSketch code to the Arduino Uno
      • Connecting with an Android smartphone
    • Summary
  • Chapter 7: Bluetooth Low Energy Controller
    • Parts list
    • BLE Controller block diagrams
    • Building a BLE DC motor controller
    • Building a BLE seven segment LED display controller
      • What's inside a seven segment LED display?
      • Wiring the seven segment LED display to the BLE shield
    • Summary
  • Chapter 8: Capacitive Touch Sensing
    • Parts list
    • A capacitive touch controller block diagram
    • Building a capacitive touch controller
    • The 555 timer IC's monostable operation
    • A Do It Yourself Design Challenge!
    • A buttonless servo motor controller
    • Summary
  • Chapter 9: Arduino-SNAP Circuit AM Radio
    • Parts list
    • Radio communication basics
      • Modulation
    • The Arduino-SNAP circuit AM radio block diagram
      • The littleBits latch electronic module
      • The UTC 7642 linear IC one-chip AM radio circuit
      • Building the IR remote trigger circuit
      • Building the Arduino-SNAP circuit interface
        • Testing the Arduino-SNAP circuit interface
    • Building the SNAP circuit AM radio
      • Subcircuit integration
    • DIY challenge – RedBearLab BLE control
    • Summary
  • Chapter 10: Arduino Scrolling Marquee
    • Parts list
    • The LCD and OLED basics
    • The Arduino scrolling marquee block diagram [ iv ]
      • Wiring the OLED LCD
      • Adding the code
    • Building an IR-controlled scrolling marquee
      • Adding the IR code
    • A DIY serial monitor LCD marquee
    • Summary
  • Index

Preface [ vi ] What this book covers Chapter 1 , A Sound Effects Machine, will teach the reader how to build an Arduino sound effects machine using an SD module, digital logic switches, a transistor speaker amplifier, and .wav files. Also, the reader will learn how to add a random function in order as to play different sounds automatically without using digital logic switches. Chapter 2 , Programmable DC Motor Controller with an LCD, shows the reader how to build an Arduino programmable controller to operate small DC motors. Also, to aid in operating the programmable controller, the reader will learn how to add a Liquid Crystal Display (LCD) to the electronic device as well. Chapter 3 , A Talking Logic Probe, explains a talking electronic instrument that the reader can build to test microcontroller and digital circuits. Also, the reader will learn how to wire an Arduino to an EMIC 2 (text-to-speech) module and program it using special character codes. Chapter 4 , Human Machine Interface, A Human Machine Interface (HMI) used in industrial controls to operate electromechancial devices, such as motors, will be discussed in this chapter. The reader will also learn how to build a HMI using an Arduino, a virtual server, and JavaScript to control a small DC motor. Chapter 5 , IR Remote Control Tester, allows the reader to learn how to build a testing device to check the operation of any IR remote control. Also, the reader will learn about IR detectors and digital codes using this electronic tester. Chapter 6 , A Simple Chat Device with LCD, will teach the reader how to send text messages to an Arduino using a Bluetooth Low Energy (BLE) device and an Android smartphone. Also, the RedBearLabs BLE Arduino shield used to send and receive text messages will be introduced to the reader in this chapter. Chapter 7 , Bluetooth Low Energy Controller, will show the reader how to send BLE control signals to an Arduino using the RedBearLabs BLE shield and an Android smartphone to control a DC motor. Also, a seven segment LED display's electrical operation will be discussed along with making letter characters using the BLE Controller. Chapter 8 , Capacitive Touch Sensing , explores a simple DC motor controller using an Arduino and a 555 timer IC-based capacitive touch sensor. The reader will learn the basic operation of the 555 timer by building an Arduino-enabled touch sensing controller. Chapter 9 , Arduino-SNAP Circuit AM Radio, introduces the reader the Elenco SNAP circuit kit by building an AM radio. Also, the reader will learn how to operate the AM radio using the RedBearLab BLE shield and an Android smartphone.

Preface [ vii ] Chapter 10 , Arduino Scrolling Marquee, discusses organic light-emitting diode (OLED) technology by building an Arduino-based scrolling marquee. Also, the reader will learn to use any ordinary IR handheld remote to control the scrolling effect of the OLED marquee. What you need for this book To build the awesome electronics gadgets and devices in this book, the following materials are required:

  • An Arduino Uno (Rev 3 electronics board).
  • The latest Arduino IDE can be downloaded from the website http://www.arduino.cc/en/Main/Software.
  • An assortment of electronic components (resistors, capacitors, transistors, diodes, seven segment LED display, 74LS04 Hex inverter IC, and 74LS NAND logic gate IC).
  • The EMIC 2 text-to-speech module. The module can be purchased from Parallax Inc's website https://www.parallax.com/product/30016.
  • littleBits deluxe set. The electronics module kit can be purchased from littleBits website http://littlebits.cc/shop.
  • The Elenco SNAP circuit kit. The Elenco SNAP circuit kit can be purchased from Adafruit website https://www.adafruit.com/category/117.
  • A solderless breadboard.
  • A jumper wire kit.
  • A small variable DC power supply (the variable output voltage rating of 0-24V DC with an output current rating of 2A max).
  • 9V batteries with battery snap connectors. Who this book is for This book is intended for those who want to learn about electronics and coding by building amazing devices and gadgets with the Arduino. If you are an experienced developer who understands the basics of electronics, then you can quickly learn how to build smart devices using the Arduino. Perhaps you have never used electronic components and are new to the Arduino, but have coding skills. In either case, this book will provide you with the knowledge to build amazing, smart, and fun-to-use devices. The only experience needed is a desire to learn about electronics, circuit breadboarding, and coding.

Preface [ ix ] Reader feedback Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of. To send us general feedback, simply e-mail feedback@packtpub.com, and mention the book's title in the subject of your message. If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors. Customer support Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase. Downloading the example code You can download the example code files from your account at http://www. packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you. Downloading the color images of this book We also provide you with a PDF file that has color images of the screenshots/ diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from: http://www.packtpub. com/sites/default/files/downloads/3601OS_ColoredImages.pdf. Errata Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub. com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

Preface [ x ] To view the previously submitted errata, go to https://www.packtpub.com/books/ content/support and enter the name of the book in the search field. The required information will appear under the Errata section. Piracy Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy. Please contact us at copyright@packtpub.com with a link to the suspected pirated material. We appreciate your help in protecting our authors and our ability to bring you valuable content. Questions If you have a problem with any aspect of this book, you can contact us at questions@packtpub.com, and we will do our best to address the problem.

A Sound Effects Machine [ 2 ]

  • 470 ohm resistor (yellow, violet, brown, and gold) (one unit)
  • 4.7 kilo ohm resistors (yellow, violet, red, and gold) (four units)
  • Tactile pushbutton or toggle switches (four units)
  • SD module (DFRobot [PN:DFR0071]) or Arduino compatible (one unit)
  • Breadboard
  • Wires A sound effects machine block diagram Building a sound effects machine is relatively easy as this device only requires four electronic subcircuits, as shown in the following block diagram: The blocks in the diagram represent the electronic subcircuits.The arrows are the electrical wires connecting to the target electronic subcircuit. The numbers shown with the diagonal lines attached to the arrows tell the number of wires connected to each electronic subcircuit.

Chapter 1 [ 3 ] The sound effects machine block diagram is an engineering tool used to convey a complete product design using simple graphics. The block diagram also makes it easier to plan the breadboard for prototyping and testing of the sound effects machine in a workshop or laboratory bench. One final observation of the sound effects machine block diagram is that the basic computer convention of inputs is on the left, the processor is located in the middle, and the outputs are placed on the right-hand side of the design layout. As shown, the tactile switches are on the left-hand side, the Arduino is located in the middle, and the small signal transistor amplifier with 8 ohm speaker is on the right-hand side of the block diagram. This left to right design method makes it easier to build the sound effects machine and troubleshoot the errors during the testing phase of project development. Building the sound effects machine The sound effects machine is quite simple in design and construction. There are a variety of ways to build this electronic device, such as on a Printed Circuit Board ( PCB ) or an experimenter board. The method I found to rapidly build this electronic device is to use a solderless breadboard, as shown in this diagram: