A lightweight, feature-rich Real-Time Operating System (RTOS) for Arduino with networking, storage, and display capabilities.
- Cooperative Multitasking: Support for up to 6 concurrent tasks
- Priority-based Scheduling: 4 priority levels (IDLE, LOW, NORMAL, HIGH)
- Task Management: Suspend/resume capabilities
- Pseudo-preemptive Protection: Tasks automatically yield after max runtime
- Inter-task Messaging: Built-in message passing system
- Power Management: Low-power mode support
- Networking: Ethernet shield support with web server and Telnet
- Storage: SD card support with logging and script execution
- Display: I2C LCD (16x2) support
- Watchdog Timer: System stability protection
help- Display available commandstasks- List all tasks with statusmem- Show free memory and system statsled <0|1>- Control built-in LEDadc <pin>- Read analog pin valuenet- Network statustelnet- Telnet server statuslcd [text]- LCD control/display textsd- SD card status and file listingrun <file>- Execute script from SD cardsuspend <id>- Suspend a taskresume <id>- Resume a taskpower <0|1>- Toggle power saving mode
- Arduino Uno/Mega or compatible board
- (Optional) Ethernet Shield (W5100/W5500)
- (Optional) SD Card module
- (Optional) I2C LCD Display (16x2)
- Arduino IDE 1.8.x or newer
- Required Libraries:
Ethernet(for networking features)SD(for SD card support)LiquidCrystal_I2C(for LCD support)
- Clone this repository:
git clone https://github.com/JustVugg/NimbusOS.git-
Install required libraries through Arduino Library Manager:
- Ethernet
- SD
- LiquidCrystal I2C
-
Open
NimbusOS.inoin Arduino IDE -
Configure features in the code (optional):
// Enable/disable features as needed
#define ENABLE_WATCHDOG
#define ENABLE_SUSPEND_RESUME
#define ENABLE_MESSAGING
#define ENABLE_NETWORKING
#define ENABLE_SD_CARD
#define ENABLE_LCD
#define ENABLE_TELNET
#define ENABLE_SCRIPT_ENGINE- Upload to your Arduino board
// Task function example
void blinkTask() {
static bool ledState = false;
digitalWrite(LED_BUILTIN, ledState);
ledState = !ledState;
os.sleep(500); // Sleep for 500ms
}
void sensorTask() {
int value = analogRead(A0);
Serial.print("Sensor: ");
Serial.println(value);
// Send message to another task
uint8_t data = value >> 2; // Scale to 8-bit
os.sendMessage(2, 1, &data, 1);
}
void setup() {
Serial.begin(115200);
// Add tasks (function, period_ms, priority)
os.add(blinkTask, 0, PRIORITY_NORMAL);
os.add(sensorTask, 1000, PRIORITY_HIGH);
// Run the OS
os.run(); // Never returns
}Access the built-in web interface:
http://192.168.1.100/- Main pagehttp://192.168.1.100/status- JSON system statushttp://192.168.1.100/led/on- Turn LED onhttp://192.168.1.100/led/off- Turn LED offhttp://192.168.1.100/tasks- Task list
Connect via telnet for remote shell access:
telnet 192.168.1.100
# Login: admin
# Password: nimbusCreate automation scripts on SD card:
# example.txt
led 1
adc 0
tasks
led 0Run with: run example.txt
NimbusOS uses a cooperative multitasking approach with priority-based scheduling:
- Task Scheduler: Round-robin with priority selection
- Timer-based Ticks: 100Hz system tick via Timer1
- Memory Protection: Stack overflow detection via watchdog
- Resource Sharing: SPI manager for SD/Ethernet multiplexing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by FreeRTOS and other embedded RTOS systems
- Built for the Arduino community
- Special thanks to all contributors
justvugg - @justvugg
Project Link: https://github.com/JustVugg/NimbusOS
⭐ Star this repository if you find it useful!