Project Autus - Automated Plant Chamber

Dependencies:   TextLCD mbed

Fork of keypad_test by Plamen Totev

Autus

This is the codebase accompanying the project Autus.

Autus is an automated growth chamber for plants.

Features

Control Humidity inside chamber wrt to external humidity. Control Temperature inside chamber. ( Peltier Heaters/Coolers ) Water and shower plants. Control soil humidity. Monitor water tanks level (Load Cell) /media/uploads/umairaftab/frdm_-_new_page1.png

Code Base Features

Fixed timing and CRC for DHT-11 Sensor. Fixed OneWire bug for ds18b20

Cyclic Executive Scheduler with Priority. Async IPC framework for PC App over bluetooth

Fake RTC systick, I was having some trouble with the on board rtc.

/media/uploads/umairaftab/download.png

Committer:
umairaftab
Date:
Fri Apr 11 02:51:58 2014 +0000
Revision:
5:bf31a58915a5
Parent:
4:8d1df60ef3c3
Child:
7:1d691f81d455
Soil humidity code added

Who changed what in which revision?

UserRevisionLine numberNew contents of line
umairaftab 3:087ce66714c0 1 #include "mbed.h"
umairaftab 4:8d1df60ef3c3 2 #include "keypad.h"
umairaftab 4:8d1df60ef3c3 3 //#include "globalvalues.h"
umairaftab 3:087ce66714c0 4 #include "ui.h"
umairaftab 4:8d1df60ef3c3 5 #include "airhumidity.h" //for error variables
umairaftab 3:087ce66714c0 6
umairaftab 3:087ce66714c0 7 char lcd_keypad_value ;
umairaftab 4:8d1df60ef3c3 8 int temp_unit = 0; //0 for celcius 1 for faren 2 for kelvin
umairaftab 4:8d1df60ef3c3 9 char temp_unit_char = 'C';
umairaftab 4:8d1df60ef3c3 10
umairaftab 4:8d1df60ef3c3 11 float outside_humidity;
umairaftab 4:8d1df60ef3c3 12 float outside_temp;
umairaftab 4:8d1df60ef3c3 13 float outside_dewpoint;
umairaftab 4:8d1df60ef3c3 14
umairaftab 4:8d1df60ef3c3 15 float inside_humidity;
umairaftab 4:8d1df60ef3c3 16 float inside_temp;
umairaftab 4:8d1df60ef3c3 17 float inside_dewpoint;
umairaftab 4:8d1df60ef3c3 18
umairaftab 4:8d1df60ef3c3 19 float soil1_humidity;
umairaftab 4:8d1df60ef3c3 20 float soil2_humidity;
umairaftab 4:8d1df60ef3c3 21
umairaftab 4:8d1df60ef3c3 22 //Set Temperature Unit
umairaftab 4:8d1df60ef3c3 23 void set_temp_unit(){
umairaftab 4:8d1df60ef3c3 24 if(temp_unit == 1){
umairaftab 4:8d1df60ef3c3 25 temp_unit_char = 'F';
umairaftab 4:8d1df60ef3c3 26 }
umairaftab 4:8d1df60ef3c3 27 else if(temp_unit == 2){
umairaftab 4:8d1df60ef3c3 28 temp_unit_char = 'K';
umairaftab 4:8d1df60ef3c3 29 }
umairaftab 4:8d1df60ef3c3 30 else{
umairaftab 4:8d1df60ef3c3 31 temp_unit_char = 'C';
umairaftab 4:8d1df60ef3c3 32 }
umairaftab 4:8d1df60ef3c3 33 }
umairaftab 3:087ce66714c0 34
umairaftab 3:087ce66714c0 35 void ui_startup(){
umairaftab 5:bf31a58915a5 36
umairaftab 4:8d1df60ef3c3 37 lcd.cls();
umairaftab 3:087ce66714c0 38 lcd.setCursor(TextLCD::CurOff_BlkOn);
umairaftab 3:087ce66714c0 39 lcd.locate(0,0);
umairaftab 3:087ce66714c0 40 lcd.printf("Project Autus");
umairaftab 3:087ce66714c0 41 lcd.locate(0,1);
umairaftab 3:087ce66714c0 42 lcd.printf("Initializing Machine");
umairaftab 3:087ce66714c0 43 }
umairaftab 3:087ce66714c0 44
umairaftab 4:8d1df60ef3c3 45 void ui_screen1() {
umairaftab 5:bf31a58915a5 46
umairaftab 5:bf31a58915a5 47 set_temp_unit();
umairaftab 4:8d1df60ef3c3 48 lcd.cls();
umairaftab 4:8d1df60ef3c3 49 lcd.setCursor(TextLCD::CurOff_BlkOn);
umairaftab 4:8d1df60ef3c3 50 lcd.locate(0,0);
umairaftab 4:8d1df60ef3c3 51 lcd.printf("T: %3.1f%c",inside_temp,temp_unit_char);
umairaftab 4:8d1df60ef3c3 52 lcd.printf(" H: %3.1f",inside_humidity);
umairaftab 4:8d1df60ef3c3 53 lcd.locate(0,1);
umairaftab 4:8d1df60ef3c3 54 lcd.printf("S1: %3.1f",soil1_humidity);
umairaftab 4:8d1df60ef3c3 55 lcd.printf(" S2: %3.1f",soil2_humidity);
umairaftab 4:8d1df60ef3c3 56 }
umairaftab 4:8d1df60ef3c3 57
umairaftab 5:bf31a58915a5 58 void ui_screen2() {
umairaftab 5:bf31a58915a5 59
umairaftab 5:bf31a58915a5 60 set_temp_unit();
umairaftab 5:bf31a58915a5 61 lcd.cls();
umairaftab 5:bf31a58915a5 62 lcd.setCursor(TextLCD::CurOff_BlkOn);
umairaftab 5:bf31a58915a5 63 lcd.locate(0,0);
umairaftab 5:bf31a58915a5 64 lcd.printf("iT: %3.1f%c",inside_temp,temp_unit_char);
umairaftab 5:bf31a58915a5 65 lcd.printf(" iH: %3.1f",inside_humidity);
umairaftab 5:bf31a58915a5 66 lcd.locate(0,1);
umairaftab 5:bf31a58915a5 67 lcd.printf("oT: %3.1f%c",outside_temp,temp_unit_char);
umairaftab 5:bf31a58915a5 68 lcd.printf(" oH: %3.1f",outside_humidity);
umairaftab 5:bf31a58915a5 69 }
umairaftab 5:bf31a58915a5 70
umairaftab 5:bf31a58915a5 71 void ui_screen3() {
umairaftab 5:bf31a58915a5 72
umairaftab 5:bf31a58915a5 73 //set_temp_unit();
umairaftab 5:bf31a58915a5 74 lcd.cls();
umairaftab 5:bf31a58915a5 75 lcd.setCursor(TextLCD::CurOff_BlkOn);
umairaftab 5:bf31a58915a5 76 lcd.locate(0,0);
umairaftab 5:bf31a58915a5 77 lcd.printf("iT: %3.1f%c",inside_temp,temp_unit_char);
umairaftab 5:bf31a58915a5 78 lcd.printf(" iH: %3.1f",inside_humidity);
umairaftab 5:bf31a58915a5 79 lcd.locate(0,1);
umairaftab 5:bf31a58915a5 80 lcd.printf("oT: %3.1f%c",outside_temp,temp_unit_char);
umairaftab 5:bf31a58915a5 81 lcd.printf(" oH: %3.1f",outside_humidity);
umairaftab 5:bf31a58915a5 82 }