0% found this document useful (0 votes)
17 views3 pages

Iot Experiment 3

The document outlines an IoT experiment aimed at analyzing analog signal data acquisition using an Arduino. It details the required components, the theory behind analog to digital conversion, and provides a sample code for reading sensor data. The results confirm successful acquisition and conversion of analog signals into digital values, with applications in temperature measurement, light intensity measurement, and position sensing.

Uploaded by

Vikash Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views3 pages

Iot Experiment 3

The document outlines an IoT experiment aimed at analyzing analog signal data acquisition using an Arduino. It details the required components, the theory behind analog to digital conversion, and provides a sample code for reading sensor data. The results confirm successful acquisition and conversion of analog signals into digital values, with applications in temperature measurement, light intensity measurement, and position sensing.

Uploaded by

Vikash Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Iot Experiment-: 3

1. Aim / Objective

To analyze the process of analog signal data acquisition using an Arduino by reading analog data from
sensors, converting it into digital values using the built-in ADC (Analog to Digital Converter), and
processing the results.

2. Apparatus Required / Components Required

• Arduino Board (e.g., Arduino Uno, Nano, or Mega)

• Analog Sensor (e.g., LM35 Temperature Sensor, Potentiometer, Light Dependent Resistor
(LDR))

• Breadboard

• Connecting Wires

• Resistor (if required by the sensor)

• USB Cable (for Arduino connection to PC)

• Computer with Arduino IDE

3. Theory

Analog Signal Acquisition

Analog signals are continuous signals that can have an infinite number of values. In electronics,
analog signals are generated by sensors such as temperature sensors, potentiometers, light sensors,
etc. The Arduino, however, works with digital signals and uses an Analog to Digital Converter (ADC)
to convert these continuous signals into discrete digital values that the microcontroller can process.

The Arduino Uno has a 10-bit ADC, which converts the analog signal into a value between 0 and 1023
(since 2^10 = 1024). The voltage range for the ADC is typically from 0V to 5V (0V corresponding to 0
and 5V corresponding to 1023).

Pin Configuration

• Analog Input Pins (A0 to A5): Used for reading analog signals.

• The analogRead() function in Arduino is used to read the voltage at the input pin and returns
a corresponding digital value (0-1023).

4. Code

The following C code is used to acquire analog data from a sensor (like a potentiometer or LM35)
connected to the Arduino’s analog input pin and display it over the serial monitor.
#define analogPin A0 // Define analog pin (A0) for the sensor

int sensorValue = 0; // Variable to store the sensor reading

void setup() {

Serial.begin(9600); // Initialize serial communication at 9600 baud rate

void loop() {

sensorValue = analogRead(analogPin); // Read the analog input from the sensor

float voltage = sensorValue * (5.0 / 1023.0); // Convert the reading to voltage

// Print the sensor value and voltage to the serial monitor

Serial.print("Sensor Value: ");

Serial.print(sensorValue); // Print the raw value from ADC

Serial.print("\t Voltage: ");

Serial.println(voltage); // Print the converted voltage

delay(1000); // Wait for a second before the next reading

Explanation of the Code:

1. Pin Setup: The analog pin A0 is defined as the input pin for the analog sensor.

2. analogRead() Function: This function reads the voltage from the analog input pin and
returns a digital value between 0 and 1023 (corresponding to 0-5V).

3. Voltage Conversion: The raw sensor value is converted into voltage using the formula:
Voltage=Sensor Value×5.01023.0\text{Voltage} = \frac{\text{Sensor Value} \times
5.0}{1023.0}Voltage=1023.0Sensor Value×5.0

4. Serial Monitor Output: The sensor value and the corresponding voltage are printed to the
serial monitor.

5. Result

The analog signal from the sensor was successfully acquired by the Arduino. The raw sensor value
(from 0 to 1023) and the corresponding voltage were displayed in the serial monitor. The conversion
of analog signals into digital values was confirmed, and the values were proportional to the input
signal (voltage).

6. Applications

• Temperature Measurement: Analog temperature sensors like LM35 can be used to measure
the temperature.

• Light Intensity Measurement: LDRs (Light Dependent Resistors) can be used for light
intensity measurement in automation projects.

• Position Sensing: Potentiometers can be used to measure the position or angle in robotics
and automation systems.

You might also like