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

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

WilsonTang_MakeaDataLogger_Lab4

Page history last edited by Wilson Tang 10 years, 8 months ago

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

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?

10 bits of resolution.

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 range of voltage goes from 0V to 3.7V, but sometimes it went up to 4V. If I see the graph of Ouput voltage vs Distance in the datasheet, the maximum voltage at 8 cm is like 3.7V, so my sensed values match up with the datasheet.

 

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

/*

 ADXL3xx

 

 Reads an Analog Devices ADXL3xx accelerometer and communicates the

 acceleration to the computer.  The pins used are designed to be easily

 compatible with the breakout boards from Sparkfun, available from:

 http://www.sparkfun.com/commerce/categories.php?c=80

 

 http://www.arduino.cc/en/Tutorial/ADXL3xx

 

 The circuit:

 analog 0: accelerometer self test

 analog 1: z-axis

 analog 2: y-axis

 analog 3: x-axis 

 

 This example code is in the public domain.

 

*/

#include<LiquidCrystal.h>

 

// 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)

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

void setup()

{

  // initialize the serial communications:

  lcd.begin(16,2);

}

 

void loop()

{

  // print the sensor values:

  lcd.print("X");

  lcd.print(analogRead(xpin));

  // print a tab between values:

  lcd.print("\t");

  lcd.print("Y");

  lcd.print(analogRead(ypin));

  // print a tab between values:

  lcd.print("\t");

  lcd.print("Z");

  lcd.print(analogRead(zpin));

  lcd.print("/t");

  // delay before next reading:

  delay(100);

  lcd.clear();

}

 

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


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

 

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

1000 byte sizes data samples.

 

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

divide the analog data(10bits (0 -1023) by 4 to make it in the scope of the 8 bits(0-255)

 

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

http://youtu.be/TqO02hY1HE8

b. Post a link to the Lab 4 Data Logger Hall of Fame.

-check page

 

 

 

 

 

 

 

 

Comments (1)

Vivien Tsao said

at 5:45 pm on Aug 10, 2013

good job! 10/10

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