![]() ![]() Using the M and C values fill out the portion of the code: #define HUMIDITY_C 680 Now remember your algebra! Solve these two equations: Alternatively the last step can be done using the humidifier inside a large bag with the humidity reader inside it. Next go take a shower (take your computer with you), make sure it is a cold morning, after having a shower make sure there is a fine mist and take a number of readings withĪverage this value and write it down, this is your X2, your Y2 value is 100. Write this value down, this is your X1 val, your Y1 value is 75. Read off the serial out on the Arduino to find what value you are gettingĪverage this value over a number of readings. From what I understand the humidity should be at 75% inside the bag. Put the humidity reader in with it and wait for about 12 hours. This bit is tricky in that unless you have another humidity reader that you trust you can't be 100% sure that what you are calibrating is correct.Īfter some investigation I did find that I could get two readings (two is all you need) to calibrate.įirst get a a plastic lunch bag and in it put a mug of salt which you have dampened just enough to make it feel like wet sand. Please note that the code uses the EEprom library for reading writing eeprom values, the lcd4bit library (modified, delays are removed and the pinouts changed) for the lcd shield, and stdlib for converting int into char for writing to the LCD display. These are all situated at the top of the code so take a look and have fun fiddling. If you are more inclined to shy away from reading the code, please note the main things to note are the #define statements for manipulating intervals for reading,triggering and averaging and the #define statements for calibrating M and C values. I have tried to give an explanation within the code as to what each section does, by all means go in and take a look. Funtions to help with averaging and key selection. Keypad code that implements a rudimentary menu system allowing triggering values to be changed and EEPROM values to be dumped to serial. Trigger relays if bellow/above trigger, every "INTERVAL" milliseconds. Stores values to eeprom every "EE_PROM_INTERVAL" milliseconds. Prints updates of new temp, humidity and Co2 levels to LCD shield. centigrade (apologies to my american cousins but I am metric), ppm (co2), Relative Humidity. Performs calculations on the averages to give a 'proper' value i.e. Puts the new values in an array and averages this array. Read in sensor values every "SENSOR_INTERVAL" milliseconds. #defines sizes for averaging array, sampling times, histerisis levels, Pins, EEProm storage size. #defines M and C values for the linear and log equations required to translate the bit values for the inputs. In brief the code (in order of how it appears in the attached code) does: please note the original lcd4bit library has a lot of unnecessary delays in it which slows the code down A LOT, these should be removed (look in the cpp library file for clues). ![]() I am sure that there are many changes that could be made to streamline it, but it does the job and what's required of the Arduino board isn't really that intensive for this project. This was the first time I have coded in C in a long time (and my first real Arduino project). You can make it yourself, it is a high precision op amp set up as non-inverting with gain around 10). MG811 C02 sensor (I got a breakout board with op-amp amplifier built in. Jiffy box to house inline socket/screws to connect Sensors. USB cable (socket that connects to USB on Arduino). Here is the list of items I used for the project. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |