Page 5 of 5

Re: Recommendations for a greenhouse electric heater please

Posted: Wed Feb 14, 2018 4:30 pm
by habanerocat
I think mounting the electrics inside or outside the greenhouse are both an option. It looks like a fairly sheltered location. I would just add that if your bringing a lighter non-armoured cable in through the metal frame of the greenhouse, then make sure the greenhouse frame is earthed.

Best solution would of course be the weather proof socked mounted inside the greenhouse, up off the ground and away from water spills.

Re: Recommendations for a greenhouse electric heater please

Posted: Thu Feb 15, 2018 10:48 am
by FaeLLe
A bit of sun came out today and see how HOT it has got already!!!

I noticed that there are some gaps on the top of the installation between the glass panes, is that how it is meant to be?
IMG_3879.JPG
IMG_3879.JPG (57.29 KiB) Viewed 2157 times

Re: Recommendations for a greenhouse electric heater please

Posted: Thu Feb 15, 2018 1:23 pm
by ralphrmartin
Here's the temperature variation in my greenhouse today (recorded using a gizmo I built for under a tenner, and that sends the plot to my phone :grin: )
Screenshot_20180215-131730.jpg

Re: Recommendations for a greenhouse electric heater please

Posted: Thu Mar 01, 2018 10:06 am
by SteveMcG
Hi Ralph

As I have no space at home for a gh mine is a mile away from home. Your temp gizmo to phone would be perfect for my situation - could I trouble you for details?

Regards

Steve

Re: Recommendations for a greenhouse electric heater please

Posted: Thu Mar 01, 2018 12:39 pm
by FaeLLe
SteveMcG wrote:Hi Ralph

As I have no space at home for a gh mine is a mile away from home. Your temp gizmo to phone would be perfect for my situation - could I trouble you for details?

Regards

Steve
I requested the same.... I was writing up a Google image recognition API and was going to use a cheap raspberry Pi looking at my weather monitor display to make a phone call to me! But Ralph's idea looks amazing.

Re: Recommendations for a greenhouse electric heater please

Posted: Thu Mar 01, 2018 2:42 pm
by ralphrmartin
I'll give an outline of what I did here. It assumes you already have WiFi available in the greenhouse.

I bought
- an ESP8266 development board (e.g. a NodeMCU)
- a BME280 breakout board
- a 5V 2A micro USB power supply as used for phones etc.

I downloaded the Arduino IDE, and followed the instructions to install the ESP8266 core for it (so it can be used for writing programs for the ESP8266).
I also downloaded the BME280 library for Arduino.

