Project in progress
Beekeeping with Arduino

Beekeeping with Arduino © GPL3+

Beekeeping (or apiculture, from Latin: apis "bee") is the maintenance of honey bee colonies, commonly in hives, by humans.

  • 8,999 views
  • 2 comments
  • 32 respects

Components and supplies

Necessary tools and machines

dremel

About this project

Beekeeping (or apiculture, from Latin: apis "bee") is the maintenance of honey bee colonies, commonly in hives, by humans. A beekeeper (or apiarist) keeps bees in order to collect their honey and other products that the hive produces (including beeswax, propolis, pollen, and royal jelly), to pollinate crops, or to produce bees for sale to other beekeepers. A location where bees are kept is called an apiary or "bee yard".

Depictions of humans collecting honey from wild bees date to 15,000 years ago. Beekeeping in pottery vessels began about 9,000 years ago in North Africa.[2] Domestication is shown in Egyptian art from around 4,500 years ago. Simple hives and smoke were used and honey was stored in jars, some of which were found in the tombs of pharaohs such as Tutankhamun. It wasn't until the 18th century that European understanding of the colonies and biology of bees allowed the construction of the movable comb hive so that honey could be harvested without destroying the entire colony.

This is one of my hobbies. My job is electronic engineer so, I decided to automate the beekeeping process, sort of.

It very important when harvesting to have the right information like temperature, humidity, honey quality and weight chart, to make the decision to stay or move on to a different zone.

My system is based on Arduino.  Arduino board is connected to DHT humidity and temperature sensor, LCD display and HX711 amplifier with scale, reads the values and print it to the LCD display and to Serial port. Next step is to store the files in the cloud.

DHT sensor is used for outdoors and will be mounted outside the projects case. The load scale sensor is from a a weight scale, already has a frame, and will be mounted at the bottom of a beehive.

Next step is to setup the Arduino environment: https://www.arduino.cc/en/Main/Software

Install Arduino IDE and then install the libraries from the links below.

Connect your Arduino board and upload the sketch: ArduinoHive.ino located in the Git repository.

Connect DHT sensor to digital pin 10, LCD display to SCL and SDA, HX711 board to A1 and A0, button for reset scale to pin 11 and button for backlight on to digital pin 12.

All the extensions and sensors work on 3.3v, which is native Vin for MKR1000.

​Solder wires to the push buttons and 10k resistors as in the schematic attached.

Drill holes to the enclosure box and add the buttons, DHT sensor, Load scale cable and LCD Display.

Link to resources:

http://arduino-info.wikispaces.com/LCD-Blue-I2C

http://playground.arduino.cc/Main/DHT11Lib


I also glue the DHT sensor to the box and added an On/Off switch.

One of the push buttons is for lighting up the LCD backlight.

The other one is for setting the scale to 0 Kg.

The whole system will be located under this hive, once  the season starts.

Check out this:

Update 1:

New enclosure: wired everything to a piece of wood for better wire management:

To do: Azure integration

to be continued...

Code

ArduinoBeehive.inoC/C++
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#include <dht.h>
#include "HX711.h"
#include <SPI.h>
#include <WiFi101.h>


char ssid[] = "yourNetwork";      // your network SSID (name)
char pass[] = "secretPassword";   // your network password
int keyIndex = 0;                 // your network key Index number (needed only for WEP)

int status = WL_IDLE_STATUS;

WiFiServer server(80);

// HX711.DOUT	- pin #A1
// HX711.PD_SCK	- pin #A0

HX711 scale(A1, A0);	


#define DHT21_PIN 10

dht DHT;


int buttonState1 = 0;
const int But2 = 11; 
 
int buttonState = 0; 
const int But1 = 12; 

byte termometru[8] = {B00100, B01010, B01010, B01110, B01110, B11111, B11111, B01110};

byte picatura[8] = {B00100, B00100, B01010, B01010, B10001, B10001, B10001, B01110,};

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); 
 
