Quantcast
Channel: Temperature Measurement Projects - PIC Microcontroller
Viewing all 121 articles
Browse latest View live

Intelligent Fan Controller. Part 1 – Schematic using pic microcontoller

$
0
0

he Intelligent Fan Controller is designed to control the noise generated by the fans inside your computer. It does this by varying their speed based on temperatures measured inside the case. When it is cool the fans will run slowly and they will only speed up when needed… when your computer is running hot.

Anyone with a noisy computer, especially a Media Centre system in the lounge room, will benefit from this project. After installing this device, my computer is now so quiet that I can hardly tell that it is running – and that is a blessed relief.

Intelligent Fan Controller. Part 1 - SchematicThe main features are:

  • Configurable speed control based on temperatures measured inside your computer
  • Control up to eight fans and measure up to four temperatures
  • USB interface and Windows software for setup and monitoring
  • It will run independently without the Windows software (once it has been configured)
  • Cheap – The cost for all the parts is about $48

The Intelligent Fan Controller was featured in the July 2010 issue Silicon Chip magazine. Altronics are selling a full kit of parts for the Intelligent Fan Controller (Part nbr K6120). This is an easy way to get everything that you need to build the controller including a pre programmed microcontroller and a printed copy of the full magazine article – ideal if you are not an electronics expert and just want to silence your computer.

The Circuit

The circuit below shows just how simple the fan controller is. In the centre is a Microchip PIC18F2550 microcontroller, it reads the voltage from the temperature sensors LM335 (on the left) and controls the voltage converters on the right. It is by varying the voltage output of the converters that the microcontroller can control the speed of the fans.

Intelligent Fan Controller. Part 1 - SchematicEach voltage converter is implemented as a buck converter. The microcontroller generates a string of pulses on each output for each buck converter and, by varying the pulse width, the microcontroller can vary the output voltage. In this implementation the pulse rate is 2.5KHz and the pulse width varies between zero and 170µS to give an output between zero and 12V. Note that IC2 UDN2981A does double duty as a fast switch and a diode – both required in the buck converter design. For $2.20 this is a handy little chip.

 

For more detail: Intelligent Fan Controller. Part 1 – Schematic

The post Intelligent Fan Controller. Part 1 – Schematic using pic microcontoller appeared first on PIC Microcontroller.


Temperature Recorder using PIC12F683 microcontroller

$
0
0

Description

This project uses a MicrochipPIC microcontroller, a serial EEPROM and a thermistor to create a temperature recorder.

Temperature Recorder

Performance

The temperature is measured and stored at user programmable intervals; this can be from 1 second to 256 seconds. The time interval is set by programming it and the start time into the EEPROM.

Most of the time the PIC will be asleep and the EEPROM IC is inactive. This gives a very low current consumption of approximately 50 uA or about 1 mAh per day.

The EEPROM used is 32kBytes which can store up to 32,000 measurements. This could be one measurement every 30 seconds for 11 days for example.

The combination of thermistor and analogue circuit gives a range of between about -40 °C and +100 °C although the linear range is between about -10 °C and +40 °C.

Complete Unit

In this picture the temperature recorder can be seen with the external thermistor plugged in. The connector on the end contains power, I2C clock and data and analogue input.

The overall size of the complete unit is 40 mm long, 26 mm wide and 16 mm tall.

In this picture the temperature recorder is connected to a battery pack with 4xAAA batteries. This gives a good indication of the size and shows that I need a much smaller set of batteries.

PCB (version 1)

The first version of the circuit is built on stripboard with DIL packaged ICs and conventional through-hole passive components.

The PIC microcontroller is to the left of centre on the PCB with the EEPROM IC mounted vertically to save space on the right of centre.

The external connectors are the 1.3mm power socket on the bottom left and the 5 pin SIL socket on the right.

Schematic Temperature Recorder

The other components are the ICSP socket with resistor and diode at the top left, crystal oscillator and two capacitors on the left of the PIC, the two I2C pull-up resistors next to the EEPROM and the resistor for the thermistor potential divider at the top right.

 

For more detail: Temperature Recorder using PIC12F683 microcontroller

Current Project / Post can also be found using:

  • pic temperature/humidity logger
  • temperature measure using pic
  • temperature measuring using microcontroller

The post Temperature Recorder using PIC12F683 microcontroller appeared first on PIC Microcontroller.

Simplest Temperature Data Logger using PIC12F683

$
0
0

Introduction
There are varieties of digital temperature logger projects available online based on different microcontrollers. The one I am going to talk about is based on a Microchip’s 8-pin microcontroller, PIC12F683. It reads temperature values from a DS1820 digital sensor and stores in its internal EEPROM. PIC12F683 has 256 bytes of internal EEPROM and we are going to store the temperature values in 8-bit format. This means only the eight most significant bits of temperature data from DS1820 will be read and as such the temperature resolution will be of 1 degree C.

Logger

My temperature logger has following features:

  • Reads temperature from a DS1820 sensor and stores in the internal EEPROM locations.
  • Can store up to 254 temperature values. EEPROM location 0 is used to store the sampling interval, and location 1 is used to store the number of records.
  • Three sampling interval options: 1 sec, 1 min, and 10 min. This can be selected during powering up.
  • Start and Stop buttons for control operations.
  • The recorded temperature values can be sent to PC through a serial port. A separate Send button is available to initiate data transfer.
  • A LED to indicate various ongoing operations.
  • Reset button to clear all previous records.

 

Circuit Design
PIC12F683 has 6 I/O pins, out of which one (GP3, pin 4) is I/P only pin. Here is how we are going to assign the port pins.
The six I/O pins of PIC12F683 are assigned as follows:
1. GP0 (Pin 7, I/P): This pin will be used to read the temperature value from DS1820 sensor.
2. GP1 (Pin 6, O/P): This will be used for serial data transfer to a PC.
3. GP2 (Pin 5, O/P): LED output pin.
4. GP3 (Pin 4, I/P): Send (tactile switch)
5. GP4 (Pin 3, I/P): Stop (tactile switch)
6. GP5 (Pin 2, I/P): Start (tactile switch)

Current Project / Post can also be found using:

  • how to measure temperature with pic and micro c with data logger
  • pic12f683 based data logger
  • PROJECT TEMPERATURE MEASUREMENT AND RECORDING USE MICROCONTROLLER
  • Digital clock with automatic alarm and temperature monitor using pic pdf

The post Simplest Temperature Data Logger using PIC12F683 appeared first on PIC Microcontroller.

Low cost temperature data logger using PIC and Processing using PIC12F1822

$
0
0

This project describes an easy and inexpensive way of adding a digital thermometer and data logging feature to a PC. It involves a PIC microcontroller that gets the surrounding temperature information from the Microchip MCP9701 sensor, and sends it to a PC through an USB-UART interface. The USB port of the PC is also used to power the device. The open-source Processing  programming platform is used to develop a PC application that displays the temperature in a graphics window on the computer screen. The PC application also records the temperature samples plus date and time stamps on an ASCII file.

Logger

Theory of operation

