ANALOG SIGNAL READ USING ARDUINO
IN this blog you will read about analog signal . the analog signal is that type of signal which are varying with time. may be repeat itself after interval of time. The value of signal changes with time.
in simple form we can say the value of signal is in sine , cosine or tangent form .
The temperature sensor gives output in analog form . the output current changes according to temperature. the most common temperature sensor ic is lm35. three pin ic . connect the temprature sensor with the aurdino pin A0 and connect the arduino with the computer and open the terminal . we we will see the value of temprature of atmosphere.
connect the aruduino bord with the computer. open the arduino programer ide and upload program .. connect the sensor. the value will be received on computer.
--+/*
AnalogReadSerial
Reads an analog input on pin 0, prints the result to the serial monitor.
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
This example code is in the public domain.
*/
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
int sensorValue1 = analogRead(A1);
// print out the value you read:
Serial.write("1st");
Serial.println(sensorValue);
delay(100);
Serial.write("2nd");
Serial.println(sensorValue1);
delay(100); // delay in between reads for stability
}
Comments
Post a Comment