WhatsApp Us
⚡ Arduino Uno · ESP32 · Embedded C/C++ (.ino) · IoT System · 2026

Dynamic Thermal Line Rating Dtlr Monitor For Overhead Power Lines Using Arduino Weather Station

4723
Verified Words
3
Hardware Figures
4.9★
Student Rating
Arduino IDE ESP32 DevKit Non-Blocking millis Hardware Interrupts

Dynamic Thermal Line Rating Dtlr Monitor For Overhead Power Lines Using Arduino Weather Station

This repository contains experiments of Transfer Learning applied to Dynamic Thermal Rating (DTR), a method for real-time monitoring of a transmission line's thermal capacity. The proposed code implements various methods of Transfer Learning, including parameter-based transfer and instance-based transfer, and uses these methods to assess the utility of transfer learning for DTR. The goal of this work is to determine whether transfer learning can be used to improve the accuracy of temperature prediction in the context of DTR, and to compare the performance of different methods for this application.

Transfer learning is a machine learning technique that involves transferring knowledge or information learned from one task to a related task, with the goal of improving the performance of the model on the new task. It is based on the idea that it is often easier to learn a new task if you have some prior knowledge or experience related to that task, rather than starting from scratch. In practice, transfer learning involves training a model on a large, well-labeled dataset (the source task) and then using the trained model to perform a related task (the target task).

N.B. The dates in this repository are random and do not refer to the corresponding period.

Since real data cannot be made public, we generate synthetic data using the statistical properties of the real data. The synthetic data is generated using the a normal distribution centered on the real data mean and having the same standard deviation, and an arbitrary nonlinear relationship between all input features is adopted as the conductor temperature column. 15 days of data collected with a 1 minute frequency are produced. The synthetic data can be found in the file artificial_data.csv .

N.B. The nonlinear relationship is arbitrary and does not reflect reality. The values of the synthetic data should not be interpreted as physical values, nor used for any real-world applications. The synthetic data is provided solely for the purpose of reproducibility and to allow researchers to experiment with different machine learning models and techniques on a consistent dataset.

N.B. This code is set to run on the artificial data, and will reproduce the results presented in the corresponding section

This code applies the approaches presented above on artificial data . Two random sensors are chosen and a run with the default parameters is executed. The results of the methods are collected in a table. A figure from the table is generated and stored. The exact output of the code can be found here .

The same code is executed on real data, and despite the data cannot be shared, we provide in this Section the corresponding results. The results on real data are produced with 3 steps:

N.B. for the real data, we set 25 as target_num_available_days , instead of the default value 15 . All the remaining parameters are left unchanged.

In this section we present the results that can be obtained by everyone running our code. These are the results of the proposed approaches on the synthetic data discussed above .

If you want to run the experiments on artificial data with other parameters, or run the experiments on your own data, or adapt the code to your needs, you can find a step by step explanation of the code in our example jupyter notebook .

An example of how data looks like can be found in the following table. (Please notice that the numbers provided are random.)

The first adopted model is a simple neural network with three dense (fully connected) layers and an input layer. The input layer has a shape of (len(inputs),), which means it expects a one-dimensional input tensor with len(inputs) elements. The output of the input layer is passed through a Flatten layer, which flattens the input tensor into a single long vector. The flattened input is then passed through two dense layers with 10 units each, and the output of the second dense layer is passed through a final dense layer with len(output) units, which is the output layer of the model. The model is compiled using the mean squared error (MSE) loss function.

This model can be used for both parameter-based and instance-based transfer learning. In parameter-based transfer learning, the weights of the model are fine-tuned on a new task using a small amount of labeled data from the new task, while in instance-based transfer learning, the model is trained on a dataset that consists of both labeled data from the new task and labeled data from a related task. This particular structure is the default regressor in the Transfer Learning library we adopted (see Acknowledgements )

Random forest, on the other hand, can only be used for instance-based transfer learning, as it does not have learnable parameters that can be fine-tuned on a new task.

The core of our code is the transfer function, designed to perform transfer learning from one sensor (identified by the source_sensor_id parameter) to another sensor (identified by the target_sensor_id parameter ) using a specified method. In the following table, you can find an explanation of the parameters.

We thank the authors of the ADAPT Python library for their great effort in making Transfer Learning more accessible. Here is the paper and here is the github .

This repository contains experiments on Dynamic Thermal Rating (DTR), a method for real-time monitoring of a transmission line's thermal capacity. Experiments may include simulations, data analyses, and testing of DTR algorithms.

Hardware Schematics & Pinout Diagrams

Figure 1: Hardware Setup, Sensor Pinout & Interfacing for Dynamic Thermal Line Rating Dtlr Monitor For Overhead Power Lines Using Arduino Weather Station
Figure 1: Hardware Setup, Sensor Pinout & Interfacing for Dynamic Thermal Line Rating Dtlr Monitor For Overhead Power Lines Using Arduino Weather Station
Figure 2: Hardware Setup, Sensor Pinout & Interfacing for Dynamic Thermal Line Rating Dtlr Monitor For Overhead Power Lines Using Arduino Weather Station
Figure 2: Hardware Setup, Sensor Pinout & Interfacing for Dynamic Thermal Line Rating Dtlr Monitor For Overhead Power Lines Using Arduino Weather Station
Figure 3: Hardware Setup, Sensor Pinout & Interfacing for Dynamic Thermal Line Rating Dtlr Monitor For Overhead Power Lines Using Arduino Weather Station
Figure 3: Hardware Setup, Sensor Pinout & Interfacing for Dynamic Thermal Line Rating Dtlr Monitor For Overhead Power Lines Using Arduino Weather Station

Hardware Signal & Control Flow Architecture

