DEV Community

Der Sascha
Der Sascha

Posted on • Originally published at blog.bajonczak.com on

Heating Up Innovation: Beekeeper's Guide to get Honey fluent

I am a Beekeeper, so this is my secret identity. Darknet Beekeeper programmer ;). So everyone loves honey.... except me. Don't ask... let's focus on the problem.

In my family they love honey, but only the fluent one, not the nutella-like one. So There is one trick. The Honey must be heated but not above 40°C. So I can use a complex circuit to control a heating fan or I can but it every few weeks into the oven for 30°c (yep, that is enough) to melt the honey. But hey I am an IT Guy and hey I have some parts in my shelf. So let's put some things together.

The parts

First, I must find a case to store the Glas of honey, for this, I use a box called "apidea" which can be bought for a few bucks at a special beekeeper store or on Amazon like this https://amzn.to/3ToxcDv.

Also, we need a temperature sensor, for this, I use the DSB like this. I use these because it contains a capsule so that moisture does not affect any error measures.

Next, we need a WemosD1 Mini, that will be used as a control unit. It does not have any special requirements you can also use another ESP device but for now, I use the Wemos D1 like this.

So the next question is, how I can warm up the "chamber" in the apidea? For this I use a Peltier element.

The Peltierelement

A Peltier element, or thermoelectric cooler, operates on a fascinating principle called the Peltier effect. Imagine a small, flat device consisting of two different semiconductor materials joined together. When a direct electric current is passed through this device, something remarkable happens.

Senior Project: Peltier Effect Water Condenser: A Self-Regulating Water ...

At the junction where these two materials meet, heat is either absorbed or released. It's like a miniature heat pump: when the electric current flows in one direction, heat is absorbed at one side (which we call the cooling side) while simultaneously, an equal amount of heat is released at the other side (the heating side). Now, if we reverse the direction of the electric current, the heat absorption and release process also reverse.

In essence, the Peltier element offers a compact, solid-state solution for managing temperature, this will be perfect for the current project to heat up the chamber to the required temperature.

The voltage dilemma

You can run the component with the 3.3 Volt from a GPIO. But that is not enough and the element will not become hot enough. So you must use the 5 v pin from the wemos. But you cannot activate or deactivate this bin, for this you must use a transistor circuit to control the heating. Because when you heat the complete time it will get too hot inside the chamber. I use the transistor S8050 that can be ordered here.

The Wiring

The wiring is simple like this below:

The Peltier element will be connected with the S8050 transistor. The transistor ermitter itself we connect to the GPIO 1 pin from the wemos.

The Temperatur sensor will connect the data line to the GPIO 2Pin. The rest will be wired up to the power and ground. So this will be all wiring for this. Finally we connected the DSB Sensor and the Peltier element to the wemos.

Why a temperature sensor?

So you may ask, why do I use a temperature sensor? So the Peltier element heats up to maybe 50-80° so to control the heat, I must measure it continuously to get the heat at about 35°.

The code

Instead of writing C or arduino code for this, I will use ESP Home instead. This contains several predefined components to reuse for example the DSB sensor. To use the dsb sensor I will use this code

sensor:
  - platform: dallas
    id: tempsensor
    address: XXXXXXXXXXXXXXXXXX
    name: "Temperature"
    accuracy_decimals: 2
    unit_of_measurement: °C
    on_value_range:
      - below: 34.0
        then:
          - switch.turn_on: pletier
      - above: 35.0
        then:
          - switch.turn_off: pletier  

dallas:
  - pin: D6
    update_interval: 5s
Enter fullscreen mode Exit fullscreen mode

Please pay attention to the address, this must be replaced with the desired address from the dsb sensor. You will get it when you log in to the debug log of the esphome.

The definition will tell the sensor to measure every 5 seconds the temperature. If the temperature is below 34° it will turn on the Peltier element. When it is above 35° it will turn the Peltier off again.

The Peltier will be defined below

switch:
  - platform: gpio
    id: pletier
    pin: D1
    name: "Heizung"
Enter fullscreen mode Exit fullscreen mode

This will control the transistor at the GPIO 1 pin and together with the constraints above in the temperature sensor, it will be controlled with this.

Behaviour at startup

When the device boots up, it will do nothing at first. So to prevent faulty heating I hook me into the bootup like this

esphome:
  name: honigschrank
  friendly_name: Honigschrank
  on_boot:
    then:
      - if:
          condition:
            sensor.in_range:
              id: tempsensor
              below: 34.0
          then:
            - switch.turn_on: pletier
          else:
            - switch.turn_off: pletier
Enter fullscreen mode Exit fullscreen mode

You will see that I use the same logic as in the temperature sensor.

So you want a copy paste like code? Here it is

esphome:
  name: honigschrank
  friendly_name: Honigschrank
  on_boot:
    then:
      - if:
          condition:
            sensor.in_range:
              id: tempsensor
              below: 32.0
          then:
            - switch.turn_on: pletier
          else:
            - switch.turn_off: pletier

esp8266:
  board: d1_mini

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "XXXXXXXXXXXXXXXXXXXXXX"

ota:
  password: "XXXXXXXXXXXXXXXXXXXXXXXXXXX"

wifi:
  fast_connect: true
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: 192.168.178.180
    gateway: 192.168.178.1
    subnet: 255.255.255.0
    dns1: 192.168.178.1
  ap:
    ssid: "Honigschrank"
    password: "1234567890"

captive_portal:    
sensor:
  - platform: dallas
    id: tempsensor
    address: 0xa401143bade7aa28
    name: "Temperature"
    accuracy_decimals: 2
    unit_of_measurement: °C
    on_value_range:
      - below: 34.0
        then:
          - switch.turn_on: pletier
      - above: 35.0
        then:
          - switch.turn_off: pletier  

switch:
  - platform: gpio
    id: pletier
    pin: D1
    name: "Heizung"

dallas:
  - pin: D6
    update_interval: 5s

Enter fullscreen mode Exit fullscreen mode

The device in Action

So after I wired it all up, and flashed the firmware onto the device I put all it into the apidea box. This looks now like this

You will see on the right site the Peltier element, and on the left site the temperature sensor. The apidea contains a second smaller champer (normally for food) so I put in there the wemos d1 mini. After booting it up and waiting for a half hour I looked at the temperature diagram that homeassistant would record for me

Great! So now i have a small heater for my honey jar that keeps my honey fluent :).

Other question. Can it cool down also?

Short answer? Yes! Because the Peltier element is on one side hot and on another side cool... very cool. So Just turn it around and you can cool the chamber down. But you must get the heat out of the chamber.

One solution is to take away the heat with a heat pipe like this. For this, you put the pipe onto the hot site and the heat will be moved out of the chamber. Of course, you must put the end of the heat pipe out of the chamber. Additional you can add a fan to move away the heat.

For example, it can look like this other project that I built in the past that will give you the imagination on how it looks like

Peltier - Number One Website Portrait Gallery

Conclusion

I know this is a very high amount of work, so the solution can be done by heating it up in a pot. But I wanted to use this to educate me. So in fact heating, it is possible to cool the entire chamber. So in fact you build a small fridge for a can or s.th. else. Just turn around the peltier and try to add a heatpipe to the hot side, because the other side is cool... very cool. So it will work when you get the heat out of the chamber.

I hope you like this post, please leave a comment if you have suggestions.

Top comments (0)