This project is based on Microchip’s PIC12F1822 microcontroller from the enhanced mid-range PIC family. It has got 8-pins in total and the power supply voltage range of 1.8V to 5.5V. The microcontroller has four 10-bit ADC channels and one Enhanced Universal Synchronous Asynchronous Receiver Transmitter (EUSART) module for serial communication. The temperature sensor used here is MCP9701A, which is a Low-Power Linear Active Thermistor IC from Microchip Technology. The range of temperature measurement is from -40°C to +125°C. The output voltage of the sensor is directly proportional to the measured temperature and is calibrated to a slope of 19.53mV/°C. It has a DC offset of 400mV, which corresponds to 0°C. The offset allows reading negative temperatures without the need for a negative supply. The output of the sensor is fed to one of the ADC channels of the PIC12F1822 microcontroller for A/D conversion. The internal fixed voltage reference (FVR) module is configured to generate a stable 2.048 V reference voltage for A/D conversion. The use of FVR module ensures the accuracy of the A/D conversion even when the supply voltage is not stable. The PIC12F1822 microcontroller then serially transmits the 10-bit ADC output to a PC.

Modern PCs are no more equipped with serial ports and therefore this project requires a USB-UART adapter that enables very easy connection of the PIC12F1822 to the PC via the USB port. You can get them really cheap on ebay. I bought one for $3.39 (see the picture below) from here: http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=370532286388
It can be directly interfaced to the TTL input and output of EUSART module of PIC12F1822. This module also provides +5 V, +3.3 V, and ground terminals. The power supply for the microcontroller circuit is derived from the same +5 V and ground pins.

On PC’s side, the open source programming language Processing is used to receive the ADC output and convert it into the actual temperature. The temperature is displayed on a graphics window on the computer screen in numeric format as well as with a wall tube thermometer looking image where the level of alcohol rises with increasing temperature. A clickable Start/Stop button also appears on the window to enable or disable the data logging.

Circuit diagram

The circuit diagram of this project is pretty simple. The microcontroller reads the temperature sensor’s output through RA2/AN2 pin and convert it to a 10-bit digital number. The Tx (RA0) and Rx (RA1) port of the EUSART module are connected to the corresponding pins of the USB-UART module. The microcontroller runs at 4.0 MHz using an internal clock source. Although I have disabled the MCLR function here, you can use it for an external reset if you want.

 

For more detail: Low cost temperature data logger using PIC and Processing using PIC12F1822

The post Low cost temperature data logger using PIC and Processing using PIC12F1822 appeared first on PIC Microcontroller.

Revised version of LM35 based digital temperature meter using PIC16F688

$
0
0

This is a revised version of my LM35 based digital thermometer project that I posted last year. Although it is one of the simplest projects, it is very popular among newbies who are just starting to learn microcontrollers. There was a little flaw in the original project as pointed by some readers. I was using a 1.2 V reference for A/D conversion with PIC16F688 microcontroller. However, the PIC16F688 datasheet says Vref should be equal to or higher than 2.2 V to ensure 1 LSB accuracy of A/D conversion. Here, I am rewriting the same project but this time I am using a MCP1525 IC to generate a precise 2.5 V reference for A/D conversion. This will improve the accuracy of temperature measurements.

digital temperature meter

Theory

The LM35 series of analog temperature sensors are produced by National Semiconductor Corporation and are rated to operate over a -55 °C to 150 °C temperature range. These sensors do not require any external calibration. The output voltage is proportional to the temperature, and the temperature-to-voltage conversion factor is 10 mV per °C. The sensor does not have any DC offset output voltage (which means the output is 0V at 0 °C temperature) and therefore, a negative voltage source is required in order to measure temperatures below 0 °C. For simplicity, the setup shown here is made to measure temperatures above 0 °C only. The PIC16F688 microcontroller reads the analog output voltage from the sensor through one of its ADC channel and derives the temperature information out of it.

For the maximum temperature value of 150 °C, the output voltage of the sensor would be 150 x 10 mV = 1. 5 V. If we use Vref = 5.0 V (power supply voltage) for A/D conversion, the resolution would be poor as the input signal goes only up to 1.5 V. Besides, if the supply voltage is not stable, it won’t be a good idea to use it as  Vref for A/D conversion. Using a lower and more stable Vref voltage can improve both the resolution and the accuracy of A/D measurements. However, the datasheet of PIC16F688 microcontroller recommends to use reference voltage above 2.2 V to ensure 1 LSB accuracy of A/D conversion. The MCP1525 IC from Microchip provides a precise output voltage of 2.5 V, which could serve this purpose. This device is also available in TO-92 package, and therefore, it can be wired on a breadboard too.

Circuit diagram

The revised circuit diagram of the project is shown below. All the connections remain the same, except the two diodes and a resistor in the original circuit are replaced by a MCP1525 device.

The whole setup of this project is shown below. For illustrative purpose, I am using the LCD display from my I/O board project here. Don’t get confused with all the LEDs and tact switches on the board, they should be disregarded. I am only using the LCD part of it.

 

For more detail: Revised version of LM35 based digital temperature meter using PIC16F688

Current Project / Post can also be found using:

  • skin temperature measurement using pic controller

The post Revised version of LM35 based digital temperature meter using PIC16F688 appeared first on PIC Microcontroller.

Humidity and temperature measurements with Sensirion’s SHT1x/SHT7x sensors using PIC18F2550 (Part 1)

$
0
0

Temperature and relative humidity are two very important ambient parameters that are directly related to human comfort. Sometimes, you may be able to bear higher temperatures, if there is a lower relative humidity, such as in hot and dry desert-like environment. However, being in a humid place with not very high temperature may make you feel like melting. This is because if there is high relative humidity, sweat from our body will evaporate less into the air and we feel much hotter than the actual temperature. Humidifiers and dehumidifiers help to keep indoor humidity at a comfortable level. Today we will discuss about Sensirion’s SHT series of digital sensors, more specifically SHT11 and SHT75, which are capable of measuring both temperature and relative humidity and provide fully calibrated digital outputs. We will interface both the sensors to PIC18F2550 microcontroller and compare the two sets of  measurements to see the consistency between the two sensors. This tutorial is divided into two parts. The first part will cover all the details regarding the sensors, including their specification, interface, and communication protocol. The second part will be more focussed on the circuit diagram, implementation of the communication protocol with PICMicro, and the results.

Sensirion’s SHT1x

Theory

Sensirion offers multiple SHT series of digital sensors for measuring both relative humidity and temperature. The temperature is measured using a band-gap sensor, whereas the humidity sensor is capacitive; which means the presence of moisture in air changes the dielectric constant of the material in between the two plates of a parallel-plate capacitor, and hence varies the capacitance. The required signal conditioning, analog-to-digital conversion, and digital interface circuitries are all integrated onto the sensor chip. The various SHT series sensors have different levels of accuracy for humidity and temperature measurements, as described below.

