Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Pizza Oven Temperature sensor ###
- ##OLED Fonts ### you will need to download the ttf font for the OLED display and place them in your esphome config dir e.g //homeassistants/config/esphome
- # slkscr.ttf - https://www.dafont.com/silkscreen.font
- # BebasNeue-Regular.ttf - https://www.dafont.com/bebas-neue.font
- # arial.ttf - https://www.dafont.com/bebas-neue.font?text=arial.ttf
- ## Parts used ###
- #£14.50 MakerHawk ESP32 Module OLED Display WiFi Development Board WIFI Kit 32 Low Power Consumption 240 MHZ Dual Core with CP2012 Chip 0.96inch Display ( https://www.amazon.co.uk/gp/product/B076P8GRWV/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1 )
- #£7.88 SNOWINSPRING 1 Set Max6675 Module + K Type Thermocouple Sensor Module for & 1Pcs K Type 50X5Mm 800C Probe Thermocouple ( https://www.amazon.co.uk/dp/B08HQ81MVH/ref=cm_sw_em_r_mt_dp_ZCKQDF06XT6TAQXFFYPH )
- ## Resources ##
- # https://resource.heltec.cn/download/WiFi_Kit_32/WIFI_Kit_32_pinoutDiagram_V2.pdf
- # https://esphome.io/components/sensor/max6675.html?highlight=max6675
- ## Wiring of the esp32 to the sensor ###
- # esp32 pin GND to max6675 gnd
- # esp32 pin 3.3v to max6675 vcc (104nf cap between vcc & gnd)
- # esp32 pin 2 (cs) to max6675 (CS)
- # esp32 pin 18 (SCK) to max6675 (SCK)
- # esp32 pin 19 (miso) to max6675 (SO)
- ## Thingiverse Files for Case
- # https://www.thingiverse.com/thing:4855762
- esphome:
- name: pizza_oven_sensor
- platform: ESP32
- board: heltec_wifi_kit_32
- wifi:
- networks:
- - ssid: !secret wifi_ssid # Home Wifi details
- password: !secret wifi_password
- - ssid: !secret wifi_ssid2 # Mobile Phone hotspot for when out of range of home wifi
- password: !secret wifi_password2
- - ssid: !secret wifi_ssid3 # TP-Link Wifi Extender
- password: !secret wifi_password3
- # Enable fallback hotspot (captive portal) in case wifi connection fails
- ap:
- ssid: "Pizza Oven Sensor"
- password: "YsP2eRCdRPPK"
- captive_portal:
- # Enable logging
- logger:
- # Enable Home Assistant API
- # api:
- # MQTT settings instead of using the normal api because the area I use the pizza oven has poor WiFi coverage so I can use my phone to connect to my MQTT from outside my LAN. If you don't have this problems (comment out this sections and uncomment out "api:"" if you have both you get repeated device restarts)
- mqtt:
- broker: !secret mqtt_broker
- username: !secret mqtt_username
- password: !secret mqtt_password
- discovery_retain: false
- ota:
- sensor:
- ### Wifi Signal Strength ####
- - platform: wifi_signal
- name: "Pizza Oven Sensor WiFi Signal"
- update_interval: 30s
- id: wifisignal
- ### current Thermocouple sensor ###
- - platform: max6675
- name: "Pizza Oven Temperature"
- accuracy_decimals: 0
- cs_pin: 2
- update_interval: 2s
- filters: # filter used to smooth out sensor data noise
- - sliding_window_moving_average:
- window_size: 10
- send_every: 10
- - calibrate_linear: # Map 0.0 (from sensor) to 0.0 (true value)
- # - 7.2 -> 0.0 # Iced water
- - 24 -> 20 # Room Temp
- - 103.0 -> 100 # Water @ Rolling Boil
- ### current Thermocouple sensor ###
- - platform: max6675
- name: "Pizza Oven Temperature Display"
- accuracy_decimals: 0
- cs_pin: 2
- update_interval: 1s
- id: thermocouple
- internal: true
- filters: # filter used to smooth out sensor data noise
- #- sliding_window_moving_average:
- # window_size: 10
- # send_every: 10
- - calibrate_linear: # Map 0.0 (from sensor) to 0.0 (true value)
- # - 7.2 -> 0.0 # Iced water
- - 24 -> 20 # Room Temp
- - 103.0 -> 100 # Water @ Rolling Boil
- ## Minimum Temp over 10mins
- - platform: max6675
- name: "Pizza Oven Temperature - Minimum"
- accuracy_decimals: 0
- cs_pin: 2
- update_interval: 20s
- id: thermocouple_min
- filters:
- - min:
- window_size: 60 ## min in 10 minutes (10mins*60seconds / Update interval 10s)
- send_every: 1
- - calibrate_linear: # Map 0.0 (from sensor) to 0.0 (true value)
- # - 7.2 -> 0.0 # Iced water
- - 24 -> 20 # Room Temp
- - 103.0 -> 100 # Water @ Rolling Boil
- ## Maximum Temp over 10mins
- - platform: max6675
- name: "Pizza Oven Temperature - Maximum"
- accuracy_decimals: 0
- cs_pin: 2
- update_interval: 20s
- id: thermocouple_max
- filters:
- - max:
- window_size: 60 ## max in 10 minutes (10mins*60seconds / Update interval 10s)
- send_every: 1
- - calibrate_linear: # Map 0.0 (from sensor) to 0.0 (true value)
- # - 7.2 -> 0.0 # Iced water
- - 24 -> 20 # Room Temp
- - 103.0 -> 100 # Water @ Rolling Boil
- spi:
- miso_pin: 19
- clk_pin: 18
- # add fonts for OLED Display
- font:
- - file: 'slkscr.ttf'
- id: font1
- size: 8
- - file: 'BebasNeue-Regular.ttf'
- id: font2
- size: 40
- - file: 'arial.ttf'
- id: font3
- size: 12
- - file: 'materialdesignicons-webfont.ttf'
- id: icon_font
- size: 20
- glyphs: [
- # Wifi signal strength icons
- '', # mdi-wifi-strength-outline
- '', # mdi-wifi-strength-1
- '', # mdi-wifi-strength-2
- '', # mdi-wifi-strength-3
- '', # mdi-wifi-strength-4
- ]
- ### OLED Setup ###
- i2c:
- sda: 4
- scl: 15
- display:
- - platform: ssd1306_i2c
- model: "SSD1306 128x64"
- reset_pin: 16
- address: 0x3C
- lambda: |-
- // Print Pizza Oven Temp (from thermocouple sensor)
- if (id(thermocouple).has_state()) {
- it.printf(128, 60, id(font2), TextAlign::BASELINE_RIGHT , "%.1f°C", id(thermocouple).state);
- }
- // Print Maximum temperature
- if (id(thermocouple_max).has_state()) {
- it.printf(127, 10, id(font3), TextAlign::TOP_RIGHT , "Max:%.0f°C", id(thermocouple_max).state);
- }
- // Print Minimum temperature
- if (id(thermocouple_min).has_state()) {
- it.printf(0, 10, id(font3), TextAlign::TOP_LEFT , "Min:%.0f°C", id(thermocouple_min).state);
- }
- // Draw the outline of a rectangle with the top left at [50,60], a width of 30 and a height of 42
- it.rectangle(0, 0, 128, 10);
- // Print "Pizza Oven Temp" in top center.
- it.printf(64, 1, id(font1), TextAlign::TOP_CENTER, "Pizza Oven Temperature");
- // WiFi signal strength icon
- int x, y;
- if(id(wifisignal).has_state()) {
- // Set location of Wifi Signal Icon
- x = 0, y = 44;
- if (id(wifisignal).state >= -50) {
- //Excellent
- it.print(x, y, id(icon_font), "");
- } else if (id(wifisignal).state >= -60) {
- //Good
- it.print(x, y, id(icon_font), "");
- } else if (id(wifisignal).state >= -67) {
- //Fair
- it.print(x, y, id(icon_font), "");
- } else if (id(wifisignal).state >= -70) {
- // Weak
- it.print(x, y, id(icon_font), "");
- } else {
- // Unlikely
- it.print(x, y, id(icon_font), "");
- }
- }
Add Comment
Please, Sign In to add comment