AVR Microcontrollers
You can use basically any microcontroller for this project, but ATMEL AVR microcontrollers are generally considered the best (since it's fast, feature packed & can be programmed using C code), which is why we provided you all with AVR programmer boards. Basically all of the ATtiny and ATmega microcontrollers using Flash memory will be suitable. ATmega's are physically larger to support more I/O pins and features, while ATtiny's are small and have reduced functionality. The main features you need are a few I/O pins (for motor control), PWM functionality (for speed control of your motor), an Analog input for EACH of your analog sensors, atleast 256 bytes of RAM (for your variables and function calls) and atleast 4 kB of Flash memory (to store all your code). Any of the ATtiny & ATmega microcontrollers should have all of these features (just make sure it has enough analog inputs). An example is the ATmega8.
Most of you will have an "STK200" programmer board, that lets you either plug any AVR microcontroller chip into it for programming, or use the "ISP" (In-circuit Serial Programming) cable to copy your code into the chip while it is still inside your PCB circuitry. This is the recommended way, but you will need to allow the ISP "Header" plug to be attached to your board and make sure your circuit is powered and functional. The full specs of the STK200 board can be found at www.atmel.com/dyn/resources/prod_documents/DOC1107.PDF. (Notice the 10 pin ISP header on your board & the supplied cable). Here is another pinout of the ISP header: www.equinox-tech.com/products/details.asp?ID=359. You need to connect the VCC, GND, RESET, MOSI, MISO and SCK pins to the correct pins on your chip, and make sure they wont interfere with anything else connected to those pins.
There are tonnes of websites explaining how to use AVR microcontrollers, as well as motor driver circuits, infrared sensor circuits, etc.
A large website about AVR microcontrollers is www.avrfreaks.net (Look at the "Newbie's Guide To AVR Development"). You can login as user "metr2800" also with the password "metr2800" if you need to. Another website is http://www.omegav.ntnu.no/avr/resources.php3.
The most important reference for AVR programming will be the manual for your exact chip, which can be found at AVRfreaks or the ATMEL website. These are PDF files of several hundred pages with the exact details of everything the chip can do, so whenever you are implementing something on the chip, use that reference to make sure you are setting the correct ports & values, etc.
Note that AVR microcontrollers can be programmed in either Assembly or C code. It is recommended that you program in C using the WinAVR compiler tools (see the CSSE4001 page for hints) and simulator. There are tutorials at http://www.itee.uq.edu.au/~cse/_atmel/Atmel_AVR_Resources/.
PCB & Circuit Design
There is a good beginners tutorial for Protel at www.itee.uq.edu.au/~cse/_misc_info/exploringp99se.pdf.
Click here for the ATMEL Protel Library (avr.lib) containing most AVR microcontroller chips. Save it to your computer, and in Protel 99, click on "Design -> Add/Remove Library" when your schematic is open, change the file type to *.LIB, then Add the AVR.LIB file. You will then be able to insert AVR microcontrollers into your project.
You also need to read various specifications at the ITEE Electrical Workshop. Make sure your PCB follows all their rules.
Transistor Design
The following is a rundown of how to design simple NPN transistor circuits. Basically, a transistor sets the Collector current (Ic) to be equal to the Base current (Ib) multiplied by the transistor's Gain "Hfe" (typically around 100). This lets you turn a large device (such as a motor or a Laser) from a small signal (such as from a microcontroller or a sensor). However, the transistor also requires a voltage Vbe between its Base and Emitter (typically around 0.7V). Here is an example circuit:

1st step is to determine how much current & power your load will take. If the load is a Laser or a Relay, then it should only be about 100mA at 5 or 12V, which is upto 1.2Watts (Power = Volts * Current).
2nd step is to determine the maximum Base current (Ib) you will have. If the Base resistor (Rb) is connected to a microcontroller, then this is generally a maximum of 20mA (enough to power a simple LED but not much more).
From these 2 steps you should find a transistor that has Max Collector Current (Ic) and Max Power Dissipation (Pd) ratings that are atleast twice your requirements (for safety), and has a DC Gain (Hfe) large enough to convert your Ib into your Ic. To amplify small signals or to turn on a small Relay / Motor / Laser under 100mA using a microcontroller, use a small transistor (eg: BC548) in the TO-92 package, but for any larger currents or power you will need a larger transistor (eg: TO-220 package), possibly with a metal heatsink.
3rd step is to determine the Base resistor value (Rb) to give the correct voltage Vbe (typically around 0.7V) for the transistor, based on what you are connecting it to. Use Ohm's Law (V=I*R) to work out the resistor that would give you the desired current (Ib) between the resistor's voltages (Vin and Vbe). Ideally, Ic = Hfe * Ib = Hfe * (Vin - Vbe) / Rb. However, transistors aren't perfectly linear amplifiers, so you wont get quite this much current output.
When you are trying to either switch something to be completely ON or completely OFF (which is a good idea for Relays, Lasers and Motor PWM), then you want to use the transistor at its "Saturation" limits, which means making Ib about twice as much as you originally calculated, so that it is definitely ON or OFF. In these cases, you can think of the transistor as a switch, that is open (not letting any current through, therefore Vce = Vcc) when Ib = 0, and closed (letting all the current through, therefore Vce = 0 or 'short circuit') when Ib = max. Just be aware that even when you have saturated the transistor on (Ib is max), Vce wont actually reach 0volts, but will usually be between 0.2 - 0.7V depending on the transistor.
Simple IR Sensor Circuit

A phototransistor works just like a normal (NPN) transistor, where the BASE current is multiplied to give the COLLECTOR current, except that in a Phototransistor, the BASE current is controlled by the amount of visible or Infrared light, which is why the device only needs 2 pins.
In the simple circuit above, assuming that nothing is connected to "Vout", the BASE current (controlled by the amount of light) will determine the COLLECTOR current, which is the current going through the resistor. Using Ohm's law, V=I*R, therefore the voltage at Vout will move up & down based on the amount of light. You can connect this to an OPAMP to boost the signal or directly to an Analog input of a microcontroller. You will then need to program the ADC unit of your microcontroller to read this analog voltage and use it in your code.
You can use basically any Infrared (~940nm) phototransistor, such as 657694 from Farnell ($0.98 each) or ZD1950 from Soanar / Jaycar ($0.40 each).
Note that Soanar & Jaycar are the same company and therefore Soanar sell anything that Jaycar sell. However, for some components such as the ZD1950, the Jaycar website www.jaycar.com.au has more information than the Soanar website!
Motor Control
For simplicity, use the L293N chip (L293N is rated at 1 Amp, L293D is only rated at 600mA) or the L298 (upto 4 Amps yet only $10 at Farnell!). They have H-Bridge circuitry inside, to allow full direction & speed control of your motor without the major hassles of designing a reliable motor driver. There are examples here: www.me.umn.edu/courses/me2011/robot/technotes/L293/L293.html.
For some reason, the L298 (4A at $10) is half the price of the L293 (1A at $20) at Farnell, so I would definitely recommend the L298, even though it is more complex. The L298 can even be wired in parallel mode to allow double its rated current. The L293 can probably do this too (for 2A output) but this isn't mentioned on the official specs so I'm not sure about this.
Electrical Design
Something you are likely to notice very quickly is that many of the circuits you build for mechatronics projects are highly effected by various types of electrical noise, since you are generally combining motors and other power hungry devices with sensitive electronics circuitry (eg: microcontrollers). Therefore you should ALWAYS put a "decoupling" capacitor (eg: a 0.1uF capacitor) across the power supply pins (VCC and VSS or GND) and as physically close as possible to any sensitive devices such as microcontrollers and other ICs to reduce the effects of electrical noise. These are also necessary when using devices such as a 7805 (+5V Voltage Regulators) on both the INPUT & OUTPUT side.
Also, whenever you are sending power or a signal using long wires, its best to wrap the GND wire (or even a VCC wire) around the other signal wires, to reduce the noise that is picked up by these "antennas".
Other things you might do to reduce noise include using separate batteries for the motors and the microcontroller, but using a 5V regulator for your electronics while connecting the motor straight to the batteries is usually sufficient.
