A collection of Arduino-compatible utility functions and classes commonly used by Vulintus.
Disclaimer: This README file was AI-generated, but checked for accuracy by a human.
- Voltage Monitoring - Read and monitor analog voltages with configurable voltage divider circuits
- Task Timer - Execute periodic tasks at precise intervals using millisecond or microsecond resolution
- Download this repository as a ZIP file
- In Arduino IDE, go to Sketch → Include Library → Add .ZIP Library
- Select the downloaded ZIP file
- The library will be added to your Arduino libraries folder
Copy the Vulintus_Firmware_Toolbox folder to your Arduino libraries directory:
- Windows:
Documents\Arduino\libraries\ - macOS:
~/Documents/Arduino/libraries/ - Linux:
~/Arduino/libraries/
#include <Vulintus_Utilities.h>
// Create a voltage monitor on pin A0
// Parameters: ADC pin, top resistor (ohms), bottom resistor (ohms), reference voltage (volts)
Vulintus_Voltage_Monitor monitor(A0, 10000.0, 1000.0, 3.3);
void setup() {
Serial.begin(115200);
monitor.begin(); // Initialize the monitor
}
void loop() {
float voltage = monitor.read(); // Read the current voltage
Serial.print("Voltage: ");
Serial.print(voltage, 3);
Serial.println(" V");
delay(500);
}#include <Vulintus_Utilities.h>
// Create a timer that executes every 250 milliseconds, 10 times total
Vulintus_Task_Timer timer(250, NULL, 10, TIMER_CLOCK_MILLIS);
void setup() {
Serial.begin(115200);
// Set the callback function to execute
timer.task_fcn = myTask;
timer.start();
}
void myTask() {
Serial.println("Task executed!");
}
void loop() {
timer.check(); // Check if task should execute
}Vulintus_Voltage_Monitor(uint8_t adc_pin, float rtop = 10000.0, float rbot = 1000.0, float vref = 3.3);Parameters:
adc_pin- Arduino ADC pin to read fromrtop- Top resistor value in voltage divider (Ω) [default: 10000]rbot- Bottom resistor value in voltage divider (Ω) [default: 1000]vref- ADC reference voltage (V) [default: 3.3]
| Method | Description |
|---|---|
begin() |
Initialize the voltage monitor (call in setup) |
read() |
Return the current monitored voltage in volts |
display_fcn- Function pointer called to display monitored voltage
pin- ADC pin used for monitoringv_ref- ADC reference voltage (volts)r_top- Top resistor value (ohms)r_bot- Bottom resistor value (ohms)
Vulintus_Task_Timer(uint32_t timer_period, void (*task_callback)(void) = NULL,
uint32_t tasks_to_execute = 0, TIMER_CLOCK use_clock = TIMER_CLOCK_MILLIS);Parameters:
timer_period- Time between task executions (millis or micros)task_callback- Optional task function pointer (can be set later)tasks_to_execute- Number of times to execute (0 = infinite)use_clock- Clock type:TIMER_CLOCK_MILLISorTIMER_CLOCK_MICROS
| Method | Description |
|---|---|
start() |
Start the timer and call start_fcn if set |
stop() |
Stop the timer and call stop_fcn if set |
check() |
Check if next task execution is due (call in main loop) |
start_fcn- Called when timer startstask_fcn- Called when task is due to executestop_fcn- Called when timer stops
period- Timer period (millis or micros)num_executions- Number of times to execute the task (0 = infinite)clock- Clock type used (millis or micros)
Complete working examples are included in the examples/ folder:
- LED_Timer - Demonstrates the
Vulintus_Task_Timerclass by toggling an LED periodically - Voltage_Monitor - Demonstrates the
Vulintus_Voltage_Monitorclass by reading and displaying voltage
To measure voltages higher than your ADC reference voltage, use a voltage divider:
V_in
|
R_top
|
+------ (connect to ADC pin)
|
R_bot
|
GND
The measured voltage will be: V_out = V_in × R_bot / (R_top + R_bot)
Example: To measure 0-15V with a 3.3V ADC (R_top=10kΩ, R_bot=1.13kΩ):
Vulintus_Voltage_Monitor monitor(A0, 10000.0, 1130.0, 3.3);This library is compatible with most Arduino-compatible boards including:
- Arduino Uno, Nano, Mega
- Arduino Due, Zero
- Arduino MKR boards
- ESP8266, ESP32
- STM32 boards
- And other Arduino-compatible platforms
The library automatically detects ADC resolution (10-bit for AVR, 12-bit for other boards).
This project is licensed under the MIT License - see the LICENSE file for details.
For issues, questions, or suggestions, please contact Vulintus, Inc.
Copyright © 2026 Vulintus, Inc.