PHYSICAL COMPUTING CONCEPTS:
Physical Computing [W ] connects to the real world beyond your keyboard, mouse and display. It connects to many different things, makes decisions and makes things happen.
I want to just Build The Robot! (SKIP AHEAD)
Arduino[W] is a tool for making computers that can sense and control more of the physical world than your desktop computer. Arduino is intended for use by both non-technical people with no previous programming experience and seasoned pros who love to tinker.
We'll look at it this way:
OK, let's look at that closely. There are 3 main parts to any "Intelligent System" that connects to the real world:
- SENSORS: That 'feel the world' and give us data about Temperature, Pressure, Location, Light, Sound, Time, Position, Speed and much more. They are INPUTS to the system.
- DECISION MAKING: After checking what is being Sensed, decisions are made to decide what to do about the situation. Like: Too Cold: Turn on the Heat, Too Close: Back Up, etc. This is Software Sketch CODE.
- ACTUATORS: Devices that can take actions like turn other things on and off, Light LEDs, make sounds, control motors etc. They are OUTPUTS from the system.
You will be building a Robot that does these things. The Physical Computing devices you will have on your robot are:
- SENSOR: Ultrasonic Distance Sensor
- ACTUATORS: ServoMotor and DC Motors with Motor Driver, and maybe Buzzer.</span>
The software you will use and perhaps later change does these things, over and over again:
- Check SENSORS
- Make DECISIONS
- Take ACTIONS
Every automatic system, from your home heating system to the Mars Rovers, does these same things. If you can make a simple thing work, you can start to make more and more interesting things, including things that no one else has made.
Some simpler things just follow a set of instructions to take Actions (they don't have Sensors), like the BLINK program. You will also be able to decide on a sequence of instructions that your Robot will use to do a set of Moves that you decide.
Physical World Connections:
You will be putting together wires and connections, batteries, motors, servomotor, distance sensor etc. So this is Electricity and Electronics (AKA Detailed Electricity).
Making things with Electronics and MicroComputers is different than Woodworking or Metalworking. There are a couple of little problems:
- Electricity is INVISIBLE !
- AND, Software is INVISIBLE !
Not to worry! We will show you the ways to make these powerful tools Visible so you can use them. You've already seen the Arduino IDE which makes Software Visible. But we need to think about Wires and Circuits and Components like resistors and capacitors and stuff.
Again, "Watch Closely Now" (You may like the Kris Kristofferson version HERE)
RealityCheck: Most electronics stuff runs on 5 Volts Direct Current. A USB cable puts out .. 5 Volts. Arduino runs on 5 Volts (let's abbreviate that to "5V"). Oh: Some stuff these days runs on 3.3V.
Let's look at the graphic below:
Top Red Rail: This is the 5V that runs Arduino and most attached devices.
Bottom Blue Rail: This is the Ground connection for Arduino and most attached devices.
Everything Else: (Almost) is connected in between +5V and Ground.
OK, Time to Learn some Nerdy Names!
ONES and ZEROS...
HIGH and LOW...
... YOU'LL KNOW!!
OK, Fans, it's ELECTRICITY Time ! And, the weird thing about electricity is it's INVISIBLE! So we need to learn how to make it visible to us. Here's the way we think about the Electrical Reality of Arduino-based systems:
These are terms you will hear many times in Arduino and Electronics:
HIGH = 1 = ON = 5 Volts
LOW = 0 = OFF = 0.0 Volts
Arduino has many electrical connections coming from the Atmel chip inside the plastic package to metal PINS or metal tabs. We will use the PINS to electrically connect to Input and Output Devices.
This is the reality point where "ON" and "HIGH" means really that Arduino is putting out 5V on an output pin. And "OFF" or "LOW" means really that Arduino is putting out 0V on an output pin.
Often an actual circuit (like the YourDuino and Breadboard hookup) gets to be a confusing bunch of wires and components going in all directions. To keep our heads together, we draw Circuit Diagrams to show what we're trying to do.
Notice the Symbols used in the diagram above for things like: SWITCH, RESISTOR, LED. And there are Labels on connections, like GND, INPUT, OUTPUT, ARDUINO etc.
There's our theme music again: "Watch Closely Now"... (You may like the Kris Kristofferson version HERE)
In the diagram above, we have added a dose of reality: Arduino is powered (usually) by +5.0 Volts of DC (Direct Current).
We show the +5.0 Volts connected HIGH on the top. Look closely at Your Arduino or YourDuino RoboRED board. Find the PIN marked "5V". that's the one +5.0V power is connected to. Where does it come from?? (To start, from the USB cable from your computer to Arduino.)
We show GND (Ground) connected LOW down on the bottom of the diagram. Look at Your board (or a photo).. find the PIN marked "GND". ("Watch Closely Now" - There are actually 3 "GND" PINS).
As we mentioned earlier, the parallel lines of +5V HIGH on the diagram, and GND - LOW on the diagram are often called "RAILS". Kind of like railroad RAILS across the top and bottom. Almost everything that happens on Arduino is between the +5V HIGH RAIL and the GND-LOW (0.0V) RAIL.
When a PIN (or wire or connection) changes from 0 to 1, or 1 to 0, we say it is a SIGNAL. Kind of like someone raising up a flag or lowering it.
OUTPUT SIGNALS: An LED or Buzzer connected to to an Arduino OUTPUT can "signal" you that something has happened.
INPUT SIGNALS: If you push a button that changes an INPUT, you "signal" Arduino that something should be done.
Oh, um.. what's a BIT anyway? It is a Binary InTeger which is a number which has only two possible values: 0 and 1. Each Arduino Input or Output PIN is one BIT inside Arduino. (A GROUP of 8 BITS is called a BYTE. Bet you knew that!).
OK, Look again at the diagram above:
- The pushbutton switch causes the </span> INPUT</span> to change from </span> LOW</span> to </span> HIGH</span> , which is a "signal" to Yourduino.</span>
- Yourduino can change the </span> OUTPUT</span> from </span> LOW</span> to </span> HIGH</span> , causing electricity to flow through the LED, light it up and "signal" you.</span>
OK, another one of those tekkie words:
DIGITAL: This means Arduino will use these Pins only as ON or OFF.
You will hear "Digital" things described three or four ways: but
- " 0</span> " and "</span> OFF</span> " and "</span> LOW</span> " and Zero Volts mean the </span> same thing.</span>
- "</span> 1</span> " and "</span> ON</span> " and "</span> HIGH</span> " and +5 Volts mean the </span> same thing.</span>
|0.0 Volts(GND)||5.0 Volts(5V)|
Let's listen to the way these terms are used by people talking about this Microcomputer Stuff. You'll hear stuff like:
- "When SOFTWARE inside the Arduino sets an OUTPUT PIN to a "1" it is "ON" and "HIGH" . Arduino connects the OUTPUT PIN to the HIGH RAIL which is 5.0V (5V)."</span>
- "When SOFTWARE inside the Arduino sets an OUTPUT PIN to a "0" it is "OFF" and "LOW". Arduino connects the OUTPUT PIN to the LOW RAIL which is 0.0V (GND)."</span>
Sorry for the multiple names for the same things, but those names are widely used, and it's time for you to know them...
PINS, BITS, ONES and ZEROS, HIGH and LOW... (Make Sense??)
Please email comments, critiques, suggestions and questions to: email@example.com