Arduino_Intro
Arduino_Intro
Battery
Connector Analog
(Input)
Pins
Power Pins
Arduino Uno – more details (Ref. 2)
Arduino Mega – Larger, more pins
(we won’t be using this today)
USB Serial Pins Digital Pins
Connector
Battery
Connector
Analog Pins
Power Pins
(Solderless) Breadboard (Ref. 2)
Breadboard Innards (Ref. 2)
Insert 22-gauge solid wire jumpers and component leads into breadboard clips to make
electrical connections without soldering. Use the edge “rails” for power (5V) and ground.
Introduction to Software
• Arduino microcontrollers are programmed using the Arduino
IDE (Integrated Development Environment)
– Can be downloaded for free from
http://arduino.cc/en/Main/Software
• Arduino programs, called “sketches”, are written in a
programming language similar to C and C++
• Every sketch must have a setup() function (executed just
once) followed by a loop() function (potentially executed
many times); add “comments” to code to make it easier to
read (technically optional, but actually required (by me))
• Many sensors and other hardware devices come with
prewritten software – look on-line for sample code, libraries (of
functions), and tutorials
Parts of the IDE main screen
Name of current sketch
Main menus
Action buttons/icons
Verify (AKA compile)
Text area for Upload (send to Arduino)
writing/editing
sketches. Start a new sketch
Open a sketch (from a file)
Save current sketch (to a file)
Open Serial Monitor window
Note that the servo has a plug attached to its ribbon cable. This is so that we can more
easily extend the cable using plugs and more ribbon cable. It also allows it to plug into
specific plugs built into some shields. Several companies make a few different Motor
Shields, which are shields specifically designed to drive servos, motors, and stepper
motors. These usually support 2 to 4 motors, although Adafruit has one that will
control 16. They generally have plugs built into the shield for the motors and often
drive them through some sort of a serial connection (I2C or SPI is common).
Sensors involved:
• Micro-SD card shield
• Data LED indicator (tells whether the SD card
is logging data (steady flash) or not (multi-
flash (indicating an error))
• Analog temperature sensor
• Digital 3-axis magnetometer sensor
Micro SD Shield and
Data LED Indicator
• Plug the micro-SD shield directly onto an unpowered Arduino
Uno. All the legs must go straight into the header – don’t
bend any.
• Wire an LED using the tiny breadboard:
- Positive (long) end wired to a safety resistor. Other end of
resistor connects to digital pin 5.
- Negative (short) end wired to ground.
Analog Temperature Sensor
• With the Arduino Uno unpowered, wire the TMP 36 sensor using the
table below
Pin Function Attached To
1 5V (Power) 5V pin
2 Analog Output Pin A2
3 Ground GND pin