Before we continue any further, please make sure that you have at least the following in your lab kit.
If you have any problems identifying your parts, please notify a GSI
If you are missing any parts, please find Tom Clark
Your Arduino board will look something like this

The largest benefit of the Arduino is the fact that you are not limited to programming in the lab. Instructions on how to install a copy of the Arduino IDE on your own machine can be found here (Mac, Windows and Linux).
Start the Arduino IDE by clicking the Arduino icon on the desktop.
For those of you who are familiar with microprocessor programming, the first thing you will notice is the Arduino’s minimalist approach.

There are 7 shortcut commands that you can use with the Arduino IDE:
There are only a few things you need to configure and to learn before you begin. First, you need to make sure that the IDE has the correct target chosen. Select the Arduino Duemilanove from Tools>Board.

Secondly, the board communicates with the computer via a USB interface, but with a serial protocol. All this means is that you must select the correct serial port number. First, plug the provided USB cord into the computer. Please note that the Dell computers have some problems with the USB port located in the front. You can try both the USB port on the side of the monitor, or behind the machine. Once it is complete, open up the Device Manager (shortcut located on the Desktop) and check for the COM port that says USB serial port.

Make sure that the same COM port number is checked in the Arduino IDE.

Upload the provided sketch “HelloWorld” to the Arduino Board.

And check the serial monitor. You should see something like this:

Congratulations, you’ve successfully compiled, uploaded and communicated serially with the Duemilanove.
Next, load the “Blink” sketch.

You should see the onboard LED next to the digital pin 13 blinking.
In this section, I’ll explain the different parts of the sketches you just uploaded. There are two mandatory functions in every sketch: setup() and loop(). As their names imply, setup() is where you will choose how to use the board, and loop() can be thought of as a never-ending while-loop.
In the “HelloWorld” sketch, the need for serial communication is declared in setup(). Then the board constantly returns “Hello World!” via the USB serial port. This explains why the serial monitor is saturated with “Hello World!”.
void setup() {
Serial.begin(9600);
}void loop() {
Serial.println("Hello World!");
}
The “Blink” sketch is more interesting. In setup(), the pin 13 is declared to be an output. Then in loop(), digitalWrite sets pin 13 to logical HIGH, and nothing else is done as we wait for a delay of 1000ms. After which, pin 13 is set of logical LOW, and turned off. This behavior is then repeated ad nauseum.
The next part of the lab focuses on setting up buffers to protect your board from mistakes. Although the Arduino is relatively cheap, not all microprocessors are.int ledPin = 13; // LED connected to digital pin 13
void setup() {
pinMode(ledPin, OUTPUT);
}void loop()
{
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(1000);
}
While the sensors and outputs in the labs generate and draw little current, that is not the case for everything you will encounter in the course of the ME102 project. Buffering the inputs to and outputs from the Arduino adds a layer of protection. If an accidental short suddenly appears, the cheap buffer will break, and the board will be preserved.
To buffer the digital input of the Arduino, we use the 74LS14 (datasheet). The 74LS14 is a hex schmidtt trigger inverter. It takes a digital input and outputs the opposite. HIGH becomes LOW, and LOW becomes HIGH. In TTL (Transistor-to-Transistor Logic), a HIGH signal is anything from 2.2V to 5V whereas a LOW signal is anything from 0V to .8V. The area from.8V to 2.2V is essentially undefined behavior.The schmidtt trigger is a property of this particular chip that allows it to be slightly less responsive to noise. And finally, there are six such inverters on a single chip (hence hex).
To setup the 74LS14 :

Digital output buffering with the SN7417 (datasheet) protects the Arduino. The SN7414 is a hex buffer with open collector high voltage output. An open-collector only guarantees that a LOW input results in a LOW output. There are no guarantees for a HIGH input.
By using a pull-up resistor on the output end, one can supply any level of voltage within the operational specifications of the IC. For the SN7414, it is 15V.
The basic function of a pull-up resistor is to insure that given no other input, a circuit assumes a default value. Consider the circuit in “Configuration of SN7417”, when the digital signal input is HIGH, the IC acts as a high impedance part so current flows to the right. When the digital signal input is LOW, the IC becomes a current sink. IN order to prevent IC destruction, pull-up resistors are generally in the range of 10k to 47k ohms. Special cases do exist as you will see at the check-off task.


We protect the ADC with a voltage follower. In your lab kits, you may either have a OPA4342(datasheet) or a TLV2374I(datasheet). Both are suitable for our purposes.
To setup the voltage follower with the op amp:
