Sensors and Reactors
Now that you've got a vague notion of SOME of the things you can connect to a Micro Controller, let's get into what they do - and some ways to use them.
On the left are Sensors. They DETECT something - or changes in something - which is what I want to use them for. When one DETECTS a change - I want to have it tell the "brain" that something has happened, and TRIGGER a reaction / response/ behavior.
A Passive Infra Red (PIR) detector sends out a beam of infra red light, illuminating its field of view in infra red. It also has an infra-red diode - that SEES the light bouncing back from things in its field of view. ANY change in the infra red level it is watching will change its output signal - which the "brain" can sense. With a fresnel lense on it, one of these little sensors has about a 160 degree field of view. PIRs are great motion detectors - and even inexpensive little ones can have a range of 20 to 30 feet. They can also be VERY sensitive to changes - sit still in front of one for 10 or 15 seconds and it won't notice you. BUT - blink your eyes or stick out your tongue - and it'll detect THAT!
Like the PIR, an ultrasonic detector can detect motion. But, because it's sending out sound and listening for reflected sound, it can figure out where and how far away a change in its field of view is - sort of like radar. By providing direction AND distance of a change, two of these things can be used - to have the "brain" track movement it detects. Think of making something that "follows" you as you move around it - OR - turn away from you as if you are a Paparazzi with a camera.
A Light Detecting Resistor (LDR) can detect changes in the amount of light falling on it and tell the "brain" how much change it's "seen". A shadow passing over it will, when the LDR is part of what is called a Voltage Bridge Circuit, feedback up to1024 different levels of response.
Pressure Pad sensors change their resistance based on how much pressure is exerted on them - again in up to 1024 levels. Put one under something and as soon as someone touches that something, or starts to lift it - it can tell the "brain" about that. Put it inside something that someone might stick a finger in - and it can tell the brain - and the brain can tell a speaker to say "What they hell are you doing?!".
A tilt switch often uses a little metal ball inside a cilinder, two electrical contacts in the bottom of the cylinder. Tilted enough, the ball will roll onto BOTH contacts and close a circuit - or the other way round. If you want something to be able to lean - but only lean so far - one of these things will do the job,
A Three Axis Accelerometer can detect movement - and the speed and direction of that movement. With a little programming magic it can keep something that might tip over, from tipping over.
Using one of the several temperature sensors available, you can have something tell when AND where a warm hand or finger touches it perhaps then making different sounds based on where it is touched.
On the right of the above illustration are the Reactors / Action components. When a sensor senses something - and tells the brain about it - the brain can use one of these things to React / Act.
An LCD (Liquid Crystal Display) can display images, words or both - sent to it from the "brain".
LEDs can light something up with a specific color. An RGB LED, which has Red, Green and Blue little LEDs in one package, each independently controllable, can be ANY visible color and change colors dynamically. Combined with a fiber optic cable or an acrylic rod - the LED can be hidden - and its light distributed to specific locations where you want them to be seen.
Small speakers and piezo electric buzzers can generate sounds - or words - or music - all controlled by the "brain". The lower frequency response isn't that good and they're not very loud - but they are fun to play with. Though not shown, there are several Text To Speech chips that can add an actual voice which will say what you tell it to say. Some will also play WAV and MP3 and MP4 file format sounds - as well as put out built in sound effects. This last option can be a little more expensive - around $40 to $50 to add this output capability. . .
For actual motion - there are a range of available options - from small electric motors, to servos and fine movement via a stepper motor - that can be turned in very small incrementsand at a range of RPMs.
These are just SOME of the things you can connect to and control with a Micro Controller.
Combine a few of these things - add a program to make them DO things and you can make things that can interact with people - or pets ; ).