General Information

Announcements
Web Resources
Other IAP classes

Lectures

1. The Basics
2. Timing, analog hack
3. IR (sony, irda)
4. Our favorite add-ons

Labs

1. Assembling the board.
2. Intro to programming.
3. Input/Output/IR
4. Your own project?
Hack Your Room:
Introduction to Microcontrollers

The following are three suggested projects for this week, to practice more programming and some interfacing with multiple outside objects. Pick one that interests you, or do something else you want to do.

If you need components, ask us (in your lab session, or in the open lab session).

Project 1: Danger! Entry Detected!

Is someone opening your room door? desk? fridge? etc... when you're not looking? Probably not... but maybe you want to know for sure. Maybe you want to surprise intruders/pets/friends or just silently record that someone was there.

The Challenge:

Your finished project should do the following (or something along these lines):

When a door is opened, the person opening it has 15 seconds to press a button mounted on the iRX board (which is hidden somewhere near the door). If they do not press the button, the iRX board does some combination of the following things:

  • silently notices and sends the date and time of the intrusion to a computer it is connected to.
  • turns on a buzzer
  • flashes on and off a light/appliance (radio? TV? blender?) using a relay

To sense when the door has been opened, possibilities include light (an LED on the door, photosensor on the frame), a reflectance sensor, a magnet mounted on the door and a magnetic sensor on the doorframe, and so on.

Extra challenge: if you want to run this circuit off a battery, you need to draw as little current as possible so the battery doesn't die. Set up the PIC so that it is in sleep mode (and drawing nearly no power) most of the time. Consult the PCM manual and look at details of sleep and interrupts.

Project 2: Temperature Logger

Ever wonder how cold your room gets at night? How long it takes to heat up from when you turn on the heater? Whether your heat goes straight to the right temperature or oscillates about the right temperature?

Or how about your stovetop or oven? How quickly, consistently, and accurately do they heat up?

You could stand around with a thermometer and record data, but this would be impractical. So let's automate the process!

The Challenge:

Your finished project should let you:

  1. Put the iRX board (with temperature sensor) somewhere. It should not need to be connected to a computer at this point.
  2. Start the board somehow.
  3. The iRX should start reading the temperature at some regular interval (which you picked when you programmed it).
  4. Once some number of samples (say, 50) have been taken, the iRX should let you know that it is done.
  5. You should then be able to hook up the iRX board to a computer and have it send the temperature data to the computer.

Go to it. For temperature sensors, we have thermistors (resistive temperature sensors. See Rob's analog hack for more details and source code for interfacing analog sensors, or ask us.

For some hints, go here.

Extra challenge: Figure out how to record the largest number of data points possible. (remember the PIC has only 68 bytes of RAM total).

Project 3: Wireless Communications! (2 or more people)

The Challenge:

Using the Irda or Sony12 IR protocols, as discussed in lecture, set up a system so that you can type text on one computer, transmit it from one irX board to another, and have it display on the other computer. Sort of a "wireless zephyr".

You may want to start more simply, by transmitting and receiving only a single character. For example, have an iRX board print a "*" to the computer every time it receives some IR signal. Sort of a "wireless morse code".

Extra Challenge: Using three or more boards, set up a system so that each iRX board has an "ID code", and so that you can specificy messages specifically for one "ID code" (even more like a "wireless zephyr").

Rob Poor's PIC projects page has information and source code for both IrDA and Sony12 IR protocols.