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

  • Stop wasting time looking for files and revisions. Connect your Gmail, DriveDropbox, and Slack accounts and in less than 2 minutes, Dokkio will automatically organize all your file attachments. Learn more and claim your free account.


Alex - Lab4: Data Logger

Page history last edited by Alex Sartin 7 years, 2 months ago

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?

From 0 to 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?

The processor's resolution is 10 bits. The range 0 to 1023 has 1024 steps equals to 2 elevated the 10th


Part B. Voltage Varying Sensors 


1. IR Distance Sensor

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?

The voltage increases when the object gets closer to the sensor.

The sensor match if the datasheet because from distances of 5cm to 80cm the voltage drops from 3V to 0.2V


2. Accelerometer

a. Include your accelerometer read-out code in your write-up.

#include <LiquidCrystal.h>

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


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)

int x,y,z;


void setup() {


  lcd.begin(16, 2);




  lcd.print("x=   Y=   Z=");



void loop() {













Part C. Count/Time-Based Sensors


1. Rotary Encoder

a. Upload a picture of your rotary encoder in action!


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


1. Design your logger

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


2. Reading and writing values to the EEPROM


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

1000 bytes

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

Split the values of the ADC  (0-16383) to store in 1 byte size (0-255).


3. Create your data logger!


Link: http://www.youtube.com/watch?v=HEOkIP26j4g




Comments (2)

Vivien Tsao said

at 4:14 pm on Aug 10, 2013

Hi Alex, I hope labs are going okay for you. It seems like you forgot to finish this lab report! 5/10

Vivien Tsao said

at 3:32 pm on Aug 14, 2013

Good. 10/10

You don't have permission to comment on this page.