Temperature and Humidity Sensor Node Design
Text
Open Hornet 16-Channel 28V Magnetic Hold Driver - Routing Retry
Table
| Channel | Arduino pin | Schematic net | Output path |
|---|---|---|---|
| CH1 | 2 | IN1 | U1:D2 -> R10 220R -> R42 1k -> Q2 gate |
| CH2 | 3 | IN2 | U1:D3 -> R11 -> R43 -> Q3 gate |
| CH3 | 4 | IN3 | U1:D4 -> R12 -> R44 -> Q4 gate |
| CH4 | 5 | IN4 | U1:D5 -> R13 -> R45 -> Q5 gate |
| CH5 | 6 | IN5 | U1:D6 -> R14 -> R46 -> Q6 gate |
| CH6 | 7 | IN6 | U1:D7 -> R15 -> R47 -> Q7 gate |
| CH7 | 8 | IN7 | U1:D8 -> R16 -> R48 -> Q8 gate |
| CH8 | 9 | IN8 | U1:D9 -> R17 -> R49 -> Q9 gate |
| CH9 | 10 | IN9 | U1:D10 -> R18 -> R50 -> Q10 gate |
| CH10 | 16 | IN10 | U1:D16 -> R19 -> R51 -> Q11 gate |
| CH11 | 14 | IN11 | U1:D14 -> R20 -> R52 -> Q12 gate |
| CH12 | 15 | IN12 | U1:D15 -> R21 -> R53 -> Q13 gate |
| CH13 | A0 | IN13 | U1:A0 -> R22 -> R54 -> Q14 gate |
| CH14 | A1 | IN14 | U1:A1 -> R23 -> R55 -> Q15 gate |
| CH15 | TXO / D1 | IN15 | U1:TXO/D1 -> R24 -> R56 -> Q16 gate |
| CH16 | RXI / D0 | IN16 | U1:RXI/D0 -> R25 -> R57 -> Q17 gate |
platformio.ini:Ini
[env:promicro] platform = atmelavr board = sparkfun_promicro16 framework = arduino monitor_speed = 250000 lib_deps = dcs-bios/dcs-bios-arduino-library
Cpp
#define DCSBIOS_IRQ_SERIAL #include <Arduino.h> #include <DcsBios.h> // Channel output pins from the schematic. constexpr uint8_t COIL_CH1_PIN = 2; constexpr uint8_t COIL_CH2_PIN = 3; constexpr uint8_t COIL_CH3_PIN = 4; constexpr uint8_t COIL_CH4_PIN = 5; constexpr uint8_t COIL_CH5_PIN = 6; constexpr uint8_t COIL_CH6_PIN = 7; constexpr uint8_t COIL_CH7_PIN = 8; constexpr uint8_t COIL_CH8_PIN = 9; constexpr uint8_t COIL_CH9_PIN = 10; constexpr uint8_t COIL_CH10_PIN = 16; constexpr uint8_t COIL_CH11_PIN = 14; constexpr uint8_t COIL_CH12_PIN = 15; constexpr uint8_t COIL_CH13_PIN = A0; constexpr uint8_t COIL_CH14_PIN = A1; constexpr uint8_t COIL_CH15_PIN = 1; // TXO used as GPIO; DCS-BIOS uses native USB CDC constexpr uint8_t COIL_CH16_PIN = 0; // RXI used as GPIO; DCS-BIOS uses native USB CDC constexpr uint8_t COIL_PINS[16] = { COIL_CH1_PIN, COIL_CH2_PIN, COIL_CH3_PIN, COIL_CH4_PIN, COIL_CH5_PIN, COIL_CH6_PIN, COIL_CH7_PIN, COIL_CH8_PIN, COIL_CH9_PIN, COIL_CH10_PIN, COIL_CH11_PIN, COIL_CH12_PIN, COIL_CH13_PIN, COIL_CH14_PIN, COIL_CH15_PIN, COIL_CH16_PIN }; void setCoil(uint8_t channelIndex, bool enabled) { if (channelIndex >= 16) return; digitalWrite(COIL_PINS[channelIndex], enabled ? HIGH : LOW); } void allCoilsOff() { for (uint8_t i = 0; i < 16; i++) { digitalWrite(COIL_PINS[i], LOW); } } // Replace these callbacks with the actual DCS-BIOS export/control mapping. // Example pattern: when DCS-BIOS says a magnetic hold should energize, call setCoil(channel, true). void onMagHoldCh1Change(unsigned int newValue) { setCoil(0, newValue != 0); } void onMagHoldCh2Change(unsigned int newValue) { setCoil(1, newValue != 0); } void onMagHoldCh3Change(unsigned int newValue) { setCoil(2, newValue != 0); } void onMagHoldCh4Change(unsigned int newValue) { setCoil(3, newValue != 0); } void onMagHoldCh5Change(unsigned int newValue) { setCoil(4, newValue != 0); } void onMagHoldCh6Change(unsigned int newValue) { setCoil(5, newValue != 0); } void onMagHoldCh7Change(unsigned int newValue) { setCoil(6, newValue != 0); } void onMagHoldCh8Change(unsigned int newValue) { setCoil(7, newValue != 0); } void onMagHoldCh9Change(unsigned int newValue) { setCoil(8, newValue != 0); } void onMagHoldCh10Change(unsigned int newValue) { setCoil(9, newValue != 0); } void onMagHoldCh11Change(unsigned int newValue) { setCoil(10, newValue != 0); } void onMagHoldCh12Change(unsigned int newValue) { setCoil(11, newValue != 0); } void onMagHoldCh13Change(unsigned int newValue) { setCoil(12, newValue != 0); } void onMagHoldCh14Change(unsigned int newValue) { setCoil(13, newValue != 0); } void onMagHoldCh15Change(unsigned int newValue) { setCoil(14, newValue != 0); } void onMagHoldCh16Change(unsigned int newValue) { setCoil(15, newValue != 0); } // TODO: Replace these placeholders with actual DCS-BIOS IntegerBuffer declarations for the selected aircraft/panel. // Example form only; addresses/masks/shift values must come from DCS-BIOS control-reference data: // DcsBios::IntegerBuffer magHoldCh1Buffer(0x0000, 0x0001, 0, onMagHoldCh1Change); void setup() { for (uint8_t i = 0; i < 16; i++) { pinMode(COIL_PINS[i], OUTPUT); digitalWrite(COIL_PINS[i], LOW); } DcsBios::setup(); } void loop() { DcsBios::loop(); }
pio run -e promicropio run -e promicro -t uploadpio device monitor -b 250000Platform & Toolchain
Pin Mapping
Dependencies & Project Setup
Complete Firmware Source
Bring-up / Safety Checklist
Build & Flash