• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

View

# NathaliaTravaglia_Lab4

last edited by 7 years, 1 month ago

# Make a Data Logger!

## Part A.  Writing to the Serial Monitor

a. Based on the readings from the serial monitor, what is the range of the analog values being read?

0-1023

b. How many bits of resolution does the analog to digital converter (ADC) on the Atmega32U4 have (hint: where might you look to find this sort of thing)? How many are you using with the range of values you're seeing?

10 bits

0-1023

## Part B. Voltage Varying Sensors

1-

a. Describe the voltage change over the sensing range of the sensor. A sketch of voltage vs. distance would work also. Does it match up with what you expect from the datasheet?

It depends on the distance of the sensor, as far the object is from the sensor lower is the voltage, when it is closer the voltage is higher.

2-

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// these constants describe the pins. They won't change:

const int xpin = A3;                  // x-axis of the accelerometer

const int ypin = A2;                  // y-axis

const int zpin = A1;                  // z-axis (only on 3-axis models)

void setup()

{

// initialize the serial communications:

lcd.begin(16,2);

Serial.begin(9600);

}

void loop()

{

lcd.print("Nathalia ");

lcd.print(xvalue);

// print the sensor values:

// print a tab between values:

Serial.print("\t");

// print a tab between values:

Serial.print("\t");

Serial.println();

delay(100); }

## Part D. Logging values to the EEPROM and reading them back

1-

a. Turn in a copy of your final state diagram.

2-

a. How many byte-sized data samples can you store on the Atmega32U4?

b. How would you get your analog data from the ADC to be byte-sized?

### 3. Create your data logger!

a. Use the lab camera or your own camera/cell phone to record and upload a short demo video of your logger in action.

What happened to the second half of your lab report? :( -5