SHT1x, 2x, and 7x series of humidity sensors (Source: http://www.sensirion.com)

SHT1x are available in surface mount type whereas SHT7x are supplied with four pins which allows easy connection. The SHT11 and SHT75 sensors both provide fully calibrated digital outputs that can be read through a two-wire (SDA for data and SCK for clock) serial interface which looks like I2C but actually it is not compatible with I2C. An external pull-up resistor is required to pull the signal high on the SDA line. However, the SCK line could be driven without any pull-up resistor. The signaling detail of the serial bus is described in the datasheet, which we will implement for PIC18F2550 microcontroller using mikroC pro for PIC compiler. The operating range of both the sensors is 0 to 100% for relative humidity, and -40.0 to 123.8 °C for temperature. The sensor consumes 3 mW power during measurement, and 5 μW, while in sleep mode.

The SHT11 module that I have got is from mikroElektronika. The sensor (SMD) is soldered on a tiny proto board with all the four pins accessible through a standard 0.1 inch spacing male header. The board comes with pull-up resistors connected to both SDA and SCK lines. One concern in this type of arrangement is the heat dissipated by the pull-up resistors could affect the measurements if the resistors and the sensor are close in the board. We will discuss about this issue later too. The SHT75 module from Sensirion, however, does not include any pull-up resistor for SDA line and therefore must be included externally.

 

For more detial: Humidity and temperature measurements with Sensirion’s SHT1x/SHT7x sensors using PIC18F2550 (Part 1)

Current Project / Post can also be found using:

  • transducer projects with micro controller
  • transducers based projects

The post Humidity and temperature measurements with Sensirion’s SHT1x/SHT7x sensors using PIC18F2550 (Part 1) appeared first on PIC Microcontroller.

Enhanced 5/2-day Central Heating Programmer with serial computer interface using PIC16F628A

$
0
0

Overview

This project has come about from my desire to control my home heating from work.  As I have a VPN between work and home a straightforward relay controlled from a PC would seem the easiest solution.  However I also wanted a control unit that I could operate in the house without resorting to the computer.  For example, I get up late and the heating is off, I just want to hit a button and turn it on.  In fact the programmer shown on this page is now next to my bed so I can turn the heating on before I  get up late, and also switch it off if I turn in early, which helps save on the fuel bills J

Features

  • Independent control for heating and hot water.

  • 10 flexible program entries.

  • Programs can be set to operate Mon-Fri / Sat-Sun / Mon-Sun.

  • Manual advance for water and heating

  • Water and heating can be independently set to manual or programmed control.

  • Operation and setup from front panel or remote serial CLI

  • Battery backup for Real Time Clock (RTC), program settings and manual control.

  • Programmer can be located remotely from boiler using low voltage signals over CAT5 or 6-core alarm cable.

  • RS232 serial interface with command line interface allows full control and setting from any computer.

  • Front panel control can be locked-out from serial CLI

  • Based on Microchip PIC 16F628A microcontroller

This programmer has been designed for use with a domestic heating boiler.  It provides outputs via two relays to control the supply of Hot Water and Heating.  There are 10 program entries available and each one can control the heating and water independently. The programmer allows manual advance of the heating and water and  disabling of program control, useful if you’re going away for a few days and want to leave the heating and water off. As well as providing normal front panel switch control of the heating and water, the programmer also features a serial terminal interface that allows it to be operated remotely from a PC running a Terminal Emulator.

Central Heating Programmer

The program entries can be set to switch weekdays only, weekends only or everyday but not individual days.  I believe a programmer that can switch weekdays or weekends is a 5/2-day programmer so I would call mine a 5/2/7 day programmer since it can do the whole week as well.  However, a 7-day programmer is one that can do individual days so I’ve settled on calling mine an Enhanced 5/2-day programmer.

The programmer and boiler control relays are contained in separate units so that the relays can be located close to the boiler while the programmer itself can be located anywhere in the house using low voltage connections back to the relay unit.  The connection between the programmer and relay unit requires six wires for power, serial data and relay controls making it possible to use 6-core alarm cable or, as I have done, operate it over the CAT5 UTP cabling installed throughout my house.  Of course it’s quite simple to build it as a single unit if that suits the application.  There is also no reason why you can’t make the serial interface connection local to the programmer in which case you only need 4 wires for power and relay controls.

If you don’t require the remote computer CLI the programmer is fully functional using just the front panel and likewise, if the front panel isn’t required, it can be fully controlled from the serial interface and the LCD and switches omitted from the hardware.


Software

The latest version of the programmer ready .HEX file is provided here.

Firmware Version 2.0.2 28 May 2005
Please read conditions of use and disclaimer before downloading

Developed using MPLAB V7.10 and Oshonsoft PIC Simulator IDE. Assembled with MPASM v04.00

The software is fully functional and the system as described on this web page is currently working with my domestic heating system.  I’ve been using prototypes since March 2005.  The latest code, Version 2.0.2, has been running since 28 May 2005.  As of 17 January 2011 it’s still working and has proved to be 100% reliable.

This is the final version of the code. I’m not going to develop it any further since the programmer now implements all the features I want and works as I intended.  I will do maintenance code releases to fix any software related bugs / issues reported to me.

Known issues

  • no known critical issues.

  • Some CLI commands allow superfluous text on the line after the command. The command executes correctly and any superfluous text is ignored.

  • Please send any bug reports to

    Contact us:

Functionality as designed

  • The current relay output and manual mode settings are stored in NVRAM. In the event of a power failure these are restored when the power resumes. If a programmed setting should have applied at a time during the power outage, it will not get applied when the power is restored. The saved settings that were active at the time of the power failure will be reapplied. 

  • When in front panel setup mode, no programmed outputs will be activated. If a programmed setting should have applied while the programmer was in setup mode, it will not get applied on exit. 

  • On power up the programmer sends a VT100 [ESC] c command to the terminal to reset it. This may cause extraneous characters to be displayed or other issues on a non VT100 emulator.  

  • Time is displayed / entered in 24 hour format only. 

  • Serial interface operates at 9600bps, 8 bits, 1 stop, No parity.  Baud rate is not configurable

  • When in front panel setup mode the serial CLI is disabled.

Code Revisions

V2.0.3

  • As version 2.0.2 code but without the CLI diagnostic commands. These commands where implemented from an include file which has simply been omitted during assembly for V2.0.3. 

V2.0.2

  • Enabled the PIC Watch Dog Time (WDT) and added supporting code.

  • New command ‘dw’ shows number of Watch Dog timeouts that have occurred since power-up. These should not occur if the programmer is functioning correctly, if they do this alerts you to a potential problem.

  • Implemented front panel setup functions. Allows time to be set. Program entries to be viewed, cleared, entered and edited.

  • Changed handling of serial CLI input buffer overflow. The behavior is now consistent with handling of unknown commands. 

  • The CLI ‘p’ command now shows output control for Hot Water followed by Central Heating. This is the opposite way round to firmware before V2.0.0 

V1.9.1

  • Added CLI command to enable / disable front panel control. This has been added to allow the front panel to be locked out when using automated control of the unit from the CLI.  It also provides a way to stop my girlfriend from turning the heating on all the time:-)

  • CLI relay control command letter has been changed from ‘t’ to ‘u’. 

  • The relay control and manual mode CLI commands worked by inverting the current setting.  This has now changed so that the setting for on/off or manual/programmed is explicitly specified on the command line. 

  • Moved the on/off text for heating and water on the LCD to the extreme ends of the display. This is to allow the display of the text ‘Locked’ when the front panel is disabled.

V1.9

  • Prior to FW V1.9 the LCD display had the text CH- and -HW on the second line but as the programmer is now cased and the front panel artwork has legends on it, this text has been removed from the V1.9 code.

  • The manual mode status was indicated with the characters ‘m’ and ‘p’. This has now been replaced by the text ‘Man’ and ‘Prg’

  • Added CLI function to send a VT100 [ESC] c command to the terminal to reset it. 

  • Send VT100 [ESC] c command to the terminal at power-up.

  • Added command to return an ASCII hex byte with the current status of the relay outputs and manual mode settings. For use with automated control of the CLI.

  • Improved the CLI ‘p’ command entry format and parsing.

  • Made program control for CH and HW outputs fully independent by adding a no-change flag and enabling this feature within all related functions.


Hardware

