Custom firmware specification
If you ordered your smart controller without any firmware, this page will detail everything you need to flash your own. Note that you need to tell us you want to flash your own firmware before ordering, otherwise the ESP will be placed in release mode and you will not be able to overwrite the flash storage.
Connecting over UART
The smart controller contains a ESP-C3 with 4MB of flash. To talk to the ESP you can use the on-board UART lines with any cheap TTL to USB converter. The UART lines must be pulled up to 3,3v and NOT 5v
Connect the RX on the UART header to the converters TX, and do the same for the boards TX and the converters RX. You can either power the board directly over the 3v3 pin, or supply the normal 12v to the screw terminals.
The calibration button on the board also doubles as the boot mode selector. If you keep it pressed while connecting power to the board the ESP will be placed in download mode and you should be able to use ESP-IDF to flash it.
General operation
The board connects to the fan by turning the right optocoupler on for a short time and then turning it off again. Simply pull the line high for 100 to 200ms, simulating a button press, and then ground it again. Keeping a optocoupler active completely blocks any further input to the fan by any means, so be sure to release it. There are 6 functions supported, see the table below.
There is also one special optocoupler that is connected in reverse and it turned on by the fan whenever it is in automatic temperature mode. This operates in reverse. The line is high if the fan is NOT in auto mode, and gets pulled low if it is.
The two LEDs are also mounted in reverse, because they are connected to strapping pins that must be high on boot. To switch these on, set the pins to low to sink current through the pins. Setting the LED pins to high will turn them off.
Finally, there is an INA226 on board that can sense the voltage going to the fan and how many amps it is pulling. It is connected over the I2C bus, and also has an alert pin connected. Please read its datasheet for more details.
Pinout
| GPIO | Direction | Name | Description |
|---|---|---|---|
| 0 | OUT | IN/OUT | Fan direction button |
| 1 | OUT | AUTOHOLD | Fan automatic temperature button |
| 2 | IN | RED LED | LED, labeled command |
| 3 | OUT | ON/OFF | Fan power button |
| 4 | OUT | FASTER | Fan speed up button |
| 5 | OUT | BEEP | Makes fan beep |
| 6 | OUT | SLOWER | Fan slow down button |
| 7 | IN | AUTO STATUS | Auto temperature mode status, low = on. |
| 8 | IN | GREEN LED | LED, labeled connected |
| 9 | IN | CALIB BUTTON | Calibration button, also selects boot mode |
| 10 | IN | ALERT | INA226 alert interrupt |
| 11-17 | IDK | FLASH | Internal storage, do not use |
| 18 | I/O | SDA | I2C data for INA226 |
| 19 | OUT | SCL | I2C clock for INA226 |
| 20 | IN | UART RX | Debug/flash serial, can be reused |
| 21 | OUT | UART TX | Debug/flash serial, can be reused |