I downloaded the Bkynk app for my Android phone (I think there's one for iPhones too).

I wrote a program for the ESP8266 which essentially reads the temperature / pressure / humidity at set intervals from the BME280, and sends the values to Blynk virtual pins.

I used Blynk's interface builder to generate the interface shown, and wired it up to the virtual pins.

That's a very basic summary, which I don't expect to be much use to anyone other than someone already familiar with Arduino's and the like. However, I will give the Arduino program listing in the next posting...

Re: Recommendations for a greenhouse electric heater please

Posted: Thu Mar 01, 2018 3:04 pm
by ralphrmartin
Actually, I used a Wemos D1 board rather than a NodeMCU.
You need the Wire library as well as the BME280 library.
You also need the Blynk library for Arduino.
The BME280 module is connected by I2C to the ESP8266. Connect sda of BME module to D2 pin of Wemos and connect scl of BME module to D1pin of wemos. Also connect the power pins for the BME module to the power output pins of the Wemos D1.

After programming the Wemos D1 using the Arduino IDE, just power it up using the power supply via microUSB port, and it should start talking to the Blynk server.

The Serial.print stuff is just there for debugging and troubleshooting, and isn't really needed.

You need your own authorisation token for use with Blynk - see the Blynk documentation.

Code: Select all

// Configured for Wemos D1 r1 (original Wemos D1 Board)

#define BLYNK_PRINT Serial

#define RED   "#FF0000"
#define GREEN "#00FF00"
#define BLUE  "#0000FF"

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <BME280I2C.h>
#include <Wire.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "your-auth-token-here";

char ssid[] = "your-wifi-ssid here";
char pass[] = "your-wifi-password-here";

int resetLimits = 0; // flag to say if limits need to be reset

BME280I2C bme;    // Default : forced mode, standby time = 1000 ms
                              // Oversampling = pressure ×1, temperature ×1, humidity ×1, filter off,

BME280::TempUnit tempUnit(BME280::TempUnit_Celsius);
BME280::PresUnit presUnit(BME280::PresUnit_hPa);

BlynkTimer timer;
WidgetLED led(V10);

float t, tmin, tmax, h, hmin, hmax, p;

BLYNK_WRITE(V0) {  resetLimits = 1;        } // Button to reset limits
BLYNK_WRITE(V1) {  hmin = param.asFloat(); } // For data coming from server
BLYNK_WRITE(V2) {  hmax = param.asFloat(); }
BLYNK_WRITE(V3) {  tmin = param.asFloat(); }
BLYNK_WRITE(V4) {  tmax = param.asFloat(); }

void sendSensor()
{
  bme.read(p, t, h, tempUnit, presUnit);
  
  if (isnan(p) || isnan(t) || isnan(h)) {
    Serial.println("Failed to read from  sensor!");
    led.setColor(RED);
    return;
  }
  
  led.setColor(GREEN);
  
  Blynk.virtualWrite(V5, h);
  Blynk.virtualWrite(V6, t);
  Blynk.virtualWrite(V9, p); 

  if(h<hmin || isnan(hmin) || resetLimits == 1) { hmin=h; Blynk.virtualWrite(V1, h); }
  if(h>hmax || isnan(hmax) || resetLimits == 1) { hmax=h; Blynk.virtualWrite(V2, h); }
  if(t<tmin || isnan(tmin) || resetLimits == 1) { tmin=t; Blynk.virtualWrite(V3, t); }
  if(t>tmax || isnan(tmax) || resetLimits == 1) { tmax=t; Blynk.virtualWrite(V4, t); }

  resetLimits = 0; // clear any request to reset limits
}

void setup()
{
  // Debug console
  Serial.begin(115200);

  Serial.println("Restarted");

  Blynk.begin(auth, ssid, pass);

  led.on();
  led.setColor(BLUE);

  Wire.begin(D4, D3);                          //  sda = 4 = D2, scl= 5 = D1
  while(!bme.begin())
  {
    Serial.println("Could not find BME280 sensor!");
    delay(1000);
  }
  switch(bme.chipModel())
  {
     case BME280::ChipModel_BME280:
       Serial.println("Found BME280 sensor! Success.");
       led.setColor(GREEN);
       break;
     case BME280::ChipModel_BMP280:
       Serial.println("Found BMP280 sensor! No Humidity available.");
       break;
     default:
       Serial.println("Found UNKNOWN sensor! Error!");
       led.setColor(RED);
  }

  Blynk.syncVirtual(V1,V2,V3,V4);            // Get old limits from server
  
  timer.setInterval(10L * 1000L, sendSensor); // Set timer to send data every 10 s
}

void loop()
{
  Blynk.run();
  timer.run();
}


Re: Recommendations for a greenhouse electric heater please

Posted: Thu Mar 01, 2018 7:18 pm
by SteveMcG
Hi Ralph

Wow - top job, quite a project. I will definitely have a go at this and thanks so much for sharing. I could give it to one of my students to sort if I was lazy! I tend to veer away from programing so much appreciated that you added that too.

Result of the day is I found a nearly new Bio Green Phoenix heater for a tad over £100. Perfect as my greenhouse is waiting for me to assemble it. I got the slab down before the cold spell. The heater will be perfect in the workshop when I build the staging...

Thanks again Ralph

Steve

Re: Recommendations for a greenhouse electric heater please

Posted: Thu Mar 01, 2018 7:34 pm
by ralphrmartin
If you need further explanation, just ask. I'm happy to share.