MICROCONTROLLER'S PROJECT

Thread Starter

looser

Joined Jun 10, 2017
4
hi guys!!! i am posting it here that is there any mechanism availble in the market to control the humidity of a sensor using microcontroler pic18f452.... how can we interface it with that mechanism? how can that mechanism will tend to increase the humidity? i need ur help
 

drc_567

Joined Dec 29, 2008
1,156
... increasing humidity can be accomplished by merely adding moisture to air.
... decreasing humidity requires cooling the air, to get the moisture to precipitate out..
... So do you require more humidity, less humidity, or both?
 

techlouder

Joined Jun 10, 2017
1
Using a sensor you cannot increase or decrease the humidity of the atmosphere. A sensor is only capable of sensing the level of humidity and giving it to the controller(In your case the microcontroller). In order to increase or decrease the humidity, you need to use some other mechanism externally which can be controlled bu the microcontroller. As an example, if your atmosphere is dry and you want to maintain a level of humidity you do this.
prepare a fan which blows air through a wet cloth. drive the fan's motor via a relay which is interfaced to the MCU. continuously check the humidity level using the sensor. if the value is lower than the required value switch on the fan
 

drc_567

Joined Dec 29, 2008
1,156
The classic way to get a specific level of humidity is to first create dry air, with moisture content below what is required. Then increments of moisture are added until the desired level is achieved.

So, with a humidity sensor, you could program a spray valve to turn on, over a period of time, until some set point is reached. ... Assuming that the initial air mass has been sufficiently dried.
 

Thread Starter

looser

Joined Jun 10, 2017
4
Using a sensor you cannot increase or decrease the humidity of the atmosphere. A sensor is only capable of sensing the level of humidity and giving it to the controller(In your case the microcontroller). In order to increase or decrease the humidity, you need to use some other mechanism externally which can be controlled bu the microcontroller. As an example, if your atmosphere is dry and you want to maintain a level of humidity you do this.
prepare a fan which blows air through a wet cloth. drive the fan's motor via a relay which is interfaced to the MCU. continuously check the humidity level using the sensor. if the value is lower than the required value switch on the fan
yes you are right... but using DHT22 sensor. how can i separate the value of temperature and humidity? as we know that this sensor senses both the humidity and temperature because i want to controll these both physical quantities.. can you help me out please? i am using pic18f452 microcontroller
 

Thread Starter

looser

Joined Jun 10, 2017
4
The classic way to get a specific level of humidity is to first create dry air, with moisture content below what is required. Then increments of moisture are added until the desired level is achieved.

So, with a humidity sensor, you could program a spray valve to turn on, over a period of time, until some set point is reached. ... Assuming that the initial air mass has been sufficiently dried.
yes you are right... but using DHT22 sensor. how can i separate the value of temperature and humidity? as we know that this sensor senses both the humidity and temperature because i want to controll these both physical quantities.. can you help me out please? i am using pic18f452 microcontroller
 

JohnInTX

Joined Jun 26, 2012
4,787
using DHT22 sensor. how can i separate the value of temperature and humidity? as we know that this sensor senses both the humidity and temperature because i want to controll these both physical quantities.. can you help me out please? i am using pic18f452 microcontroller
Here is the datasheet for the sensor. It communicates over a non-standard one-wire interface. The wire is pulled up with a resistor and the host (PIC) and slave (sensor) pull the wire down by outputting a '0' on a port and set the port to HiZ for a '1', not unlike I2C.

The host sends a start sequence to the sensor then switches to receive mode to receive 40bits (5 bytes) of data from the sensor. The sensor always sends 40 bits so you must read all 40 into 5bytes. The first two bytes are the humidity. The next 2 bytes are the temperature and the last byte is a checksum. When you have read all 5 bytes, you can extract RH and temperature from the reading.

The serial interface depends on accurate timing to send the read request to the sensor and receive the data back. The data is returned in 'bit cells' i.e. one bit is represented as a sequence of times the the sensor pulls the data line low. A bit cell always starts with a 50us logic low then the line is released to generate a high. The duration of this high determines whether the data bit in the cell is a '1' or '0'. If the high lasts 70us, the bit is a '1'. If it lasts only 26-28us, the bit is a '0'. The data line then is pulled to 0 for the start of the next 50us low to indicate the beginning of the next bit. See pp5-6 in the datasheet.

To code something like this, I would consider using the Capture/Compare feature of the PIC looking at each edge and generating an interrupt for each edge detected. Inspect the time between edges to determine whether it is 50us (beginning of bit cell), 25us ('0' bit) or 70us ('1' bit). As bits are received, shift them into the registers. When the whole 40 bits have been received, verify the checksum then separate the bytes into RH and temp values. Once you have read temperature and humidity, you can proceed with control.

Good luck!
 

Attachments

Last edited:

drc_567

Joined Dec 29, 2008
1,156
The link here shows the 'Psychrometric Chart'
The abscissa is called the dry bulb temperature.
The curved red lines are relative humidity. A 'comfort zone' is a combination of the two.


One thing to look at is how to lower the relative humidity.
That is, how to make humid air dryer and more comfortable.
The way it works, as an example, ... pick a point on a red curve ... say 50% RH at 25 degrees, dry bulb temperature. As you refrigerate the air, cooling it down, the dry bulb temperature decreases, moving the point to the left horizontally, until it reaches the extreme red curve on the left, at about 12 degrees. Then if you keep cooling, down to about 10 degrees, the point follows the 100% line downward to the left, and some of the moisture content of the air precipitates out. Next, you have to warm it up, moving the point horizontally to the right. However, it has lost some moisture, and is at a lower RH value when it returns to room temperature. So, as you return to 25 degrees dry bulb, the relative humidity is now about 40%.

https://sustainabilityworkshop.autodesk.com/buildings/psychrometric-charts
 
Last edited:
Top