Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Thumbs.db
*.log
*.ini
config.js
NetduinoPlus-Pinout-v1.2.jpg
[Bb]in
[Dd]ebug*/
*.lib
Expand Down
198 changes: 116 additions & 82 deletions Aquarium-Controller.sln
Original file line number Diff line number Diff line change
@@ -1,82 +1,116 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Controller", "Controller\Controller.csproj", "{117848BD-213C-4AE4-8F58-D27F14DAA534}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin-Logfile", "Plugin-Logfile\Plugin-Logfile.csproj", "{65B2EAC1-B841-4134-9229-B24583B46FFB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin-Temperature", "Plugin-Temperature\Plugin-Temperature.csproj", "{79EFAD9E-C3E1-4D3F-993E-7CFF382A1C29}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin-Thingspeak", "Plugin-Thingspeak\Plugin-Thingspeak.csproj", "{94EB2D77-53BC-4086-BD6F-9F400C1FD13F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin-Relays", "Plugin-Relays\Plugin-Relays.csproj", "{E9EB4D78-EEC4-4A40-9DE4-CB1EEA20977B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebServer", "WebServer\WebServer.csproj", "{F444D76A-7C89-4AD5-B7B6-1B8293A0DC13}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin-pH", "Plugin-pH\Plugin-pH.csproj", "{428E9964-527F-48D8-B88A-8A22435F481B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin-AquariumStatus", "Plugin-AquariumStatus\Plugin-AquariumStatus.csproj", "{F0F2B76C-B9A5-4BA8-B551-5217295EF377}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Emulator|Any CPU = Emulator|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{117848BD-213C-4AE4-8F58-D27F14DAA534}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{117848BD-213C-4AE4-8F58-D27F14DAA534}.Debug|Any CPU.Build.0 = Debug|Any CPU
{117848BD-213C-4AE4-8F58-D27F14DAA534}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{117848BD-213C-4AE4-8F58-D27F14DAA534}.Emulator|Any CPU.ActiveCfg = Emulator|Any CPU
{117848BD-213C-4AE4-8F58-D27F14DAA534}.Emulator|Any CPU.Build.0 = Emulator|Any CPU
{117848BD-213C-4AE4-8F58-D27F14DAA534}.Emulator|Any CPU.Deploy.0 = Emulator|Any CPU
{117848BD-213C-4AE4-8F58-D27F14DAA534}.Release|Any CPU.ActiveCfg = Release|Any CPU
{117848BD-213C-4AE4-8F58-D27F14DAA534}.Release|Any CPU.Build.0 = Release|Any CPU
{117848BD-213C-4AE4-8F58-D27F14DAA534}.Release|Any CPU.Deploy.0 = Release|Any CPU
{65B2EAC1-B841-4134-9229-B24583B46FFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{65B2EAC1-B841-4134-9229-B24583B46FFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{65B2EAC1-B841-4134-9229-B24583B46FFB}.Emulator|Any CPU.ActiveCfg = Emulator|Any CPU
{65B2EAC1-B841-4134-9229-B24583B46FFB}.Emulator|Any CPU.Build.0 = Emulator|Any CPU
{65B2EAC1-B841-4134-9229-B24583B46FFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{65B2EAC1-B841-4134-9229-B24583B46FFB}.Release|Any CPU.Build.0 = Release|Any CPU
{79EFAD9E-C3E1-4D3F-993E-7CFF382A1C29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{79EFAD9E-C3E1-4D3F-993E-7CFF382A1C29}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79EFAD9E-C3E1-4D3F-993E-7CFF382A1C29}.Emulator|Any CPU.ActiveCfg = Emulator|Any CPU
{79EFAD9E-C3E1-4D3F-993E-7CFF382A1C29}.Emulator|Any CPU.Build.0 = Emulator|Any CPU
{79EFAD9E-C3E1-4D3F-993E-7CFF382A1C29}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79EFAD9E-C3E1-4D3F-993E-7CFF382A1C29}.Release|Any CPU.Build.0 = Release|Any CPU
{94EB2D77-53BC-4086-BD6F-9F400C1FD13F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{94EB2D77-53BC-4086-BD6F-9F400C1FD13F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{94EB2D77-53BC-4086-BD6F-9F400C1FD13F}.Emulator|Any CPU.ActiveCfg = Emulator|Any CPU
{94EB2D77-53BC-4086-BD6F-9F400C1FD13F}.Emulator|Any CPU.Build.0 = Emulator|Any CPU
{94EB2D77-53BC-4086-BD6F-9F400C1FD13F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{94EB2D77-53BC-4086-BD6F-9F400C1FD13F}.Release|Any CPU.Build.0 = Release|Any CPU
{E9EB4D78-EEC4-4A40-9DE4-CB1EEA20977B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E9EB4D78-EEC4-4A40-9DE4-CB1EEA20977B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E9EB4D78-EEC4-4A40-9DE4-CB1EEA20977B}.Emulator|Any CPU.ActiveCfg = Emulator|Any CPU
{E9EB4D78-EEC4-4A40-9DE4-CB1EEA20977B}.Emulator|Any CPU.Build.0 = Emulator|Any CPU
{E9EB4D78-EEC4-4A40-9DE4-CB1EEA20977B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E9EB4D78-EEC4-4A40-9DE4-CB1EEA20977B}.Release|Any CPU.Build.0 = Release|Any CPU
{F444D76A-7C89-4AD5-B7B6-1B8293A0DC13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F444D76A-7C89-4AD5-B7B6-1B8293A0DC13}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F444D76A-7C89-4AD5-B7B6-1B8293A0DC13}.Emulator|Any CPU.ActiveCfg = Release|Any CPU
{F444D76A-7C89-4AD5-B7B6-1B8293A0DC13}.Emulator|Any CPU.Build.0 = Release|Any CPU
{F444D76A-7C89-4AD5-B7B6-1B8293A0DC13}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F444D76A-7C89-4AD5-B7B6-1B8293A0DC13}.Release|Any CPU.Build.0 = Release|Any CPU
{428E9964-527F-48D8-B88A-8A22435F481B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{428E9964-527F-48D8-B88A-8A22435F481B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{428E9964-527F-48D8-B88A-8A22435F481B}.Emulator|Any CPU.ActiveCfg = Release|Any CPU
{428E9964-527F-48D8-B88A-8A22435F481B}.Emulator|Any CPU.Build.0 = Release|Any CPU
{428E9964-527F-48D8-B88A-8A22435F481B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{428E9964-527F-48D8-B88A-8A22435F481B}.Release|Any CPU.Build.0 = Release|Any CPU
{F0F2B76C-B9A5-4BA8-B551-5217295EF377}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0F2B76C-B9A5-4BA8-B551-5217295EF377}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0F2B76C-B9A5-4BA8-B551-5217295EF377}.Emulator|Any CPU.ActiveCfg = Release|Any CPU
{F0F2B76C-B9A5-4BA8-B551-5217295EF377}.Emulator|Any CPU.Build.0 = Release|Any CPU
{F0F2B76C-B9A5-4BA8-B551-5217295EF377}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0F2B76C-B9A5-4BA8-B551-5217295EF377}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Controller", "Controller\Controller.csproj", "{117848BD-213C-4AE4-8F58-D27F14DAA534}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin-Logfile", "Plugin-Logfile\Plugin-Logfile.csproj", "{65B2EAC1-B841-4134-9229-B24583B46FFB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin-Temperature", "Plugin-Temperature\Plugin-Temperature.csproj", "{79EFAD9E-C3E1-4D3F-993E-7CFF382A1C29}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin-Thingspeak", "Plugin-Thingspeak\Plugin-Thingspeak.csproj", "{94EB2D77-53BC-4086-BD6F-9F400C1FD13F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin-Relays", "Plugin-Relays\Plugin-Relays.csproj", "{E9EB4D78-EEC4-4A40-9DE4-CB1EEA20977B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin-pH", "Plugin-pH\Plugin-pH.csproj", "{428E9964-527F-48D8-B88A-8A22435F481B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin-AquariumStatus", "Plugin-AquariumStatus\Plugin-AquariumStatus.csproj", "{F0F2B76C-B9A5-4BA8-B551-5217295EF377}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin-ElectricalConductivity", "Plugin-ElectricalConductivity\Plugin-ElectricalConductivity.csproj", "{81D8D4B0-E62D-4F66-8E66-BC26616BDC9C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin-DHTSensor", "Plugin-DHTSensor\Plugin-DHTSensor.csproj", "{D02941EE-C27E-4422-AD5E-FE99C4B822CA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin-CO2", "Plugin-CO2\Plugin-CO2.csproj", "{A71793DB-2334-4922-9139-4CCEF2B3EE31}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebServer", "WebServer\WebServer.csproj", "{71B2DDB7-063C-4866-BD82-83D06E22E225}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetduinoPlusTelnet", "NetduinoPlusTelnet\NetduinoPlusTelnet\NetduinoPlusTelnet.csproj", "{58DB2B34-17A3-448D-A0B5-A5FEBEAC6F53}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Emulator|Any CPU = Emulator|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{117848BD-213C-4AE4-8F58-D27F14DAA534}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{117848BD-213C-4AE4-8F58-D27F14DAA534}.Debug|Any CPU.Build.0 = Debug|Any CPU
{117848BD-213C-4AE4-8F58-D27F14DAA534}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{117848BD-213C-4AE4-8F58-D27F14DAA534}.Emulator|Any CPU.ActiveCfg = Emulator|Any CPU
{117848BD-213C-4AE4-8F58-D27F14DAA534}.Emulator|Any CPU.Build.0 = Emulator|Any CPU
{117848BD-213C-4AE4-8F58-D27F14DAA534}.Emulator|Any CPU.Deploy.0 = Emulator|Any CPU
{117848BD-213C-4AE4-8F58-D27F14DAA534}.Release|Any CPU.ActiveCfg = Release|Any CPU
{117848BD-213C-4AE4-8F58-D27F14DAA534}.Release|Any CPU.Build.0 = Release|Any CPU
{117848BD-213C-4AE4-8F58-D27F14DAA534}.Release|Any CPU.Deploy.0 = Release|Any CPU
{65B2EAC1-B841-4134-9229-B24583B46FFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{65B2EAC1-B841-4134-9229-B24583B46FFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{65B2EAC1-B841-4134-9229-B24583B46FFB}.Emulator|Any CPU.ActiveCfg = Emulator|Any CPU
{65B2EAC1-B841-4134-9229-B24583B46FFB}.Emulator|Any CPU.Build.0 = Emulator|Any CPU
{65B2EAC1-B841-4134-9229-B24583B46FFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{65B2EAC1-B841-4134-9229-B24583B46FFB}.Release|Any CPU.Build.0 = Release|Any CPU
{79EFAD9E-C3E1-4D3F-993E-7CFF382A1C29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{79EFAD9E-C3E1-4D3F-993E-7CFF382A1C29}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79EFAD9E-C3E1-4D3F-993E-7CFF382A1C29}.Emulator|Any CPU.ActiveCfg = Emulator|Any CPU
{79EFAD9E-C3E1-4D3F-993E-7CFF382A1C29}.Emulator|Any CPU.Build.0 = Emulator|Any CPU
{79EFAD9E-C3E1-4D3F-993E-7CFF382A1C29}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79EFAD9E-C3E1-4D3F-993E-7CFF382A1C29}.Release|Any CPU.Build.0 = Release|Any CPU
{94EB2D77-53BC-4086-BD6F-9F400C1FD13F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{94EB2D77-53BC-4086-BD6F-9F400C1FD13F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{94EB2D77-53BC-4086-BD6F-9F400C1FD13F}.Emulator|Any CPU.ActiveCfg = Emulator|Any CPU
{94EB2D77-53BC-4086-BD6F-9F400C1FD13F}.Emulator|Any CPU.Build.0 = Emulator|Any CPU
{94EB2D77-53BC-4086-BD6F-9F400C1FD13F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{94EB2D77-53BC-4086-BD6F-9F400C1FD13F}.Release|Any CPU.Build.0 = Release|Any CPU
{E9EB4D78-EEC4-4A40-9DE4-CB1EEA20977B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E9EB4D78-EEC4-4A40-9DE4-CB1EEA20977B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E9EB4D78-EEC4-4A40-9DE4-CB1EEA20977B}.Emulator|Any CPU.ActiveCfg = Emulator|Any CPU
{E9EB4D78-EEC4-4A40-9DE4-CB1EEA20977B}.Emulator|Any CPU.Build.0 = Emulator|Any CPU
{E9EB4D78-EEC4-4A40-9DE4-CB1EEA20977B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E9EB4D78-EEC4-4A40-9DE4-CB1EEA20977B}.Release|Any CPU.Build.0 = Release|Any CPU
{428E9964-527F-48D8-B88A-8A22435F481B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{428E9964-527F-48D8-B88A-8A22435F481B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{428E9964-527F-48D8-B88A-8A22435F481B}.Emulator|Any CPU.ActiveCfg = Release|Any CPU
{428E9964-527F-48D8-B88A-8A22435F481B}.Emulator|Any CPU.Build.0 = Release|Any CPU
{428E9964-527F-48D8-B88A-8A22435F481B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{428E9964-527F-48D8-B88A-8A22435F481B}.Release|Any CPU.Build.0 = Release|Any CPU
{F0F2B76C-B9A5-4BA8-B551-5217295EF377}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0F2B76C-B9A5-4BA8-B551-5217295EF377}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0F2B76C-B9A5-4BA8-B551-5217295EF377}.Emulator|Any CPU.ActiveCfg = Release|Any CPU
{F0F2B76C-B9A5-4BA8-B551-5217295EF377}.Emulator|Any CPU.Build.0 = Release|Any CPU
{F0F2B76C-B9A5-4BA8-B551-5217295EF377}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0F2B76C-B9A5-4BA8-B551-5217295EF377}.Release|Any CPU.Build.0 = Release|Any CPU
{81D8D4B0-E62D-4F66-8E66-BC26616BDC9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{81D8D4B0-E62D-4F66-8E66-BC26616BDC9C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{81D8D4B0-E62D-4F66-8E66-BC26616BDC9C}.Emulator|Any CPU.ActiveCfg = Release|Any CPU
{81D8D4B0-E62D-4F66-8E66-BC26616BDC9C}.Emulator|Any CPU.Build.0 = Release|Any CPU
{81D8D4B0-E62D-4F66-8E66-BC26616BDC9C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{81D8D4B0-E62D-4F66-8E66-BC26616BDC9C}.Release|Any CPU.Build.0 = Release|Any CPU
{D02941EE-C27E-4422-AD5E-FE99C4B822CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D02941EE-C27E-4422-AD5E-FE99C4B822CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D02941EE-C27E-4422-AD5E-FE99C4B822CA}.Emulator|Any CPU.ActiveCfg = Emulator|Any CPU
{D02941EE-C27E-4422-AD5E-FE99C4B822CA}.Emulator|Any CPU.Build.0 = Emulator|Any CPU
{D02941EE-C27E-4422-AD5E-FE99C4B822CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D02941EE-C27E-4422-AD5E-FE99C4B822CA}.Release|Any CPU.Build.0 = Release|Any CPU
{A71793DB-2334-4922-9139-4CCEF2B3EE31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A71793DB-2334-4922-9139-4CCEF2B3EE31}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A71793DB-2334-4922-9139-4CCEF2B3EE31}.Emulator|Any CPU.ActiveCfg = Emulator|Any CPU
{A71793DB-2334-4922-9139-4CCEF2B3EE31}.Emulator|Any CPU.Build.0 = Emulator|Any CPU
{A71793DB-2334-4922-9139-4CCEF2B3EE31}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A71793DB-2334-4922-9139-4CCEF2B3EE31}.Release|Any CPU.Build.0 = Release|Any CPU
{71B2DDB7-063C-4866-BD82-83D06E22E225}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{71B2DDB7-063C-4866-BD82-83D06E22E225}.Debug|Any CPU.Build.0 = Debug|Any CPU
{71B2DDB7-063C-4866-BD82-83D06E22E225}.Emulator|Any CPU.ActiveCfg = Release|Any CPU
{71B2DDB7-063C-4866-BD82-83D06E22E225}.Emulator|Any CPU.Build.0 = Release|Any CPU
{71B2DDB7-063C-4866-BD82-83D06E22E225}.Release|Any CPU.ActiveCfg = Release|Any CPU
{71B2DDB7-063C-4866-BD82-83D06E22E225}.Release|Any CPU.Build.0 = Release|Any CPU
{58DB2B34-17A3-448D-A0B5-A5FEBEAC6F53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{58DB2B34-17A3-448D-A0B5-A5FEBEAC6F53}.Debug|Any CPU.Build.0 = Debug|Any CPU
{58DB2B34-17A3-448D-A0B5-A5FEBEAC6F53}.Emulator|Any CPU.ActiveCfg = Release|Any CPU
{58DB2B34-17A3-448D-A0B5-A5FEBEAC6F53}.Emulator|Any CPU.Build.0 = Release|Any CPU
{58DB2B34-17A3-448D-A0B5-A5FEBEAC6F53}.Emulator|Any CPU.Deploy.0 = Release|Any CPU
{58DB2B34-17A3-448D-A0B5-A5FEBEAC6F53}.Release|Any CPU.ActiveCfg = Release|Any CPU
{58DB2B34-17A3-448D-A0B5-A5FEBEAC6F53}.Release|Any CPU.Build.0 = Release|Any CPU
{58DB2B34-17A3-448D-A0B5-A5FEBEAC6F53}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
110 changes: 110 additions & 0 deletions ArduinoBridge/ArduinoBridge.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#include <dht11.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <Wire.h>
#include <SerialCommand.h>

//Declare objects
dht11 AirTempSensor;
SerialCommand sCmd;

//Settings for DHT11 Sensor
#define AIR_TEMP_PIN 2
//Setting for CO2 Sensor
#define MG_PIN (7) //define which analog input channel you are going to use
#define BOOL_PIN (3)
#define DC_GAIN (8.5) //define the DC gain of amplifier
#define READ_SAMPLE_INTERVAL (50) //define how many samples you are going to take in normal operation
#define READ_SAMPLE_TIMES (5) //define the time interval(in milisecond) between each samples in normal operation
#define ZERO_POINT_VOLTAGE (0.220) //define the output of the sensor in volts when the concentration of CO2 is 400PPM
#define REACTION_VOLTGAE (0.020) //define the voltage drop of the sensor when move the sensor from air into 1000ppm CO2
float CO2Curve[3] = {2.602,ZERO_POINT_VOLTAGE,(REACTION_VOLTGAE/(2.602-3))};
//two points are taken from the curve.
//with these two points, a line is formed which is
//"approximately equivalent" to the original curve.
//data format:{ x, y, slope}; point1: (lg400, 0.324), point2: (lg4000, 0.280)
//slope = ( reaction voltage ) / (log400 ¨Clog1000)

// Variable to store temperature and humidity readings
float air_temp_c;
float humidity;

void setup()
{
// Start the serial port to communicate to the PC at 115200 baud
Serial.begin(57600);
sCmd.addCommand("R", GetDHTReadings);
sCmd.addCommand("CO2",GetCO2Reading);

pinMode(BOOL_PIN, INPUT); //set pin to input
digitalWrite(BOOL_PIN, HIGH); //turn on pullup resistors

delay(1000);
}

void loop()
{
//Check for Serial Input
sCmd.readSerial();
}

void GetDHTReadings()
{
int chk = AirTempSensor.read(AIR_TEMP_PIN);
humidity = AirTempSensor.humidity;
air_temp_c = AirTempSensor.temperature;
Serial.print(air_temp_c);
Serial.print(",");
Serial.print(humidity);
Serial.print('\r');
}

void GetCO2Reading()
{
int percentage;
float volts;
volts = MGRead(MG_PIN);
//Serial.print( "SEN-00007:" );
//Serial.print(volts);
//Serial.print( "V " );

percentage = MGGetPercentage(volts,CO2Curve);
Serial.print(percentage);
Serial.print("\r");
}

/***************************** MGRead *********************************************
Input: mg_pin - analog channel
Output: output of SEN-000007
Remarks: This function reads the output of SEN-000007
************************************************************************************/
float MGRead(int mg_pin)
{
int i;
float v=0;

for (i=0;i<READ_SAMPLE_TIMES;i++) {
v += analogRead(mg_pin);
delay(READ_SAMPLE_INTERVAL);
}
v = (v/READ_SAMPLE_TIMES) *5/1024 ;
return v;
}

/***************************** MQGetPercentage **********************************
Input: volts - SEN-000007 output measured in volts
pcurve - pointer to the curve of the target gas
Output: ppm of the target gas
Remarks: By using the slope and a point of the line. The x(logarithmic value of ppm)
of the line could be derived if y(MG-811 output) is provided. As it is a
logarithmic coordinate, power of 10 is used to convert the result to non-logarithmic
value.
************************************************************************************/
int MGGetPercentage(float volts, float *pcurve)
{
if ((volts/DC_GAIN )>=ZERO_POINT_VOLTAGE) {
return -1;
} else {
return pow(10, ((volts/DC_GAIN)-pcurve[1])/pcurve[2]+pcurve[0]);
}
}
Loading