📜 ⬆️ ⬇️

Refinement of the ventilator or ventilation control from the carbon dioxide sensor

image
The level of carbon dioxide (CO2) is one of the important indicators of indoor air quality. It is also very convenient to use its level to control the ventilation.

In the article I will talk about the refinement of the ventilator and the remote control of the fans by means of microcontrollers and a CO2 sensor.
Also, if desired, after a small revision, the same scheme can be applied to control the intake-exhaust system.


')
The average apartment is usually designed for natural ventilation. This is when the air enters through the cracks in the windows and exits through the exhaust hole somewhere in the area of ​​the kitchen, toilet, etc.
In an apartment with plastic windows installed, the cracks, as a rule, do not happen and, in order for the ventilation to work, you have to slightly open the windows or air vents, which improves the situation with air when the hood is working normally.
But in this way we add street noise.

To get fresh air in the room without noise can be installed:
  1. Supply system
  2. Venting air from the street through a hole in the main wall

The first option solves all problems, but is expensive and requires space for equipment and ventilation ducts.
The second option is simpler, but since the unit itself is of limited size, noise will depend on its mode of operation.
Here is the option and consider.

Here is a table of levels of carbon dioxide and its effects on health, to know what to strive for:



Thus, we will consider the level of CO2 equal to 450-1000 ppm optimal for the room.
About my experience, I will say that with the windows and doors closed, the ventilator is turned on at the minimum and two people are in the room, by morning it will be about 1200-1500 ppm, which is a bit too much.


Work algorithm



The algorithm used to control the performance of ventilation is quite simple, but if you wish, you can complicate:


The carbon dioxide monitor used is an inexpensive household CO2 monitor MIC 98130.
Air flows through the Aeropac 90A.
The hood is reinforced with a SystemAir IF 150 duct fan.

For control, Atmel AVR ATtiny44A microcontrollers are used.
Data is transmitted from the controller connected to the CO2 monitor to the controllers controlling the fans using modules on the NRF24L01 + transceiver.
Setting the operation mode and setting is possible using any IR remote control, or a magnet or a button.


CO2 monitor upgrade



image
The CO2 monitor ordered on ebay, as it turned out, has an SenseAir K22 infrared gas analyzer inside with fairly good accuracy.
And most importantly - it has a special output with a level of CO2 (in the picture there is a white connector with four contacts).

On this connector, from left to right:

  1. power + 9V
  2. common
  3. CO2 output in PWM from 350 to 2000 ppm

There is not a lot of free space inside, so a mini-card with a NRF24L01 + transceiver was used for refinement and the microcontroller is also soldered onto it in an SOP14 casing. Before sealing, DWEN fusion was enabled for programming and debugging via the debugWIRE protocol.

On radio modules there is one remark - the transmission distance is not long enough.
image
Especially if there are walls, doors between the transmitter and the receiver. So it is better to choose modules with an external antenna or try to keep as few obstacles between the transmitter and receiver as possible.

There is an nRF24L01 + compatible Chinese chip with increased transmit power - the SI24R01.
Modules with it usually cost less, so it’s better to take with it.
True, I did not find imputed mini-modules with this chip and the project still uses modules with the native nRF24L01 + chip.
To enable increased transmit power, the SI24R01 uses bit 0 of the RF_SETUP register.

On resistors R1, R2 assembled divider to reduce the voltage received from the sensor.
image
The value of CO2 is obtained by calculating the time between the change of level on the foot of the controller. The time is taken from the counter 16 bit timer.
In order to perform fewer calculations, the microcontroller operates at a frequency of 8.192 MHz, and the timer divider is set to 1024.
Thus, the TCNT1 timer counter increases every 0.125 ms.
It turns out to calculate the level of CO2 - you need to divide the timer counter by 4 and subtract 4.

PWM signal at the sensor output:


Scheme:
Scheme

The photoresistor LDR1 is used to determine the threshold of darkness, the button - for the initial memorization of IR remote control commands. The LED informs about transmission errors, and is also used for tuning.

To control and configure, I decided to use a conventional IR remote control, the commands of which I need to first register in the microcontroller.
Entering the programming mode - press and hold the button for more than 3 seconds. Then in order to irradiate the IR receiver, pressing the buttons on the remote.
IR commands:
  1. up,
  2. way down,
  3. choice,
  4. setting the adjustment speed of each fan.

In normal mode, the “up” and “down” commands increase or decrease the speeds of all fans by one notch.
The "select" command is a reset.
Using command 4, the speed offset setting of each fan is entered. First, the fan number is selected, then, after selection, the offset is entered. The LED in this mode blinks the current selection.

Commands are identified by the microcontroller in this way:

