Posts with «temperature sensor» label
Stuff we require:
- Arduino uno with usb cable
- Jumper wires
- Visual Studio (I had used VS 2012)
|LM35 interfacing with arduino|
In this post we are going to discuss how to upload temperature on thingspeak channel using sim 900 and arduino uno. As I had already uploaded the data on thingspeak channel using sim 900 and terminal software.
This project is a wireless temperature logger on thingspeak channel using gsm module and arduino.
For temperature sensor, we are using lm35, that gives output in millivolt which can be easily calibrated in terms of °C. We have to use adc module, since it's an analog sensor. Once the raw data is converted into temperature, we can upload the data.
Now, we are ready to upload the data on thingspeak channel. Thingspeak provides api for uploading of data. Before this, we have to use activate GPRS on sim900. We also to provide APN for accessing the internet. After activating the GPRS, we have to use GET like this:
Replace this api with yours, and data is the data you want to be upload. You can upload a number of field like temperature, pressure, humidity, etc.
Stuff you need:
- Arduino uno
- LM35 (it's output is in degree celsius)
- 12 volt adapter (for GSM module)
- Jumper wires
- Account on thingspeak
Arduino GSM module
Pin no. 7 ======> Tx
Pin no. 8 ======> Rx
Gnd ======> Gnd
Most of North America has been locked in a record-setting heat wave for the last two weeks, and cheap window AC units are flying out of the local big-box stores. Not all of these discount units undergo rigorous QC before sailing across the Pacific, though, and a few wonky thermostats are sure to get through. But with a little sweat-equity you can fix it with this Arduino thermostat and temperature display.
We’ll stipulate that an Arduino may be overkill for this application and that microcontrollers don’t belong in every project. But if it’s what you’ve got on hand, and you’re sick of waking up in a pool of sweat, then it’s a perfectly acceptable solution. It looks like [Engineering Nonsense] got lucky and had a unit with a low-current power switch, allowing him to use a small relay to control the AC. The control algorithm is simple enough – accept a setpoint from an encoder, read the temperature sensor, and turn the AC on or off accordingly. Setpoint and current temperature are displayed on an OLED screen. One improvement we’d suggest is adding a three-minute delay between power cycles like the faceplate of the AC states.
This project bears some resemblance to this Arduino-controlled AC, but it seems more hackish to us. And that’s a good thing – hackers have to keep cool somehow.
Filed under: Arduino Hacks, home hacks
List of components:
1. Arduino Uno
2. LM 35 temperature sensor
3. LCD 16*2
4. 10k potentiometer
5. ULN 2003
6. DC motor
7. Breadboard/ perfboard
First of all, we will monitor the temperature by using lm35 i.e. temperature sensor. It's scale factor is +10mV/°C which means with increment in temperature by 1° Celsius, the voltage is rise by 10 mV.
We can read adc count by analogRead(A0); // we are using channel A0
This will give us a digital count of adc which varies from 0 to 1023, we have to convert these count into voltage and then into temperature. First of all, we will convert into voltage:
In arduino uno, adc is of 10-bit.
Resolution = Vref/(2^n-1), where n is bit (in our case it's 10)
Resolution = 5000 / 1023, ( Verf = 5000 mV and 2^10 is 1024 minus 1 is 1023)
Resolution = 4.887 mV
Now, we have to convert voltage into temperature:
Temperature (in °C) = Voltage (in mV) / 10.0
With this temperature monitoring is over.
LCD interfacing is simple since we have library for the same with proper documentation.
Now coming to pwm part. In arduino, we can control output voltage by pulse width modulation (pwm).
Duty Cycle = Ton / (Ton + Toff)
Duty Cycle = Ton / T
Duty Cycle (in %age) = (Ton / T)*100
In arduino uno, we have six pwm channels viz, pin no. 3, 5, 6, 9, 10 and 11.
analogWrite(pin no, value)
Pin no may be 3, 5, 6, 9, 10 and 11
Value varies from 0 to 255 since pwm resolution is of 8-bit (2^8-1)
0 for 0% duty cycle 0 volts
64 for 25% duty cycle 1.25 volts if(val<=40.0)
|Schematic of temperature controlled fan|
In this post, we will learn how to interface temperature sensor (LM35) with arduino uno.
Arduino Uno is an open-source electronic prototype board used by beginners, hobbyists and developers across the globe, Arduino have so many forums, if you need any help, guidance.
Arduino uno is based on atmega 328p microcontroller. Arduino uno comes in two pckages:
Through-hole package and SMD package.
For the time being, we are considering through-hole package. It's a 28-pin DIP (dual inline package) IC. There are 14-digital I/O pins and 6-analog input pins.
Arduino has a rich library support. For example: led blinking, lcd interfacing, etc. all these program can br found in library.
In order to display data received from temperature esnsor, we need display device like seven segment display or lcd or alternatively we can use serial monitor.
LM-35 is a temperature sensor. It's sensitivity is 10mV/°C which literally means with rise in temperature by 1° Celsius the voltage is increased by 1 millivolts. It's graph is linear.
It's range is from -55° Celsius to +150° Celsius.
Arduino have 6-adc channels viz, A0-A5. These are 10-bit adc means 0-5 analog volt is converted into digital count ranging from 0-1023
Resolution = Vref/((2^10)-1) = Vref/1023
We are taking Vref as 5 volt. Now, the resolution comes out to be 4.887 mV
In order to convert digital count into voltage, we have to multiply it by 4.887. Now we have voltage. We have to convert this voltage into temperature. This is known as calibration.
Temperature in ° C = 4.887 * digital count (0-1023) /10.0
Here are the screenshots of prteus simulation and code:
Download arduino code and simulation from the link given below:
Stay tuned for more updates !!
What does it do?
I managed to finish my first robot on witch I spent a lot of time, mostly because a lot of stuff was new to me. It is not very complicated but it seems to do it's job well. I posted everything about the build on my blog and also the parts I used (and the ones I rejected).
It is a Tamiya tracked platform with dual gearbox. I used an Arduino UNO and a SeeedStudio motor shield to drive it from a 11.7 lipo battery I had from my RC heli. It uses a Ultrasonic sensor to look in front and also a DIY IR sensor for backing up. I also added a temperature sensor for the fun of it.