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:
Wed Apr 09 21:36:13 2014 +0000
Revision:
4:8d1df60ef3c3
Child:
5:bf31a58915a5
Rev2;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
umairaftab 4:8d1df60ef3c3 1 #include "mbed.h"
umairaftab 4:8d1df60ef3c3 2 #include "airhumidity.h"
umairaftab 4:8d1df60ef3c3 3 #include "DHT.h"
umairaftab 4:8d1df60ef3c3 4
umairaftab 4:8d1df60ef3c3 5 int error_outside;
umairaftab 4:8d1df60ef3c3 6 int error_inside;
umairaftab 4:8d1df60ef3c3 7
umairaftab 4:8d1df60ef3c3 8 DHT sensor_outside(PTD4,SEN11301P);
umairaftab 4:8d1df60ef3c3 9 DHT sensor_inside(PTD5,SEN11301P);
umairaftab 4:8d1df60ef3c3 10
umairaftab 4:8d1df60ef3c3 11 float get_air_temp_outside(int tempunit){
umairaftab 4:8d1df60ef3c3 12 wait(1);
umairaftab 4:8d1df60ef3c3 13 error_outside = sensor_outside.readData();
umairaftab 4:8d1df60ef3c3 14 switch (tempunit){
umairaftab 4:8d1df60ef3c3 15 case 0:
umairaftab 4:8d1df60ef3c3 16 return sensor_outside.ReadTemperature(CELCIUS);
umairaftab 4:8d1df60ef3c3 17 break;
umairaftab 4:8d1df60ef3c3 18 case 1:
umairaftab 4:8d1df60ef3c3 19 return sensor_outside.ReadTemperature(FARENHEIT);
umairaftab 4:8d1df60ef3c3 20 break;
umairaftab 4:8d1df60ef3c3 21 case 2:
umairaftab 4:8d1df60ef3c3 22 return sensor_outside.ReadTemperature(KELVIN);
umairaftab 4:8d1df60ef3c3 23 break;
umairaftab 4:8d1df60ef3c3 24 }
umairaftab 4:8d1df60ef3c3 25 }
umairaftab 4:8d1df60ef3c3 26
umairaftab 4:8d1df60ef3c3 27 float get_air_humid_outside(){
umairaftab 4:8d1df60ef3c3 28 wait(1);
umairaftab 4:8d1df60ef3c3 29 error_outside = sensor_outside.readData();
umairaftab 4:8d1df60ef3c3 30 return sensor_outside.ReadHumidity();
umairaftab 4:8d1df60ef3c3 31 }
umairaftab 4:8d1df60ef3c3 32
umairaftab 4:8d1df60ef3c3 33 float get_air_dewpoint_outside(){
umairaftab 4:8d1df60ef3c3 34 wait(1);
umairaftab 4:8d1df60ef3c3 35 error_outside = sensor_outside.readData();
umairaftab 4:8d1df60ef3c3 36 return sensor_outside.CalcdewPointFast(sensor_outside.ReadTemperature(CELCIUS), sensor_outside.ReadHumidity());
umairaftab 4:8d1df60ef3c3 37
umairaftab 4:8d1df60ef3c3 38 }
umairaftab 4:8d1df60ef3c3 39
umairaftab 4:8d1df60ef3c3 40 //INSIDE FUNCTIONS
umairaftab 4:8d1df60ef3c3 41 float get_air_temp_inside(int tempunit){
umairaftab 4:8d1df60ef3c3 42 wait(1);
umairaftab 4:8d1df60ef3c3 43 error_inside = sensor_inside.readData();
umairaftab 4:8d1df60ef3c3 44 switch (tempunit){
umairaftab 4:8d1df60ef3c3 45 case 0:
umairaftab 4:8d1df60ef3c3 46 return sensor_inside.ReadTemperature(CELCIUS);
umairaftab 4:8d1df60ef3c3 47 break;
umairaftab 4:8d1df60ef3c3 48 case 1:
umairaftab 4:8d1df60ef3c3 49 return sensor_inside.ReadTemperature(FARENHEIT);
umairaftab 4:8d1df60ef3c3 50 break;
umairaftab 4:8d1df60ef3c3 51 case 2:
umairaftab 4:8d1df60ef3c3 52 return sensor_inside.ReadTemperature(KELVIN);
umairaftab 4:8d1df60ef3c3 53 break;
umairaftab 4:8d1df60ef3c3 54 }
umairaftab 4:8d1df60ef3c3 55 }
umairaftab 4:8d1df60ef3c3 56
umairaftab 4:8d1df60ef3c3 57
umairaftab 4:8d1df60ef3c3 58 float get_air_humid_inside(){
umairaftab 4:8d1df60ef3c3 59 wait(1);
umairaftab 4:8d1df60ef3c3 60 error_inside = sensor_inside.readData();
umairaftab 4:8d1df60ef3c3 61 return sensor_inside.ReadHumidity();
umairaftab 4:8d1df60ef3c3 62 }
umairaftab 4:8d1df60ef3c3 63
umairaftab 4:8d1df60ef3c3 64 float get_air_dewpoint_inside(){
umairaftab 4:8d1df60ef3c3 65 wait(1);
umairaftab 4:8d1df60ef3c3 66 error_inside = sensor_inside.readData();
umairaftab 4:8d1df60ef3c3 67 return sensor_inside.CalcdewPointFast(sensor_inside.ReadTemperature(CELCIUS), sensor_inside.ReadHumidity());
umairaftab 4:8d1df60ef3c3 68
umairaftab 4:8d1df60ef3c3 69 }
umairaftab 4:8d1df60ef3c3 70 //printf("Temperature is %4.0f C \r\n",sensor.ReadTemperature(CELCIUS));
umairaftab 4:8d1df60ef3c3 71 //printf("Temperature is %4.2f F \r\n",sensor.ReadTemperature(FARENHEIT));
umairaftab 4:8d1df60ef3c3 72 //printf("Temperature is %4.2f K \r\n",sensor.ReadTemperature(KELVIN));
umairaftab 4:8d1df60ef3c3 73 //printf("Humidity is %4.2f \r\n",sensor.ReadHumidity());
umairaftab 4:8d1df60ef3c3 74 //printf("Dew point is %4.2f \r\n",sensor.CalcdewPoint(sensor.ReadTemperature(CELCIUS), sensor.ReadHumidity()));
umairaftab 4:8d1df60ef3c3 75 //printf("Dew point (fast) is %4.2f \r\n",sensor.CalcdewPointFast(sensor.ReadTemperature(CELCIUS), sensor.ReadHumidity()));