A simple hash function is used to reduce the load on the controller.
with the formula: hash = hash * 17 + x
if(IRSignalTimer > IRSignalTimerLast) // bit = a / b > 1.5 bit = (uint8_t)(IRSignalTimer - IRSignalTimerLast) > IRSignalTimerLast / 2; else bit = (uint8_t)(IRSignalTimerLast - IRSignalTimer) > IRSignalTimer / 2; IRReadedByte = (IRReadedByte << 1) | bit; if(++IRArrayBit > 7) { IRArrayBit = 0; IRHash = ((IRHash << 4) + IRHash) + IRReadedByte; // * 17 IRReadedByte = 0; } 


Many articles have been written on working with radio modules NRF24L01, I will not go into this topic further.
I can only say that they are set to work at a speed of 1Mbps, CRC is used and each program must be confirmed by an ACK packet.
For communication between the controller and the module, the hardware USI interface is used.
The IRQ output is not used, the verification of the packet transmission confirmation is looped in the NRF24_Transmit function.

It is transmitted to each fan - the CO2 level, the fan speed and the sign of the night.
In the current project, the controllers that control the fans, while using only the speed.


Finalization of the ventilator



I have installed Aeropac 90A ventilators from SIEGENIA-AUBI - this is a rather ancient model.
It has been working for more than one year and, as practice has shown, the thing is generally useful.
Air he drives through the 80 mm hole in the wall and has a carbon filter.
Noise isolation from sounds from the street is very good.

Inside installed centrifugal fan Ebmpapst R2E133-BH96-19.
With the noise of the fan itself after so many years of work, everything is not going smoothly. At low revs a low-frequency rumble may occur, and at high rpm a certain howling may occur.
And it manifests itself individually. One fan buzzes more at low revs, the other whistles at high.
Solved this problem by speed limit.

In the ventilator, the engine speed adjustment scheme is implemented very interestingly - from low to medium speeds, smoothly, and then the maximum speed starts immediately.
If at the minimum and average speed it works quietly enough, then at the maximum speed it is not comfortable to be indoors.
In the new model - Aeropac SN, in spite of the digital step adjustment, the principle of adjustment of revolutions remained the same - from 1 to 6 speeds of revolutions are regulated somewhere up to the middle, and then immediately the maximum.

In the diagram, the electronic unit of the ventilator is circled by a dotted line:
Scheme

The refinement consists in cutting the track leading from the average output of the variable resistor RV1 to resistors R6 and R7. Optocouplers U2 and U3 are connected to the break, which will control the fan speed.
The control PWM signal to the optocouplers supplies the microcontroller through the integrating RC chain.
The LED in the optocoupler begins to conduct current only from a certain voltage, so the program has a setting for the minimum value of the PWM signal.
The variable resistor remains, and they, if desired, can limit the maximum speed.

If the performance at medium speed is not enough, then it may be increased by replacing the capacitor C9 with a larger capacitor. On the board, there are prudently openings for two sizes of capacitors - with a distance of 27.5mm and 22mm between the terminals.



There is enough space inside the ventilator - not one board will fit either.
The only problem may arise with radio modules. The case is double and made of thick plastic.
With the radio module on the native chip nRF24L01 + there was no connection with the next room.
He unscrewed this way - he soldered the single-core copper wire to the built-in antenna, brought him out through the hole for the LED and placed the end under the twist of the variable resistor. With the coordination of the antenna did not bother.
The connection has appeared.

For setting, instead of a button, a reed switch (SW1) is used, in order not to spoil the appearance and not violate sound insulation.
The magnet from the hard disk is enough.


Exhaust hood



The incoming air must eventually go somewhere. A natural extract, even if somehow cope in the winter, then in the summer it will most likely not be enough.
In my case, I used a SystemAir IF 150 channel fan with a single-phase motor. Its outer diameter is 15 cm.

Adjusting its speed is stepped and made on capacitors. Opto-simistors shunt capacitors, thus changing the voltage applied to the fan motor.
With two capacitors, 4 speeds are obtained.

Scheme:
Scheme



Since the hood is installed in the kitchen, I decided at the same time to make additional control of the fan from the console.
To, if something serious is being cooked on the stove, by pressing one button, turn on the hood to the maximum.
The speed received over the radio is ignored.

The fan control program is universal and, depending on the settings in the non-volatile memory, can control the fans using either PWM or discrete mode.
Whether the IR receiver is connected to the controller is also set in the EEPROM.

The program has the ability to relay the received packet further - to another fan.
In this way, for example, you can increase the distance between the CO2 sensor and the exhaust fan.

Source code in C (for Atmel Studio 6.1): yadi.sk/d/cGpSoKqZEceQN

Source: https://habr.com/ru/post/205076/


All Articles