Skip to content
README.md 3.3 KiB
Newer Older
# Light control module for light control of the "convi" zone of Electrolab

***

This project is an open-source control module for the lights in the "convi" zone of the association HQ.
The Electrolab association has a "convi" zone with multiple light sources that need remote control for conferences and presentations, and also for energy saving.

## Description

This repository contains all the embedded software. The design can accommodate multiple different control boards. Connector footprints are provided for the following boards:
- Standard Arduino UNO and equivalents (pinout designed for use with ST Discovery STM32F746G)
- ST Nucleo 144 (MORPHO connectors, pinout designed for use with ST Nucleo STM32F207Z)
- Espressif ESP32 module
- Olimex ESP32POE

The control board will generate 8 0-10V control signals, controllable through HMI, Ethernet via Modbus and / or MQTT ... Depending on the command board used.

## Embedded software

### ST Discovery STM32F746G

This control option provides a touchscreen HMI for direct visual control of the 0-10V outputs.
The PWMs are configured with default CubeMX parameters for the clock configuration, no pre-scaler, reload value is set to 16383 in order to have 14 bits max resolution. Default frequencies for timers is 108MHz on APB1, 216MHz on APB2, giving a final frequency of 6.6kHz for PWMs 3 to 8 and 13.2kHz for PWM1 and PWM2.

The STM32CubeIDE project is in the directory STM32_Disco746G.

Pinout:
- PWM1 - TIM1_CH1   -> PA8 / D10
- PWM2 - TIM1_CH2N  -> PB14 / D12
- PWM3 - TIM4_CH3   -> PB8 / D15
- PWM4 - TIM4_CH4   -> PB9 / D14
- PWM5 - TIM5_CH1   -> PA0 / A0
- PWM6 - TIM5_CH4   -> PI0 / D5
- PWM7 - TIM12_CH1  -> PH6 / D6
- PWM8 - TIM12_CH2  -> PB15 / D11

### ST Nucleo STM32F207Z

This control option provides Ethernet (MQTT) and UART connectivity.

Pinout:
- PWM1 - TIM1_CH1   -> PE9
- PWM2 - TIM1_CH2   -> PE11
- PWM3 - TIM1_CH3   -> PE13
- PWM4 - TIM1_CH4   -> PE14
- PWM5 - TIM4_CH1   -> PD12
- PWM6 - TIM4_CH2   -> PD13
- PWM7 - TIM4_CH3   -> PD14
- PWM8 - TIM4_CH4   -> PD15

### Olimex ESP32POE

This control option provides Ethernet and WIFI connectivity.

TODO

### Espressif ESP32

This control option provides WIFI connectivity.

TODO

### Implementation

Commands : the available commands are listed in the command_parser_user.h file. They are defined by a command string and a number of parameters, as well as a permission mask in order to restrain their usage, and a callback. All remote communication channels use these commands, with permissions. When a command is identified, the callback is called with the arguments passed as parameters.

MQTT : a single broker is used, with a single topic for the commands (in and out). 

UART : The debug UART through the ST-Link USB is used, @115200 bds.

## Tools
- [ST Discovery STM32F746G](https://www.st.com/en/evaluation-tools/32f746gdiscovery.html)
- [ST Nucleo STM32F207Z](https://www.st.com/en/evaluation-tools/nucleo-f207zg.html)
- [STM32CubeIDE 1.12.0](https://www.st.com/en/development-tools/stm32cubeide.html)
- [TouchGFX 4.21.3](https://www.st.com/en/development-tools/touchgfxdesigner.html)
- [Espressif ESP32 module](https://www.espressif.com/en/products/socs/esp32)
- [Olimex ESP32POE](https://www.olimex.com/Products/IoT/ESP32/ESP32-POE/open-source-hardware)