void setup()
{	//Initialize serial and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  // 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 SSID: ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network. Change this line if using open or WEP network:
    status = WiFi.begin(ssid, pass);

    // wait 10 seconds for connection:
    delay(10000);
  }
  server.begin();
  // you're connected now, so print out the status:
  printWifiStatus();
	scale.set_scale(2280.f);         
	scale.tare();				     
	lcd.begin(20,2);
	lcd.backlight();
	lcd.clear(); 
	lcd.createChar(1,termometru);
	lcd.createChar(2,picatura);
	pinMode(But1, INPUT);
	pinMode(But2, INPUT);
	Serial.begin(19200); 
 }

void display()
{
  lcd.setCursor(2,0); 
  lcd.print(scale.get_units(20),1);  //does an average of 20 readings from scale and displays on the lcd
  lcd.setCursor(12, 0);
  lcd.print("Kg");  
 
  lcd.setCursor(0, 1);
  lcd.write(1); 
  lcd.setCursor(2,1); 
  lcd.print(DHT.temperature, 1); 
  lcd.setCursor(6, 1);
  lcd.print(" ");
  lcd.setCursor(7, 1);
  lcd.print((char)223); 
  lcd.print("C"); 
   
  lcd.setCursor(10, 1);
  lcd.write(2); 
  lcd.setCursor(12, 1);
  lcd.print(DHT.humidity, 1); 
  lcd.setCursor(14, 1);
  lcd.print(" "); 
  lcd.setCursor(15,1);
  lcd.print("%"); 
 } 
 
void wifi() { // listen for incoming clients
  WiFiClient client = server.available();
  if (client) {
    Serial.println("new client");
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        Serial.write(c);
        // if you've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so you can send a reply
        if (c == '\n' && currentLineIsBlank) {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println("Connection: close");  // the connection will be closed after completion of the response
          client.println("Refresh: 5");  // refresh the page automatically every 5 sec
          client.println();
          client.println("<!DOCTYPE HTML>");
          client.println("<html>");
          // output the value of each analog input pin
          for (int i = 0; i < 6; i++) {
			client.print("Weight: ");
			client.print(scale.get_units(20),1);
			client.println("kg");
			client.print("Humidity: ");
			client.print(DHT.humidity, 1);
			client.println("%");
			client.print("Temperature: ");			
			client.print(DHT.temperature, 1); 			
			client.println("Celsius");
          }
          client.println("</html>");
          break;
        }
        if (c == '\n') {
          // you're starting a new line
          currentLineIsBlank = true;
        }
        else if (c != '\r') {
          // you've gotten a character on the current line
          currentLineIsBlank = false;
        }
      }
    }
    // give the web browser time to receive the data
    delay(1);

    // close the connection:
    client.stop();
    Serial.println("client disonnected");
  }
}
 
void buton()
{
buttonState = digitalRead(But1);
     delay(10); 
    if (buttonState == HIGH) 
        { lcd.backlight(); }
        else {
        lcd.noBacklight(); 
        }}
		
void resetScale()
{
buttonState1 = digitalRead(But2);
     delay(10); 
    if (buttonState1 == HIGH) 
        {scale.tare();}
        else {
       
        }}

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");
}

		
void loop() 
{
	int chk = DHT.read21(DHT21_PIN);
	display(); 
	resetScale();
	buton();
	wifi();
	Serial.print("T: ");
	Serial.println(DHT.temperature));
	Serial.print("H: ");
	Serial.println(DHT.humidity);
	Serial.print("W: ");
	Serial.println(scale.get_units(20),1);
  
}

Schematics

schematic
Scale

Comments

Similar projects you might like

GPS Datalogger, Spatial Analysis, and Azure IoT Hub.

Project tutorial by Shawn Cruise

  • 16,938 views
  • 4 comments
  • 61 respects

Portable Arduino Temp/Humidity Sensor with LCD

Project tutorial by ThothLoki

  • 153,300 views
  • 115 comments
  • 185 respects

Reef Controller

Project showcase by Shawn Leclair

  • 13,939 views
  • 0 comments
  • 21 respects

Control Speed and Direction of Motor

Project in progress by ahmed soliman

  • 13,243 views
  • 3 comments
  • 19 respects

Weather Station for Drones

Project tutorial by Giuseppe Caccavale

  • 11,512 views
  • 4 comments
  • 35 respects

The Companion IC

Project tutorial by Srijal Poojari

  • 5,049 views
  • 11 comments
  • 27 respects
Add projectSign up / Login