esp32-warm-water
esp32 based project for the control of a heating element based on temperature
|
main entrypoint for the warm-water project More...
#include <stdio.h>
#include <stdbool.h>
#include "sdkconfig.h"
#include "led.h"
#include "wifi_sta.h"
#include "wifi_sap.h"
#include "utility.h"
#include "ds18b20_wrapper.h"
#include "timer.h"
#include "ssd1306.h"
#include "symbols.h"
#include "esp_log.h"
#include "control.h"
#include "spiffs.h"
#include "webserver.h"
Go to the source code of this file.
Functions | |
void | update_display (void) |
void | relay_on (void) |
void | relay_off (void) |
void | check_system_handler (void *arg) |
void | check_relay (float average_temp) |
void | app_deinit (void) |
void | app_main (void) |
Variables | |
char | ip_address [16] |
volatile float | goal = CONFIG_INITIAL_GOAL_TEMP |
goal temp for the system to aim for More... | |
volatile float | temp = 0.0f |
current temp More... | |
volatile float | under = 0.5f |
margin below goal temp at which to turn relay on More... | |
volatile float | over = 0.5f |
margin above goal temp at which to turn relay off More... | |
volatile bool | heating = false |
whether or not the system should be outputing a signal to enable the relay (note: could be used to control pump as well) More... | |
int | num_sensors = 0 |
the number of sensors ds18b20 init has found (initially 0) More... | |
esp_timer_handle_t | periodic_check_timer |
variable to control the timer associated with running the temperature polling to check system More... | |
SSD1306_t | dev |
device for oled More... | |
main entrypoint for the warm-water project
esp-idf warm-water project.
employs wifi, onewire and a relay to control the temperature of a body of water for the purpose of film development primarily. other uses include cooking and general chemistry.
the main motivation to do this project was to be able to better process c41 colour film.
Definition in file main.c.
void app_deinit | ( | void | ) |
free resources and ensure safe shutdown of app
< cleanup timer associated with checking temp and relay
< relay off and deinit gpio
< deallocate owb and ds18b20
< deallocate i2c and ssd1306
< wifi off and deinit
< disable spiffs
Definition at line 177 of file main.c.
void app_main | ( | void | ) |
void check_relay | ( | float | average_temp | ) |
void check_system_handler | ( | void * | arg | ) |
polls the ds18b20 sensor for it's latest temperatures and checks what range we are in with respect to the goal and sets the output to the relay accordingly
arg | void pointer mainly because that's the fingerprint that the isr expects. a void pointer holds some address to an unknown type. read more at: https://www.geeksforgeeks.org/void-pointer-c-cpp/ |
< create correctly sized float array for the sensor data
< average temp across sensors (for now =results[0] until we have averaging is implemented)
Definition at line 134 of file main.c.
void relay_off | ( | void | ) |
void relay_on | ( | void | ) |
void update_display | ( | void | ) |
volatile float goal = CONFIG_INITIAL_GOAL_TEMP |
volatile bool heating = false |
int num_sensors = 0 |
volatile float over = 0.5f |
esp_timer_handle_t periodic_check_timer |