My Friends,
As a side project, I am going to put together a MCU Controlled Aeroponics Growing System, just simple for a start.
Aeroponics Stats:
- Chamber is kept at temperatures between 16.7C or 62F to 21.7C or 71F with good stability.
- The Misting, three to five seconds every 5 minutes, or less than 5 seconds on every 4-5 minutes.
- PH and EC (Electrical Conductivity) Control.
- Nutrient mix in the Water that gets sprayed. Recommended replaced every 2 - 3 weeks.
Parts include:
Parts are inexpensive and its a project that just might be able to feed my family cheaply and efficiently with the freshest food possible.
Arduino or Wemos Mega +WiFi R3 Module:
I like the Arduino rebranded stuff. Its cheap and full of features. This has inbuilt WiFi and will be wireless to my network.
Here is some nice code online to get the wireless working, I have slightly modified it: medium.com
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Header:
#include "WiFiEsp.h"
#ifndef HAVE_HWSERIAL3
#endif
char ssid[] = "SSID"; // your network SSID (name)
char pass[] = "password"; // your network password
int status = WL_IDLE_STATUS; // the Wifi radio's status
char server[] = "myserver";
const String URI PROGMEM = "/api/exee/UpdatePowerConsumption";
// Initialize the Ethernet client object
WiFiEspClient client;
int amps;
// Setup:
void setup()
{
// initialize serial for debugging
Serial.begin(115200);
// initialize serial for ESP module
Serial3.begin(115200);
// initialize ESP module
WiFi.init(&Serial3);
// check for the presence of the shield
if (WiFi.status() == WL_NO_SHIELD) {
Serial.println("WiFi shield not present");
// don't continue
while (true);
}
// attempt to connect to WiFi network
while ( status != WL_CONNECTED) {
Serial.print("Attempting to connect to WPA SSID: ");
Serial.println(ssid);
// Connect to WPA/WPA2 network
status = WiFi.begin(ssid, pass);
}
// you're connected now, so print out the data
Serial.println("You're connected to the network");
printWifiStatus();
Serial.println();
Serial.println("Starting connection to server...");
amps = analogRead(A0);
String tempData = "";
tempData.concat("{\"AccessToken\" : \"");
tempData.concat("AccessToken");
tempData.concat("\",\"LocationCode\" : \"");
tempData.concat("L001");
tempData.concat("\",\"TotalConsumption\" :\"");
tempData.concat(amps);
tempData.concat("\"}");
Serial.println(tempData);
if (client.connect(server, 80)) {
Serial.println(F("con..."));
// send the HTTP GET request:
client.println("POST " + URI + " HTTP/1.1");
client.println("Host: " + String(server));
client.println("Content-Type: application/json");
client.print("Content-Length: ");
client.println(tempData.length());
client.println();
client.println(tempData);
// note the time that the connection was made:
} else {
// if you couldn't make a connection:
Serial.println(F("con failed"));
}
}
// Main Loop:
void loop()
{
// if there are incoming bytes available
// from the server, read them and print them
while (client.available()) {
char c = client.read();
Serial.write(c);
}
// if the server's disconnected, stop the client
if (!client.connected()) {
Serial.println();
Serial.println("Disconnecting from server...");
client.stop();
// do nothing forevermore
while (true);
}
}
// Print WiFi Status:
void printWifiStatus()
{
// print the SSID of the network you're attached to
Serial.print("SSID: ");
Serial.println(WiFi.SSID());
// print your WiFi shield's IP address
IPAddress ip = WiFi.localIP();
Serial.print("IP Address: ");
Serial.println(ip);
// print the received signal strength
long rssi = WiFi.RSSI();
Serial.print("Signal strength (RSSI):");
Serial.print(rssi);
Serial.println(" dBm");
}
Tons of cool libraries and code samples online if you want to look around. I hope to have more soon.
GY-BMP280-3.3 High Precision Atmospheric Pressure Sensor Module:
I want to measure the Atmospheric pressure also, its a simple cheap sensor that may hep give results.
This example requires: https://github.com/adafruit/Adafruit_BMP280_Library and https://github.com/adafruit/Adafruit_Sensor
The following code example is from: arduinolearning.com/ or best-microcontroller-projects.com
/***************************************************************************
This is a library for the BMP280 humidity, temperature & pressure sensor
Designed specifically to work with the Adafruit BMEP280 Breakout
----> http://www.adafruit.com/products/2651
These sensors use I2C or SPI to communicate, 2 or 4 pins are required
to interface.
Adafruit invests time and resources providing this open source code,
please support Adafruit andopen-source hardware by purchasing products
from Adafruit!
Written by Limor Fried & Kevin Townsend for Adafruit Industries.
BSD license, all text above must be included in any redistribution
***************************************************************************/
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP280.h>
#define BMP_SCK 13
#define BMP_MISO 12
#define BMP_MOSI 11
#define BMP_CS 10
Adafruit_BMP280 bme; // I2C
//Adafruit_BMP280 bme(BMP_CS); // hardware SPI
//Adafruit_BMP280 bme(BMP_CS, BMP_MOSI, BMP_MISO, BMP_SCK);
void setup() {
Serial.begin(9600);
Serial.println(F("BMP280 test"));
if (!bme.begin()) {
Serial.println("Could not find a valid BMP280 sensor, check wiring!");
while (1);
}
}
void loop() {
Serial.print("Temperature = ");
Serial.print(bme.readTemperature());
Serial.println(" *C");
Serial.print("Pressure = ");
Serial.print(bme.readPressure());
Serial.println(" Pa");
Serial.print("Approx altitude = ");
Serial.print(bme.readAltitude(1013.25)); // this should be adjusted to your local forcase
Serial.println(" m");
Serial.println();
delay(2000);
}
CJMCU-1080 HDC1080 High Precision Temperature And Humidity Sensor:
This Temperature and Humidity Sensor is to measure the Enclosure, Green House, Air Temperature and Humidity. Its a reasonably expensive sensor, but does a fine job for its price.
You will need to download the following library and install it from https://github.com/closedcube/ClosedCube_HDC1080_Arduino
The Texas Instruments website gives code examples, but this example is from: arduinolearning.com
#include <Wire.h>
#include "ClosedCube_HDC1080.h"
ClosedCube_HDC1080 hdc1080;
void setup()
{
Serial.begin(9600);
Serial.println("ClosedCube HDC1080 Arduino Test");
// Default settings:
// - Heater off
// - 14 bit Temperature and Humidity Measurement Resolutions
hdc1080.begin(0x40);
Serial.print("Manufacturer ID=0x");
Serial.println(hdc1080.readManufacturerId(), HEX); // 0x5449 ID of Texas Instruments
Serial.print("Device ID=0x");
Serial.println(hdc1080.readDeviceId(), HEX); // 0x1050 ID of the device
printSerialNumber();
}
void loop()
{
Serial.print("T=");
Serial.print(hdc1080.readTemperature());
Serial.print("C, RH=");
Serial.print(hdc1080.readHumidity());
Serial.println("%");
delay(3000);
}
void printSerialNumber() {
Serial.print("Device Serial Number=");
HDC1080_SerialNumber sernum = hdc1080.readSerialNumber();
char format[12];
sprintf(format, "%02X-%04X-%04X", sernum.serialFirst, sernum.serialMid, sernum.serialLast);
Serial.println(format);
}
DS18B20 Temperature Sensor:
This Temperature Sensor is for the Water Temperature. This will be the Water in the tank.
The code example here: randomnerdtutorials.com
/*********
Rui Santos
Complete project details at https://randomnerdtutorials.com
Based on the Dallas Temperature Library example
*********/
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is conntec to the Arduino digital pin 4
#define ONE_WIRE_BUS 4
// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature sensor
DallasTemperature sensors(&oneWire);
void setup(void)
{
// Start serial communication for debugging purposes
Serial.begin(9600);
// Start up the library
sensors.begin();
}
void loop(void){
// Call sensors.requestTemperatures() to issue a global temperature and Requests to all devices on the bus
sensors.requestTemperatures();
Serial.print("Celsius temperature: ");
// Why "byIndex"? You can have more than one IC on the same bus. 0 refers to the first IC on the wire
Serial.print(sensors.getTempCByIndex(0));
Serial.print(" - Fahrenheit temperature: ");
Serial.println(sensors.getTempFByIndex(0));
delay(1000);
}
0.96 Inch 4Pin Blue Yellow IIC I2C OLED Display Module:
The net is filled with code examples: create.arduino.cc
//www.diyusthad.com
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(128, 64, &Wire, OLED_RESET);
//Paste your bitmap here
void setup(){
display.begin(SSD1306_SWITCHCAPVCC, 0x3D); //or 0x3C
display.clearDisplay(); //for Clearing the display
display.drawBitmap(0, 0, myBitmap, 128, 64, WHITE); // display.drawBitmap(x position, y position, bitmap data, bitmap width, bitmap height, color)
display.display();
}
void loop() { }
I have not yet purchased a Pump or Aeroponic Housings. I am still researching these items. Perhaps a baby version of this might be a good start:
Our little CopyCat friends have just opened a thread, almost the same as the Growing Threads here. I don't care, they could try to be original however!
Sustainability and knowing your Garden just might be a very important thing in the near future!
Of course, with Aboveunity Energy System, these Aeroponics Systems are possible on a large scale underground! All you need do, is learn and build them as we have.
Best wishes, Stay safe and well My Friends,
Chris