Code und Anleitung um die Ventilatoren der Türme zu steuern.
Jeder Ventilator erhält eine Steuereinheit bestehend aus einem Microcontroller (aktuell ESP32) und einer H-Brücke die hohe Ströme stand hält (BTS7960). Die Microcontroller nehmen Befehle einer Anwendung entgegen und steuern den jeweiligen Ventilator an.
Die Microcrontroller können zurzeit mit einem WiFi verbunden und mit dem OSC-Protokoll angesprochen werden.
- Clone Repository
- Open directory with VS Code
- Install PlatformIO
- Optional: Install USB driver for microcontroller
Each fan controller (left_board, right_board, center_board) requires another environment. See include/settings.h for more info.
- Select the desired environment (ctrl+shift+p -> PlatformIO: Pick Project Environment)
- Connect the Microcontroller via USB in Download/Flash Mode
- Build & Upload (ctrl+shift+p -> PlatformIO: Build)
The Host board for the microcontroller converts 12V input voltage to 5V for the ESP32-board. Additionally it converts the 3.3V GPIO signal to 5V which is required by the h-bridge.
Left: Top view. Host Board with mounting for an ESP32 Dev Kit. Level Shifter under the MIcrocontroller to convert 3.3V GPIO out to 5V required by the H-bridge. Power input and regulator on the right side to convert 12V input voltage to 5V to power the ESP32 power input.Right: Bottom view. Mounting for the H-bridge.
Control the fans. Power connection for the host board soldered to the clamps for the input voltage
Left: Top view. Connections from left to right: Output -, Output +, 12V Input, GND Input.Right: Bottom view. Power Connector for the Host Board soldered to the input voltage pins.
Make sure to orient the microcontroller correct. Otherwise a shortage will ruin the board! If you control the Microcontroller via Serial console/USB make sure to NOT power the microcontroller with the 12V input. To do so switch the jumper to the left configuration.
Left: Top view. Jumper is in 12V configuration.Currently the fans can be controlled via WiFi/OSC or serial console.
Make sure that the jumper on the host board is in the 5V configuration.
Connect with a serial monitor and a baud rate of 9600.
You can control the board with
s/peed -value <value> (Value between 0 (0%) and 255 (100%))
s 50
speed 50
d/irection -value <value> (Value is 0 (STOP), 1 (LEFT), 2 (RIGHT))
d 0
direction 2
Each Microcontroller should be connected to a common WiFI. To do so the controllers open up a hotspot with their name (TowerCenter, TowerLeft, TowerCenter) if no WiFi is set up. You can force the controller to reset the wifi by pressing the reset button twice with a short pause between each press (EN on the ESP32 Dev Kit).
With a common WiFi the fan can be controlled via OSC.
Connect to the hotspot. The WiFiManager should pop up where you can configure the wifi to connect to.Default OSC port is 55555.
/fan/speed/set: Accepts a single int-Value between 0 and 255 (incl.) to set the speed of the fan in the current direction.
/fan/direction/set: Accepts a single int value between 0 and 2 (incl.) to set the direction of the fan.
- 0: STOPPED
- 1: LEFT (Regular direction)
- 2: RIGHT (inverted direction)
Response: The controllers respond with the current speed and direction on the endpoints /fan/speed/state and /fan/direction/state
Within Unity you can use extOSC - Open Sound Control to control the fans via OSC.
TODO: Not implemented.






