Giter VIP home page Giter VIP logo

fancontrol's Introduction

fancontrol

This is a two-channel fan controller for basement and roof ventilation systems. The principle is simple: An extractor fan pulls out hot air, and an intake fan pulls in cool and dry air. To avoid pulling in humid air, two sensors compare the climate inside and outside, and only activate the intake fan if the exterior air is less humid than the air inside. I have been looking for something off the shelf for this task, but most humidity-controlled fans just take a single reading inside and decide whether to run based on that. Needless to say, that's suboptimal. More complete solutions exist, but cost in excess of several hundred dollars. So I made this ;)

Fan controller in action

WARNING

This is a mains project. Make sure you know what you are doing. Proceed at your own risk.

Parts list

Wiring

I am too lazy for a diagram. Basically, you have to solder the I2C board onto the LCD, and connect it the grounds and VCC (5V) on the ESP32. Connect the I2C multiplexer to GND and 3.3V (NOT 5V!) as well as the I2C data lines SDA (Pin 27 on ESP32) and SCL (Pin 14 on ESP32). The LCDs SDA/SCL is connected to the SD0/SC0 pins on the multiplexer, and the SI7021 sensor connects to SD1/SC1. The relay board has two signal pins for the two channels, which connect to pin 5 and 13 on the ESP32. Finally, connect a momentary pushbutton between ground and Pin 32 on the ESP32. That's it! All that's left to do is to wire the mains for the fans through the relay contacts.

Libraries used

This project uses LiquidCrystal_I2C and DHTesp, install them via the library manager in the Arduino IDE. Do NOT use the adafruit DHT library, it will only cause you grief.

Configuration

Check the top of the source for Wifi variables. Basically there is an optional sending of data to another webserver which you can remove if not needed. External temperature and humidity are fetched from another webserver, the data is expected to be inside a simple text file which is web-readable. I'm using this to fetch data from an outside weather station. This reduces complexity because there's no need to worry about I2C over a long wire, but of course you need Wifi for that. And an external weather sensor. But since there's a multiplexer connected, you could add your own second sensor. However you'll likely still need the multiplexer even if you don't intend to do that, because apparently the LCD library does not play well with other I2C devices on the same bus.

Operation

Everything is automatic. Feel free to adapt the values and/or logic in the code to your preference. The controller will display new values every second, but the fans will change state only once per minute. This is to avoid rapidy cycling the fans on and off, and to allow sensor values to settle. For some reason the LCD may not always initialize on powerup. It will however work after a reset - hence the ugly reset button. If someone figures out why this happens and how to fix it, please let me know.

fancontrol's People

Contributors

dividebysandwich avatar toumal avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.