Microcontrollers: Inputs and Outputs
ABSTRACT
A microcontroller is an integrated circuit containing a processor and programmable read-only memory,[i] which is widely used as an interface between hardware and software systems. We will use the Arduino microcontroller. “Arduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. It’s an open-source physical computing platform based on a simple microcontroller board, and a development environment for writing software for the board.”[ii] This laboratory session pursues obtaining familiarity with the Arduino microcontroller operation, namely installation of communication with your computer, downloading the proper software and programming code, and gaining familiarity with the Arduino boards to implement basic I/O tasks.
1. INTRODUCTION
About the board
Arduino Microcontroller and its advantages
2. GETTING STARTED. How to talk to the board
Find a Computer
A. Download and Launch the Arduino Software
B. Selecting the Board
C. Selecting a Serial Port
3. PROGRAMMING the ARDUINO
A. Compiling and uploading your first program.
A.1 Compiling your program
A.2 Upload the program to the micro-controller board
B. Actual code: Processing open source programming
C. UNDERSTANDING the Blink Program
C.1 Introducing comments in our program
C.2 Variables
C.3 Pin Modes
C.3.1 Defining digital pins as output/input
C.3.2 PWM digital signals
C.3.3 Microcontroller of 8-bit resolution
C.3.4 Analog pins
C.4 Generating an output
4. MODIFYING the BLINK PROGRAM
A. Create a new variable
B. Use your new variable
C. Verify and upload your modified program
5. USING INPUTS to CONTROL OUTPUTS
A Understanding Pulse Width Modulation (PWM)
B Controlling the PWM output with a potentiometer
B.1 Establishing serial communication
B.2 Reading the analog signal from the potentiometer
B.3 Controlling the PMW
B.4 Displaying the input and output voltages
C Photo Resistor
6. INPUTS and OUTPUTS: “Positive logic” and “negative logic” programming
A. Recommended procedures to establish a digital input (for more critical applications)
A.1 Positive-logic input connection
A.2 Negative-logic input connection
B. Procedures to establish a digital output. Objective: to light up a bulb
B.1 Positive-logic output connection to light up a bulb.
B.2 Negative-logic output connection to light up the LED. (Recommended)
C. Microcontroller configured to function as a digital voltmeter
D. Build a counter to measure a sensor signal
[i] A ROM associates a specific output binary number with each input binary number according to its fixed internal logic. The fixed relationship between input and output distinguishes the ROM from other memory circuits.
[ii] Arduino.cc. Introduction. http://arduino.cc/en/Guide/Introduction, 2013.