The hardware for the programmer comprises two units.  The first contains the two relays that switch the mains power to control the boiler.  This also has an RJ45 socket to allow connection into a CAT5 cabling system that takes power, serial data and relay control input signals to the second unit, an intelligent programmer.  There is also a 2.1mm DC power socket that is used to connect an external 9~12V DC power adapter. This supplies power to the relay board and the programmer controller. A 9-pin ‘D’ socket provides connectivity to a PC serial interface.

For more detail: Enhanced 5/2-day  Central Heating Programmer with serial computer interface using PIC16F628A

Current Project / Post can also be found using:

  • project on temperature measurement
  • Basic home automation coding using pic16f877a
  • home automation pic microcontroller code
  • Temperature measure project

The post Enhanced 5/2-day Central Heating Programmer with serial computer interface using PIC16F628A appeared first on PIC Microcontroller.

Homemade temperature LED display for PC using PIC16F876

$
0
0

Since I started my watercooling prejoect, I have been verry interested in how well it perform,
the only way is to measure all temperatures before and after,
The motherboard temperature sensors is useless unacurate, so I’m using LM50B

temperature LED display
By using this LM50B sensor I get 1 C of real accuracy
I use a PIC16F876 to drive a four two digits LED displays, the PIC16 has 4 analog inputs with 10 bits resolution,
now I can display 4 temperatures at the same time to monitor performance 🙂
I monitor CPU, Chipset, GFX card, Harddisks.

Here is the schematic good old handdrawn original..
Here is the schematic Re-Drawn Maybe you like this better 🙂 OK, comments for the circuit:
You can use any number of LED displays: 2, 4, 6, or all 8, depending on how many temperatures you want to display,
LED display type must me common cathode, FET can be any N-FET type you have, I have used IRF530 I had on stock,
NPN transistors can also be used if you dont have fets, then remember to mount a 1k resistor on each base inpus.
Each sensor input connector is protected using a 1k resistor, so you can connect sensors with power on,
nothing will burn if you connect it wrong.
Only calibration requred is the refference voltage, it need to be exactly 2.5600 volt, I have used a super stable regulator,
but an LM317 can also be used to make 2.56 volt with if that is what you have. DOWNLOAD The HEX file for the PIC16F876.
The 5 volt supply is taken from a free harddrive power connector, no need to regulate it, 4.8 to 5.2 will work fine.
This complete circuit with 8 all digits consume about 100mA. Good Luck.

 

For more detail: Homemade temperature LED display for PC using PIC16F876

Current Project / Post can also be found using:

  • introduction to temperature indication system using pic uc for project report
  • microcontroller based temperature measurement and relay control with pc interface project
  • temperature measurement using pic microcontroller

The post Homemade temperature LED display for PC using PIC16F876 appeared first on PIC Microcontroller.


DS1820 Temperature regulator using PIC16F628

$
0
0

This simple project uses a Dallas DS1820 one wire temperature sensor and a pic 16f628 microprocessor. A simple temperature regulator where a LED symbolizes the Fan.

Temperature regulator

Data derived from the DS18s20 is a 9bit centigrade temperature measurement. As mentioned the temperature sensor communicates over a one Wire bus that requires only one data line and ground for communication with a central microprocessor.

The DS18S20 can use power directly from the data line (parasite power) wich eliminates the need for an external power supply. This is not used in this project though.

For more detail: DS1820 Temperature regulator using PIC16F628

Current Project / Post can also be found using:

  • boiled water temperature measurement system using PIC microcontroller

The post DS1820 Temperature regulator using PIC16F628 appeared first on PIC Microcontroller.

Roll and Temperature sensor applications using PIC18F2550

$
0
0

This page will show you how to use the TD-CMP modules in a way which fits you most.

 