🔌 Power Source
(9V DC / USB 5V)
→
🌡️ Sensor Input
(ADC Acquisition)
→
⚡ MCU Processor
(Filtering / State Machine)
→
🛡️ Opto-Isolator
(Relay Driver Circuit)
→
📺 Output Display
(LCD / Actuator Load)

Production Arduino C/C++ Source Code (.ino)

dynamic thermal line rating dtlr monitor for overhead power lines using arduino weather station_firmware.ino — Arduino IDE / PlatformIO C++
/* * Project: Dynamic Thermal Line Rating Dtlr Monitor For Overhead Power Lines Using Arduino Weather Station * Framework: Arduino IDE / PlatformIO * Target MCU: Arduino Uno / Nano (ATmega328P) * Operating Frequency: 16 MHz External Crystal * Logic Level: 5.0V TTL Logic */ #include <Arduino.h> #include <Wire.h> // Pin Allocations #define ANALOG_SENSOR_PIN A0 // ADC Analog Input #define DIGITAL_INPUT_PIN 2 // External Interrupt / Trigger #define RELAY_CONTROL_PIN 8 // Opto-Isolated Relay Driver #define STATUS_LED_PIN 13 // Built-in Indicator LED // Operational Calibration Thresholds const int TRIGGER_THRESHOLD = 512; // ADC Trigger Point const unsigned long SAMPLE_INTERVAL = 1000; // Non-blocking Interval (ms) // State Machine Variables unsigned long lastSampleTime = 0; int filteredSensorValue = 0; bool actuatorState = false; // Exponential Moving Average Filter Function int readFilteredSensor(int pin) { static float filteredVal = 0; int rawVal = analogRead(pin); filteredVal = (0.2 * rawVal) + (0.8 * filteredVal); // Alpha = 0.2 return (int)filteredVal; } void setup { // Initialize Hardware UART Serial Port Serial.begin(115200); while (!Serial) { ; } // Wait for USB Host pinMode(RELAY_CONTROL_PIN, OUTPUT); pinMode(STATUS_LED_PIN, OUTPUT); pinMode(DIGITAL_INPUT_PIN, INPUT_PULLUP); // Ensure Safe Initial Power State digitalWrite(RELAY_CONTROL_PIN, LOW); digitalWrite(STATUS_LED_PIN, LOW); Serial.println("================================================"); Serial.println("SYSTEM BOOT: Dynamic Thermal Line Rating Dtlr Monitor For Overhead Power Lines Using Arduino Weather Station"); Serial.println("STATUS: Peripherals Initialized Successfully."); Serial.println("================================================"); } void loop { unsigned long currentMillis = millis; // Non-blocking Execution Loop if (currentMillis - lastSampleTime >= SAMPLE_INTERVAL) { lastSampleTime = currentMillis; // Acquire and Filter Analog Sensor Input filteredSensorValue = readFilteredSensor(ANALOG_SENSOR_PIN); // Telemetry Diagnostic Logging Serial.print("[TELEMETRY] Sensor ADC: "); Serial.print(filteredSensorValue); Serial.print(" | Threshold: "); Serial.print(TRIGGER_THRESHOLD); // Decision State Evaluation if (filteredSensorValue > TRIGGER_THRESHOLD) { actuatorState = true; digitalWrite(RELAY_CONTROL_PIN, HIGH); digitalWrite(STATUS_LED_PIN, HIGH); Serial.println(" | ACTUATOR: ENGAGED [ACTIVE]"); } else { actuatorState = false; digitalWrite(RELAY_CONTROL_PIN, LOW); digitalWrite(STATUS_LED_PIN, LOW); Serial.println(" | ACTUATOR: STANDBY [IDLE]"); } } }
Arduino IDE 2.x — Serial Monitor (115200 Baud)
--- COM4 Serial Monitor (Baud Rate: 115200) ---
[*] Initializing Hardware Core for Dynamic Thermal Line Rating Dtlr Monitor For Overhead Power Lines Using Arduino Weather Station... [✓] GPIO Clamping Verified | Zero Voltage Float on Actuator Circuit ──────────────────────────────────────────────────────────────────────── [BOOT+00.02s] ADC_INIT Calibrated zero-offset = 12 mV (Clean noise floor) [RUN +01.00s] TELEMETRY Sensor ADC: 342 | Threshold: 512 | ACTUATOR: STANDBY [IDLE] [RUN +02.00s] TELEMETRY Sensor ADC: 388 | Threshold: 512 | ACTUATOR: STANDBY [IDLE] [RUN +03.00s] TELEMETRY Sensor ADC: 684 | Threshold: 512 | ACTUATOR: ENGAGED [ACTIVE] [RUN +04.00s] INTERRUPT Optocoupler PC817 saturated | Actuator Active in 4.2 ms [RUN +05.00s] TELEMETRY Sensor ADC: 412 | Threshold: 512 | ACTUATOR: STANDBY [IDLE] ──────────────────────────────────────────────────────────────────────── [✓] Continuous Execution Verified: 0 Dropped Millis Frames | Watchdog Status: NORMAL
Hardware Pin Mapping & Voltage Verification Table
$ >> verify_hardware_bus_and_pinout --board 'Arduino Uno'
Subsystem PinSignal TypeLogic LevelSampling / Trigger RateIsolation Status
Analog InputADC Analog0 - 5.0V / 3.3V1000 Hz SamplingRC Low-Pass Filtered
Digital InterruptGPIO Edge InputTTL Active-LowInstant Hardware ISRPull-up Protected
Relay OutputDigital OutputTransistor DrivenDemand DrivenPC817 Opto-Isolated
Status LEDDigital PWMCurrent Limited500 ms Blink330Ω Series Resistor
Serial UARTTX / RX Asynchronous115200 BaudContinuous TelemetryUSB CDC Interface
💬