Welcome |
Computers |
Electronics |
Sensors |
Meteo Mnisek:![]() |
Meteo Skalka: ![]() |
I design electronic devices using microcontrollers (MCU). MCUs are provided by STMicroelectronics, Atmel-Microchip, Tensillica or others. The MCU contains processor and also memory (operation SRAM and non-volatile FLASH for code storing) on the same chip. The frequent families of MCU is Arduino, Espressif (ESP8266, ESP32) or STM32. MCU are often assembled with power and other auxiliary circuits on a small Printed Circuit Board (PCB) as a small modul (System on Modul - SoM). Some communication functions (Wifi, Bluetooth, LoRa, etc.) may be integrated on the same module or even on the same chip as System-on-Chip (SoC) or Programmable System-on-Chip (PSoC). Modules and chips have low consumption of power and can be powered from small batteries and solar cells.
Input and output interfaces (IOs) of MCU chips or modules are accessible outside as pins and can be easily connected to data sensors or other digital devices via digital data buses (UART, I2C, SPI). MCUs contains A/D and D/A converters, therefore also analog devices or analog sensors can be connected to pins of MCU. MCUs are controlled by custom software (uploaded into FLASH memory) and control local processes, display measured data from sensors etc. Data can be also stored on SD card or transmitted via data networks to data servers for next processing.
I develop a firmware of MCU in some free IDE platforms - Microsoft Visual Code + PlatformIO or Arduino IDE. Develop platforms STM32Cube or ARM Keil can be used for create the firmware of STM32 and provide effective and smaller binary code. Programming languages are C, C++ or Arduino Wiring. Tools as compiler, linker and firmware loader for proper type processor are often added to develop platforms. The compiled firmware is uploaded to the flash memory within MCU via UART/USB converter (eg. CP2102) or ST-Link by STM32. The firmware can be uploaded to flash memory also via data network (OTA). I develop own firmware often using appropriate open software libraries from GitHub. User interfaces I develop in PHP or JavaScript. May be also used Python as a programming language.
I take a fancy to radio LoRa (Long Range) technologies. The LoRa is a proprietary modulation operates in the sub-GHz frequency bands, often in ISM (Industrial, Scientific and Medica) radio bands (433/868 MHz in Czech). The LoRa modulation is based on CSS (Chirp Spread Spectrum) - modulates the information signal with some sequences to expand the signal to a larger frequency band. As modulation sequences in LoRa are using linear frequency modulation chirp pulses with high bandwidth to encode information. Chirp pulses are sinusoidal signals with varying frequency over time, determining symbols that represent the information. The number of bits that can be encoded in each symbol is given by the spreading factor (SF). The LoRa modulation has great immunity signal against noise (up to 20 dB below the noise level), high anti-interference ability and immunity against the doppler effect. Data can be transmitted via the radio LoRa up to long distances (5-10 km). LoRa is intended for small data packet payload (tens of bytes), slow data rates (50 - 20000 bps) and supports adaptive data rate (ADR). Data rates depends on Bandwidth (typically 125, 250, 500 kHz), Spreading Factor (7-12) and Coding Rate (CR) in Forward Error Correction.
Using the LoRa modulation for low data rates has many advantages over WiFi, Bloutooth, Zigbee or GSM radio networks. Particularly in low price of the radio chip, low power consumption and high radio signal sensitivity around -140 dBm (decibel milliwatts). Some MCUs contain LoRa chip by Semtech (SX1278/76/62 etc.). The radio modules included +20 dBm (100mW) power amplifier and IPEX or SMA connector for 433/866 MHz antenna. Modules often support also the traditional FSK/OOK modulation, but LoRa improve receiver sensitivity by more than 20dB compared to FSK. LoRa modules support SPI or UART digital interfaces. I like LoRa SoC on modules provided by HELTEC.
I frequently use the data network LPWAN (SIGFOX, LoRaWAN) via ISM radio band 868 MHz. I use commercial LoRaWAN services provided by CRA i Czech. Sometimes are used cloud services Microsoft Azure (IoTHUB) for data processing. Data from MCUs can be transmitted via LoRaWAN to data servers to control processes eg. via MQTT broker or can be stored and displayed via web interfaces. Sometime I use servers in computer clouds and some cloude services. May be also used lightweight servers created within home local networks created eg. on Raspberry Pi.
Because I am interested in RC models or drones I use Flight Controllers (FC). The FC consists of MCU (mostly STM32) and connected sensors. Accelerometer and gyro sensors acts as Inertial Measurement Unit (IMU). The pressure sensor acts as a barometer. IMU sensors are chips MPU6000 or ICM42688, the barometer are BMP280, DPS310 etc. Current, power and temperature sensors are also embedded. MCUs I/O pins are led out on the board and may be connected via data buses to other sensors (GPS modul, compass or pitot tube modules) and to RC receiver (Spektrum DSM SRXL2 on 2.4 GHz in my case) or other devices. Some MCU I/O are connected to servos (mostly using analog PWM) and control flight surfaces for pitch, roll and yaw motion. MCU I/Os are also connected to the electronics regulator (ESC) to control DC brushless motors for an aircraft. The ESC regulator may be controled by analog PWM or modern digital protocol (DSHOT).
The base part of the FC firmware is software acts as the PID regulator and the regulation loop. Inputs are data from sensors and commands from RC receiver. The regulated quantity is the signal to servos and ESC regulator(s) of the motor(s). This way can be reached the knowledge of 3D position and ability to autoregulate motion of the aircraft. I mostly use open projects as iNAV or Betaflight.
The RC models or drones with the FC are capable to balancing flight, RTH (Return To Home) or Way Points mission capabilities. The great advantage of FC is Telemetry data from embedded and connected senzors. Data can be transmitted to a ground station at the pilot. The ground station receive, decode and display flight telemetry data as speed, altitude, tilt, distance etc. via suitable telemetry protocols. I use serial LTM (Light Telemetry Protocol) or MSP (Multiwii Serial Protocol). Telemetry data can be transmitted via radio ISM band 433/868 MHz (eg LoRa) to Ground Station. Telemetry data can be displayed on a small monitor, computer, save to SD storage or forward to data network. Bluetooth or WiFi (2.4 GHz) can be used for a short distance. Also is an option to mix telemetry data as OSD with video from FPV (First Person View) analog/digital camera. Final video signal can be transmitted via board video transmitter (VTX e.g. ImmersionRC) and receive and display FPV video on the ground station. The video signal is transmitted often via 5.8 GHz radio band.
Created by © DuPe 2010-2021