Here are the technical specifications of the modules:

  • Compass: Resolution: 1° – Accuracy: 3°
  • Tilt/Roll: (TD-CMP02 and TD-CMP03 only) Resolution: 2° – Accuracy: 5°
  • Temperature: (TD-CMP03 only) Resolution= 1°C/F – Accuracy =1°
  • New: Sampling rate: 12,5 to 25 samples/second.
  • Easy Tilt/Roll calibration.(TD-CMP02 and TD-CMP03 only)
  • Interfaces: I²C, RS232 and mini-USB (as a HID device: PID=0461, VID= 1023)
  • Powered by USB bus or an external 5V.
  • Direct LCD readout possible. LCD contrast by user.
  • Low power LED lights when facing North (angle within 11,25° both left and right from North.)
  • USB Windows application (written in C#) available for free download.) Compatible with WinXp/Vista.
  • Source code (CCS C and C# .NET) and schematics (Eagle) can be purchased separately.
  • Module software is 100% upgradable with a simple bootloader.
  • PCB Dimensions: 40 x 41 mm or 1″57 x 1″61, weight: 10 grams.

Temperature sensor

These assembled modules are available from our online shop.

You may also purchase the bare pcb, a KIT DIY* version and the source code. KIT step-by-step construction guide.

New: compass calibration.

Schematics and pcb diagrams available for download. Last update: November 26, 2009.

DIY* = Do It Yourself

Power Source: JP4: Connect pin 2 to pin 3 to power the module directly from USB. Connect pin 1 to pin 2 when powered externally via JP3, pin 1.

New: Increase sampling speed from 12,5/second to 25/second: connect SPEED1 to SPEED2 (JP3, pin4 to JP3, pin2.)

LCD contrast Adjust: Connect pin 5, JP3 to +5V before powering up. Release when the desired the contrast is reached.

 

Tilt/Roll Calibration: (TD-CMP02 and TD-CMP03 only):

  • First place the module on a completely flat surface, power up.
  • Then shortly apply +5V (pin 1, JP2) to ADJUST (pin 5, JP3) Release after 1 second.
  • Check readings when applying tilt/roll to the module. Repeat the calibration procedure if necessary. Done.

 

Compass Calibration: (do not touch the PCB or chips whilst calibrating.)

  • First place the module on a completely flat surface, power up, head to North (position as shown in diagram and picture above), then turn the module slowly 360° (make 2-3 full clockwise and/or counter-clockwise spins.)
  • Now apply +5V (pin 1, JP2) to ADJUST (pin 5, JP3) Wait for 8-10 seconds; the LED will flash 3 times. Release the ADJUST pin from +5V. Power off and on.
  • Check compass readings when heading the module to N, S, E, W. Repeat the calibration procedure if necessary. Done.

 

Module RESET: apply GND to MCLR pin.

 

Temperature sensor: (TD-CMP03 only): The external LM335Z sensor connects to JP3 pin 4 and 6. No temperature will be displayed when the sensor is removed.

 


RS232 interface:

JP2 provides the interface to connect to your COM port and hyper terminal. Communications @ 115200 bpS, 8N1.

Use a level converter like the MAX3232 between the TD-CMP module and the pc serial port. See this example.

Also used for bootloading (module software update.) Check under the download section below for the latest version. Bootloading of the HEX-file can be done with Tiny Bootloader 1.91

 

For more detail: Roll and Temperature sensor applications using PIC18F2550

Current Project / Post can also be found using:

  • PİC C İle Sıcaklık Projeleri pdf
  • PIC16F877A based Temperature sensor measurement(pdf)

The post Roll and Temperature sensor applications using PIC18F2550 appeared first on PIC Microcontroller.

Humidity and temperature measurements with Sensirion’s SHT1x/SHT7x sensors using PIC18F2550 (Part 2)

$
0
0

In Part 1 of this tutorial, we discussed about Sensirion’s SHT1x and SHT7x series of humidity sensors, their interface specifications, the communication protocol used for transferring data in and out of the sensor, and the equations to convert their digital outputs to actual physical quantities. These sensors are capable of measuring temperature along with relative humidity and provide outputs in fully-calibrated digital words. We will now see how a PIC microcontroller can be programmed to communicate with these sensors, read the temperature and relative humidity data, and display the information on a character LCD.

SHT setup

Circuit Diagram

We will be interfacing the SHT11 and SHT75 sensors simultaneously to different port pins of PIC18F2550 and display the measured values of relative humidity and temperature from both on a 16×2 character LCD. The two sensors are placed next to each other and are supposed to measure the same values for relative humidity and temperature. The circuit diagram below shows the connection of the two sensors and a 16×2 character LCD to StartUSB for PIC board. StartUSB for PIC is a small development board for PIC18F2550 from mikroElektronika. The microcontroller comes preprogrammed with a bootloader, and therefore, no external programmer is required.

The LCD is operating in 4-bit mode, where the data pins D4-D7 are driven by RB4-RB7 pins of PIC18F2550. The RS and E pins are connected to RC6 and RC7 respectively. The clock lines of SHT11 and SHT75 are driven separately by RB1 and RB3 pins of PIC18F2550, respectively. On the other hand, the RB0 and RB2 pins are connected to the data pins (SDA or DATA) of SHT11 and SHT75, respectively. A decoupling capacitor (100 nF) is connected between Vcc and Gnd pins of each sensor. The PIC18F2550 microcontroller on-board StartUSB for PIC board runs at 48 MHz using the internal PLL along with an external 8.0 MHz crystal. A pull-up resistor of 10 K is required for each DATA line (in fact, the SHT11 board from mikroElektronika has pull-up resistors of 1 K on both DATA and SCK lines, but the manufacturer’s datasheet recommends 10 K).

Software

The sensor’s serial communication protocol was described in Part 1. We will implement it for PIC18F2550 using mikroC Pro for PIC. MikroElektronika provides a sample code written in mikroC for reading temperature and relative humidity from a SHT11 sensor. This code was later modified by Uroš Pešović (from Serbia) in order to account for the new conversion coefficients released by Sensirion for its version 4 sensors. I am adapting the same code for dual sensor case with some modifications that are required for our specific case.

The following subroutine is to reset the interface, in case the communication to the sensor is lost. In our case this routine will be always called before sending a new measurement command to the sensor. In order to pull the DATA line high, all you need is to define the direction of PIC port pin driving the DATA line as input. The pull-up resistor will then pull the line high. However, the same port pin direction must be defined as output and set to logic ’0′ to pull the line low.

void SHT_Reset() {
 SCL = 0;                     // SCL low
 SDA_Direction = 1;           // Define SDA as input to pull the DATA line high
 for (i = 1; i <= 10; i++)    // repeat 18 times
 SCL = ~SCL;                  // invert SCL
 }

Once the connection is reset, you need to send a Start Transmission sequence. The subroutine for this would be something like this.

 

For more detail: Humidity and temperature measurements with Sensirion’s SHT1x/SHT7x sensors using PIC18F2550 (Part 2)

Current Project / Post can also be found using:

  • color sensor pıc project
  • interfacing ds18b20 temperature sensor to pic16f887 pdf
  • practical project includes microcontroller and transducer

The post Humidity and temperature measurements with Sensirion’s SHT1x/SHT7x sensors using PIC18F2550 (Part 2) appeared first on PIC Microcontroller.

Single Chip Temperature Data Logger

$
0
0

Introduction

A data logger is a device that records measurements over time. The measurements could be any physical variable like temperature, pressure, voltage, humidity, etc. This project describes how to build a mini logger that records surrounding temperature values. It has following features:

– Uses just one 8?pin chip, so very compact size circuit.
– Temperature range: 0 to +125°C.
– Can store up to 254 measurements.
– Sampling interval options: 1 sec, 1 min, 10 min
– Reset feature to clear all previous measurements.
– Serial transfer of recorded measurements to a PC
– Three tactile switches for user inputs and a LED indicator.

Single Chip Temperature Data Logger Description

The beauty of this project is that it uses just a single chip for logging. It is PIC12F683, an 8?pin microcontroller from Microchip. PIC12F683 has six general purpose I/O (GP0?GP5, GP3 is input only) pins, and 2K x 14 Flash program memory
with 256 bytes of internal EEPROM.

Temperature will be measured with a DS1820 temperature sensor. DS1820 is a one wire digital temperature sensor from Dallas Semiconductor (now MAXIM). The operating temperature range of the device is -55°C to +125°C with an accuracy of ±0.5°C over the range of -10°C to +85°C. The temperature sensor output is 9?bit Celsius temperature measurement, and so the temperature resolution corresponds to the least significant bit, and which is 0.5°C. But in this project we will use only the most significant eight bits. Therefore, the temperature resolution will be 1°C. The measured temperatures will be recorded into the internal EEPROM memory of PIC12F683.

The first location of the internal EEPROM will store the sampling interval of data logger. Sampling interval defines the time gap between two successive measurements. This project will have 3 options for sampling time: 1 sec, 1 min, and 10 min. These are user selectable. The second location of EEPROM will store the number of measurements recorded so far. And the remaining 254 EEPROM locations will store 8?bit temperatures. So, using 10 min sampling interval, 254 bytes of EEPROM will provide data logging for 42 hours. The recorded measurements can be sent to PC at any time through a serial link at 9600 baud.

User Inputs

There will be three tact switches for user inputs, namely Start, Stop, and Send/Reset. The three switches will be able to accept the following 4 user requests.

1. Start: When ‘Start’ button is pressed, data logging starts.
2. Stop: Once the ‘Stop’ button is pressed, data recording will stop.
3. Send: Transfer data to PC through serial port.
4. Reset: Holding the ‘Send’ button for 2 sec or more clears the internal EEPROM memory.

Single Chip Temperature Data Logger SchematicSampling Time Selection

 

The sampling interval can be selected as 1 sec, 1min, or 10 min using the same three switches. Suppose if we need 1 min sampling time, first turn OFF the power, then hold the ‘Stop’ button, turn the power ON, and wait till the LED glows. Once the LED glows, release the button, and the sampling interval will be set to 1 min. The new set sampling time will be updated to EEPROM location 0 so that in case of power failure, the previous sampling time will be restored. Similarly, use ‘Start’ and ‘Send’ buttons for 1 sec, and 10 min sampling intervals respectively.

LED Indicator

Every time the user presses input buttons, LED glows for a moment to indicate that the input is accepted. It also blinks thrice every time EEPROM Write operation takes place. It also blinks at the beginning when the power is turned ‘ON’. It also glows when the EEPROM memory is full.

For more detail: Single Chip Temperature Data Logger 

The post Single Chip Temperature Data Logger appeared first on PIC Microcontroller.

PIC Projects: Digital Temperature Controller

$
0
0

Digital temperature controller is an essential instrument in the field of electronics, instrumentation and control automation for measuring and controlling temperatures. It can be used as much at homes as in industrial applications. Different types of analogue and digital temperature controllers are readily available in the market, but they are generally not only expensive, their temperature range is also usually not very high. Presented here is a low-cost microcontroller-based temperature controller that can read and control temperatures in the range of zero to 1000ºC. Real-time temperature is displayed on its LCD screen, and you can use it to control the temperature within the preset minimum and maximum range.

PIC Projects Digital Temperature Controller

Fig. 1: LCD display for the temperature controller

Circuit and working
Fig. 2 shows circuit diagram of the digital temperature controller. The circuit is built around microcontroller PIC16F877A (IC1), precision thermocouple amplifier AD8495 (IC2), K-type thermocouple (connected at CON3), 16×2 LCD (LCD1), single-changeover relay (RL1) and a few common components.

Sensor selection. There are basically two types of temperature-measurement systems—direct temperature-measurement systems for up to 1000ºC and indirect temperature-measurement systems for higher temperature range, where temperature sensors may get physically damaged due to the high temperatures. The selection of temperature sensor is dependent on the range of temperature you wish to check. There are different types of direct-measurement sensors, for different ranges of temperature (refer Table I).Table PIC Projects Digital Temperature Controller

Thermocouple. Here we have used a K-type thermocouple for direct measurements of up to 1000ºC temperature. In K-type thermocouple, the two materials used to form the junction are Chromel (Ni-Cr) and Alumel (Ni-Al). K-type is a low-cost and one of the most popular general-purpose thermocouples. Its operating range is around -250 to +1350ºC, with sensitivity of 42µV/ºC approximately.

For more detail: PIC Projects: Digital Temperature Controller

The post PIC Projects: Digital Temperature Controller appeared first on PIC Microcontroller.

PIC16F877A-Based Temperature Monitoring System

$
0
0

Temperature monitoring and control is important in industry environments. Sensors are widely used for measurement of temperature. Usually, a temperature sensor converts the temperature into an equivalent voltage output. IC LM35 is such a sensor. Here we describe a simple temperature measurement and display system based on LM35 sensor and PIC16F877A microcontroller. The temperature in degrees Celsius is displayed on a 16×2 LCD.PIC16F877A-Based Temperature Monitoring System

Fig.1 shows the functional block diagram of the PIC16F877A-based temperature monitoring system. The key features of this system are:

1. Continuous monitoring of temperature with 1-second update interval (which can be varied in the program).

2. Temperature measurement using LM35 precision integrated-circuit sensor.

3. Precise analogue-to-digital conversion using in-built 10-bit analogue- to-digital converter (ADC) of PIC16F877A microcontroller.

Hardware description

Fig.2.shows the circuit of the temperature monitoring system. The circuit mainly consists of the LM35 temperature sensor, PIC16F877A microcontroller and HD44780 controller based 16×2 LCD.

Schematic PIC16F877A-Based Temperature Monitoring System

Fig.2: Circuit of PIC16F877A-based temperature monitoring system

The output of the sensor is fed to the internal ADC of the microcontroller. Pin 2 of the microcontroller (RA0/AN0) is channel-1 of the internal ADC. The analogue voltage output of the sensor is converted into its equivalent digital value by the ADC and then its equivalent degree Celsius value is calculated by the software. The calculated temperature value is displayed on the LCD.

LM35 sensor. Fig.3 shows the pin configuration of LM35. It is a precision integrated-circuit centigrade temperature sensor whose output voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus has an advantage over linear temperature sensors calibrated in degree Kelvin, as the user is not required to subtract a large constant voltage from its output to obtain convenient Centigrade scaling. For each degree Celsius change in temperature, the sensor output changes by 10 mV.

For more detail: PIC16F877A-Based Temperature Monitoring System

The post PIC16F877A-Based Temperature Monitoring System appeared first on PIC Microcontroller.

Temperature and relative humidity display with adaptive brightness control

$
0
0

The objective of this project is to illustrate a technique of implementing adaptive brightness control to seven segment LED displays. It consists of a closed loop system that continuously assesses ambient light condition using an inexpensive light-dependent resistor (LDR) and uses that information to adjust the brightness of the display. For the proof of concept, the technique is applied to construct a digital temperature and relative humidity meter that adapts the brightness of the seven segment LED displays to the surrounding lighting conditions. There are 8 seven segment LED displays used in this project and they are all driven by one MAX7219 chip. The ambient temperature and relative humidity are measured using the DHT11 sensor. The microcontroller used in this project is PIC12F683, which is a low-pin-count (8) device from 8-bit PIC microcontroller family. Auto-adjusting the brightness of the seven-segment LED display with surrounding illumination enhances the readability in all ambient lighting conditions.

Temperature and relative humidity display with adaptive brightness control

Temperature and humidity display with auto-brightness control

Theory and circuit setup

Many smartphones, HDTVs, PDAs, tablets, and computer screens now come with an automatic brightness control that aims to conserve power as well as to make the display easier to see in a broad range of illumination conditions. This feature basically dims the display screen in a dark environment and brightens it when the ambient light level is higher. The brighter screen helps to counteract the effects of glare from ambient light and also takes into account for the decreased sensitivity of human eyes to brightness as the ambient light level increases.

An automatic brightness adjustment is basically a closed loop system that has the capability to assess ambient light and adjust the brightness of the display accordingly. In our project, a general purpose LDR and a fixed value resistor (10K) are connected in series between the power supply and ground pins to create a voltage dividing network, as shown in the circuit diagram below. The resistance of a typical LDR is less than 1 K? under bright lighting condition. Its resistance could go up to several hundred K? under extremely dark condition. Therefore, the voltage across the 10K resistor increases proportionally with the surrounding illumination. For the given setup, the voltage across the 10K resistor can vary from 0.1V (under dark condition) to over 4.0V (under very bright illumination). The PIC12F683 microcontroller reads this analog voltage through its AN3 (GP4) ADC channel and then sends out appropriate signals to the MAX7219 display driver to adjust the brightness of the seven segment LED displays.

Schematic Temperature and relative humidity display with adaptive brightness control

Circuit diagram

The MAX7219 chip provides a serial interface to drive 7-segment LED displays (common-cathode type) up to 8 digits and requires only 3 I/O pins from microcontroller. Included on the chip are a BCD decoder, multiplex scan circuitry, segment and digit drivers, and an 8×8 static RAM to store the digit values. The segment current for all LEDs is set through only one external resistor connected between the ISET pin and power supply. However, the device also provides a digital control of the display brightness (16 steps from minimum to maximum) through an internal pulse-width modulator. To learn more about the MAX7219 device, read my previous article Serial 4-digit seven-segment LED display. In this project, the GP0, GP1, and GP2 I/O pins of PIC12F683 are used to drive LOAD, DIN, and CLK signal lines of the MAX7219.

For more detail: Temperature and relative humidity display with adaptive brightness control

The post Temperature and relative humidity display with adaptive brightness control appeared first on PIC Microcontroller.


Revised version of LM35 based digital temperature meter

$
0
0

This is a revised version of my LM35 based digital thermometer project that I posted last year. Although it is one of the simplest projects, it is very popular among newbies who are just starting to learn microcontrollers. There was a little flaw in the original project as pointed by some readers. I was using a 1.2 V reference for A/D conversion with PIC16F688 microcontroller. However, the PIC16F688 datasheet says Vref should be equal to or higher than 2.2 V to ensure 1 LSB accuracy of A/D conversion. Here, I am rewriting the same project but this time I am using a MCP1525 IC to generate a precise 2.5 V reference for A/D conversion. This will improve the accuracy of temperature measurements.

Revised version of LM35 based digital temperature meter

Interfacing LM35 temperature sensor with a PIC microcontroller

Theory

The LM35 series of analog temperature sensors are produced by National Semiconductor Corporation and are rated to operate over a -55 °C to 150 °C temperature range. These sensors do not require any external calibration. The output voltage is proportional to the temperature, and the temperature-to-voltage conversion factor is 10 mV per °C. The sensor does not have any DC offset output voltage (which means the output is 0V at 0 °C temperature) and therefore, a negative voltage source is required in order to measure temperatures below 0 °C. For simplicity, the setup shown here is made to measure temperatures above 0 °C only. The PIC16F688 microcontroller reads the analog output voltage from the sensor through one of its ADC channel and derives the temperature information out of it.

For the maximum temperature value of 150 °C, the output voltage of the sensor would be 150 x 10 mV = 1. 5 V. If we use Vref = 5.0 V (power supply voltage) for A/D conversion, the resolution would be poor as the input signal goes only up to 1.5 V. Besides, if the supply voltage is not stable, it won’t be a good idea to use it as  Vref for A/D conversion. Using a lower and more stable Vref voltage can improve both the resolution and the accuracy of A/D measurements. However, the datasheet of PIC16F688 microcontroller recommends to use reference voltage above 2.2 V to ensure 1 LSB accuracy of A/D conversion. The MCP1525 IC from Microchip provides a precise output voltage of 2.5 V, which could serve this purpose. This device is also available in TO-92 package, and therefore, it can be wired on a breadboard too.

Circuit diagram

The revised circuit diagram of the project is shown below. All the connections remain the same, except the two diodes and a resistor in the original circuit are replaced by a MCP1525 device.

Schematic Revised version of LM35 based digital temperature meter

Revised circuit diagram (click the image to enlarge)

The whole setup of this project is shown below. For illustrative purpose, I am using the LCD display from my I/O board project here. Don’t get confused with all the LEDs and tact switches on the board, they should be disregarded. I am only using the LCD part of it.

For more detail: Revised version of LM35 based digital temperature meter

The post Revised version of LM35 based digital temperature meter appeared first on PIC Microcontroller.

Low cost temperature data logger using PIC and Processing

$
0
0

This project describes an easy and inexpensive way of adding a digital thermometer and data logging feature to a PC. It involves a PIC microcontroller that gets the surrounding temperature information from the Microchip MCP9701 sensor, and sends it to a PC through an USB-UART interface. The USB port of the PC is also used to power the device. The open-source Processing  programming platform is used to develop a PC application that displays the temperature in a graphics window on the computer screen. The PC application also records the temperature samples plus date and time stamps on an ASCII file.

Low cost temperature data logger using PIC and Processing

PC-based temperature data logger

Theory of operation

This project is based on Microchip’s PIC12F1822 microcontroller from the enhanced mid-range PIC family. It has got 8-pins in total and the power supply voltage range of 1.8V to 5.5V. The microcontroller has four 10-bit ADC channels and one Enhanced Universal Synchronous Asynchronous Receiver Transmitter (EUSART) module for serial communication. The temperature sensor used here is MCP9701A, which is a Low-Power Linear Active Thermistor IC from Microchip Technology. The range of temperature measurement is from -40°C to +125°C. The output voltage of the sensor is directly proportional to the measured temperature and is calibrated to a slope of 19.53mV/°C. It has a DC offset of 400mV, which corresponds to 0°C. The offset allows reading negative temperatures without the need for a negative supply. The output of the sensor is fed to one of the ADC channels of the PIC12F1822 microcontroller for A/D conversion. The internal fixed voltage reference (FVR) module is configured to generate a stable 2.048 V reference voltage for A/D conversion. The use of FVR module ensures the accuracy of the A/D conversion even when the supply voltage is not stable. The PIC12F1822 microcontroller then serially transmits the 10-bit ADC output to a PC.

Modern PCs are no more equipped with serial ports and therefore this project requires a USB-UART adapter that enables very easy connection of the PIC12F1822 to the PC via the USB port. You can get them really cheap on ebay. I bought one for $3.39 (see the picture below) from here: http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=370532286388
It can be directly interfaced to the TTL input and output of EUSART module of PIC12F1822. This module also provides +5 V, +3.3 V, and ground terminals. The power supply for the microcontroller circuit is derived from the same +5 V and ground pins.

On PC’s side, the open source programming language Processing is used to receive the ADC output and convert it into the actual temperature. The temperature is displayed on a graphics window on the computer screen in numeric format as well as with a wall tube thermometer looking image where the level of alcohol rises with increasing temperature. A clickable Start/Stop button also appears on the window to enable or disable the data logging.

Circuit diagram

The circuit diagram of this project is pretty simple. The microcontroller reads the temperature sensor’s output through RA2/AN2 pin and convert it to a 10-bit digital number. The Tx (RA0) and Rx (RA1) port of the EUSART module are connected to the corresponding pins of the USB-UART module. The microcontroller runs at 4.0 MHz using an internal clock source. Although I have disabled the MCLR function here, you can use it for an external reset if you want.Schematic Low cost temperature data logger using PIC and ProcessingFor more detail: Low cost temperature data logger using PIC and Processing

The post Low cost temperature data logger using PIC and Processing appeared first on PIC Microcontroller.

A Beginner’s data logger project using PIC12F683 microcontroller

$
0
0

It is a very simple data logger project based on PIC12F683 microcontroller. The microcontroller reads temperature values from a temperature sensor on a regular interval basis and stores them into its internal EEPROM memory. The recorded temperatures can be later transferred to a PC through serial interface. I originally published this project on electronics-lab.com last summer. I thought this could be a very good learning project for beginners, and so I am posting it here for Embedded Lab’s readers too.

A Beginner’s data logger project using PIC12F683 microcontroller

Finished temperature logger powered from a 9V battery

Theory

The sensor used in this project is DS18B20. It is a digital temperature sensor manufactured by Dallas Semiconductor (now MAXIM) that can measure temperature ranging from -55°C to +125°C with an accuracy of ±0.5°C over the range of -10°C to +85°C. The sensor provides the measured temperature (°C) output in user-configurable 9, 10, 11, or 12-bit data corresponding to the desired resolution of 0.5, 0.25, 0.125, and 0.0625 °C. The sensor communicates with a host microcontroller over a 1-wire bus. Readers are suggested to refer the datasheet on Maxim’s website for details on this sensor. Please keep in mind that there are three versions of this sensors, namely DS1820, DS18S20, and DS18B20, and they have some architectural differences. All of them have the same pin configuration and therefore the circuit diagram would be same for all three types. However, some modification in the software may be required while the microcontroller reads the temperature data from them.

PIC12F683 has 256 bytes of internal EEPROM. Each temperature reading is stored as a byte, which means only the eight most significant bits of DS18B20 output is recorded. Therefore, the temperature resolution is decreased down to 1 °C. This temperature logger can store up to 254 temperature values (254 bytes) in its internal EEPROM. The remaining two EEPROM locations are used to store the sampling time and number of samples information. Three tact switches are used to provide user inputs for controlling the operation of the data logger.

Circuit Diagram

The PIC microcontroller uses its internal clock source operated at 4.0 MHz. The DS18B20 sensor is interfaced to GP0 pin (7) of the microcontroller. An LED connected to the GP2 pin serves as the only display in the circuit to indicate various actions of the data logger. For example, it blinks every time a sample is recorded into EEPROM. The circuit is powered with +5 V derived from a 9V battery using an LM78L05 regulator IC. The LM78L05 circuit is a very common circuit and therefore, it is not shown here.

Schematic A Beginner’s data logger project using PIC12F683 microcontroller

Circuit diagram of data logger

The three tact switches provide the following functions.

  • Start: Starts data logging
  • Stop: Stops the logging procedure
  • Send/Reset: Transfers data to PC through serial port. However, if it is held pressed for 2 sec or more, the EEPROM locations are cleared and ready for new recordings.

Selection of sampling time

This data logger offers three options for sampling interval: 1 sec, 1min, and 10 min. The selection is made through the same three tact switches. Here is how it works. Suppose if 10 min sampling time is needed, then first turn OFF the power, hold the ‘Send/Reset’ button pressed, turn the power ON, and wait till the LED glows. Once the LED glows, release the button, and the sampling interval is set to 10 min. The new sampling time will be updated to EEPROM location 0 so that in case of power failure, the previous sampling time will be restored. Similarly, the use of ‘Start’ or ‘Stop’ button instead of the Send/Reset one sets the sampling time to  1 sec, or 1 min respectively. With 10 min sampling interval, this data logger can record temperature samples over 42 hours.

For more detail: A Beginner’s data logger project using PIC12F683 microcontroller

The post A Beginner’s data logger project using PIC12F683 microcontroller appeared first on PIC Microcontroller.

Temperature sensor using PIC16F877A microcontroller

$
0
0

OBJECTIVE:

Components:

There are many temperature sensors available in market. But LM35 temperature sensor is used in this project. It is cheapest in price and one can easily find it in market. There are many other advantages of LM35 like:

 Temperature sensor using PIC16F877A microcontroller
  • It is more efficient than thermistor
  • It is made up of integrated circuit hence no chance of damaging to internal circuitry.
  • It draws current only in micro Amperes.

Only 5 volt power supply is required for LM35 and there is no need of extra circuitry to operate it. PIC16F877A microcontroller is used to read temperature value. 16X2 LCD is used to display temperature value on LCD. Code of this project written in Mikro C compiler.

Implementation:

LM35 temperature sensor converts temperature into its proportional analog voltage value. LM35 is three terminal device.Pin number one and three are for 5-volt voltage supply. Pin two is analog voltage output with respect to temperature value.Relation between measured temperature and analog output voltage is:

1oC = 10m volt

Hence for every 1 degree increase in temperature there will be a increment of 10m volt in output voltage of LM35 sensor. PIC16F877A microcontroller is used to measure analog voltage value.  PIC16F877A  microcontroller built in ADC (analog to digital converter) is used to measure analog voltage.  PIC16F877A PORTA have seven built in ADC channels. So one can interface up to seven sensors with this microcontroller very easily.I will post a project on green house system.In green house system project I have used four ADC channels to measure temperature , light, humidity and moisture. Coming back to our digital thermometer, ADC has been used to read analog voltage. After reading ADC value, using voltage and temperature relationship voltage is converted back into temperature. A conversion factor is used to convert voltage back into temperature. All these conversion has been done through programming. LCD is connected to PORTB of  PIC16F877A microcontroller. I will discuss it in programming part. LCD is used to display temperature value.

Circuit diagram:

Proteus is used for simulation. Following is a circuit diagram of Digital temperature sensor:

Schematic Temperature sensor using PIC16F877A microcontroller

temperature sensor circuit diagram

As shown in above figure both temperature sensor and LCD is displaying same values of temperature. To ensure protection of LM35 and microcontroller you can connect 80k ohm resistor parallel to output of temperature sensor.

For more detail: Temperature sensor using PIC16F877A microcontroller

The post Temperature sensor using PIC16F877A microcontroller appeared first on PIC Microcontroller.

A DIY indoor thermometer plus hygrometer using PIC16F688

$
0
0

This project is about building a microcontroller-based digital room thermometer plus hygrometer that displays temperature and relative humidity on 4 large (1 inch) seven segment LED displays which adjust their brightness level according to the surrounding illumination. It consists of a closed loop system that continuously assesses ambient light condition using an inexpensive light-dependent resistor (LDR) and uses that information to adjust the brightness of the display. An inexpensive DHT11 sensor is used to measure temperature and relative humidity. The microcontroller used in this project is PIC16F688, and it runs at 4 MHz clock generated from its internal source. A separate display driver chip (MAX7219) is used to control and refresh the display data on the seven segment LEDs.

TRH Meter Prototype OP2

Why do we need adaptive brightness control?

Auto-adjusting the brightness of the seven segment LED displays not only saves power but also enhances the readability in all ambient lighting conditions.

Many smartphones, HDTVs, PDAs, tablets, and computer screens now come with this feature. It basically dims the display in a dark environment and is still readable and eye-soothing. Similarly, when the ambient light level goes up, it brightens the display to enhance the readability. This project displays indoor temperature and relative humidity on large 1 inch seven segment LEDs that automatically adjust the brightness to be in balance with the light condition in the room. So, if you put this meter in your bedroom, you won’t have to worry about turning it off during nighttime. It will automatically dim low enough to not to disturb your sleep, while maintaining the readability.

Circuit diagram 

To make it easy to explain, I have divided the complete circuit diagram into 3 parts: Power supply unit, Microcontroller and sensor unit, and Display driver unit.

The power supply unit consists of a LM7805 regulator IC to derive regulated +5V power supply from a 9-15V DC wall adapter. The complete power supply unit circuit diagram is shown below. LED1 is a power-on indicator LED.

The following circuit diagram shows connections of the DHT11 sensor and the photoresistor (also called light dependent resistor or LDR) to the PIC16F688 microcontroller. DHT11 is a low cost digital sensor for measuring temperature from 0-50 °C with an accuracy of ±2°C and relative humidity ranging from 20-95% with an accuracy of  ±5%. The sensor provides fully calibrated digital outputs and has got its own proprietary 1-wire protocol for communication. I have described more about this sensor and its communication protocol in Measurement of temperature and relative humidity using DHT11 sensor and PIC microcontroller. The PIC16F688 uses the RC4 I/O pin to read the DHT11 output data. Note that R7 serves as the pull-up resistor required for the data pin of the DHT11 sensor. The S2 switch in the circuit diagram is to select between degree Fahrenheit (°F) and degree Celsius (°C) unit for temperature display. When the switch is open, the RC3 pin is pulled low by default, and the temperature is displayed in °F scale. In order to chose °C scale, the RC3 pin should be pulled high, which happens when S2 is closed.

Next, the photoresistor (R5) and R4 construct a voltage divider network as shown in the circuit. The analog voltage across R4 increases proportionally with the amount of light falling on the photoresistor. The resistance of a typical photoresistor is less than 1 KΩ under bright lighting condition. Its resistance could go up to several hundred KΩ under extremely dark condition. Therefore, for the given setup, the voltage across the R4 resistor can vary from less than 0.1V (under dark condition) to over 4.0V (under very bright illumination). The PIC16F688 microcontroller reads this analog voltage through its AN2 (RA2) ADC channel to determine the surrounding illumination level.

 

For more detail: A DIY indoor thermometer plus hygrometer using PIC16F688

 

Current Project / Post can also be found using:

  • using PIC microcontroller to construct RC helicopter

The post A DIY indoor thermometer plus hygrometer using PIC16F688 appeared first on PIC Microcontroller.

Viewing all 121 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>