Can anyone suggest a source for MicroPython code for thermostatic control using an Arduino Nano RP2040 Connect?
The initial application is On/Off cooling control to drive 3.3v relays of ANC GPIO’s. Code for an adjustable deadband of 0.6C or greater would be helpful.
UI at this point can be via Thonny or equivalent. Thoughts and/or code for UI on a phone or laptop would be appreciated.
No modulating / PID control. Heating or heating / cooling control also welcome.
Any thoughts on starting points?
The RP2040 Connect seems like overkill for this project. It has a whole bunch of sensors and other features that are not relevant to this project. An ESP-01 would give you all the features you need at a fraction of the cost!
There’s a tutorial here or here about using a Pi and temperature sensor to display data or control a switch. I am sure there are many others (you should always look at several to get an idea of who knows what they are talking about and who is just collecting random information from other sources). The code to implement an adjustable deadband (‘hysterisis’) is not complex. You have to keep track of the current state of the relay. If it’s off then compare the temperature to the higher value to decide if it needs to be on. If it’s on, compare it to the lower value to decide if it should be off.
There are many examples available of how to connect a WiFi-enabled device such as a Pi or an ESP to your local LAN and interact through a phone or PC. That is the sort of functionality that can be added after the basic control system is in place.
I think ESP will be an easier. andreabak/ESPTherm can be used. It is a Smart thermostat and climate monitoring IOT ecosystem, built using ESP8266 devices, MicroPython and Flask.
There are quite a few other objectives with this prototype and the RP2040. Hence many of the features and capabilities will be well used. However, I want to progress one part at a time. Thermostatic control is a fundamental part.
As the Nano Connect rp2040 is a distinctly different board that the RPI, I’m hoping to find resources more specific to it or the Raspberry Pi Pico / Pico W. Any thoughts along those lines?
Wifi & internet functionality has been implemented on the MCU and works OK so far.