Posts

Showing posts from February, 2018

How to interface LM35(Temperature Sensor) with Arduino

Image
       In this article, I am going to explain how to connect LM35 with Arduino. The LM35 series are precision integrated circuit temperature devices with an output voltage linearly proportional to the Centigrade temperature. It Operates from 4 V to 30 V and Calibrated Directly in Celsius (Centigrade). It Rated for Full −55°C to 150°C Range and low-Impedance Output, 0.1 Ω for 1-mA Load.          From Arduino ADC we read the analog value and then we will convert it to the °C. Arduino has 10bit ADC so we need to multiply the read value by 1024 and divide it by the voltage provided to LM35 to get the temperature in °C. void setup() { Serial.begin(9600); } void loop() { int analog = analogRead(A0); float MV = (analog/1024.0) * 5000; //5000 is the voltage provided float celsius = MV/10; Serial.print("In Degree Celsius= "); Serial.println(celsius); delay(1000); }           In above pr...

How to interface LED with Arduino

Image
            In this tutorial, I am going to tell you how to interface an LED with Arduino. I am using inbuilt LED of Arduino for this tutorial. Inbuilt LED is present at pin number 13. When the output signal is HIGH then LED turns on and when the output signal is LOW then the LED is off. In between on and off provided 1000ms delay to observe the output.             In void setup, the setup is provided that is pin 13 is made as an output pin and in void loop, the instructions are provided that executes continuously. In place of ledPin directly you can put pin number or LED_BUILTIN to connect the builtin LED. int ledPin = 13; void setup() { pinMode(ledPin,OUTPUT); } void loop() { digitalWrite(ledPin,HIGH); delay(1000); digitalWrite(ledPin,LOW); delay(1000); } Output When LED ON Output when LED OFF            Please feel f...