June 2018

USB RGB LED Controller Based on AVR Microcontroller

Why not upgrade the CPU usage LED project to a general-purpose RGB LED controller? The current CPU usage LED controller uses a value between 0 and 255 to calculate the color it should be and then fades to that color. This is indeed quite limited; changing the color and fading method requires firmware updates. In contrast, a general-purpose RGB LED controller can let the host software handle all the work, and the controller only needs to be told what brightness the red, green, and blue LEDs should be, providing greater flexibility and scalability.

To simplify interactions with the controller, I developed a library that wraps all LibUSB content. With this library, you can achieve basic functionality with just a few lines of code (only 10 lines).


#include <rgbledctrl.h> int main() { rgbledctrl_init(); rgbledctrl_find(); s_rgbled_device* rgbLed = rgbledctrl_open(); rgbledctrl_setR(rgbLed, 200); // Set red value to 200 rgbledctrl_close(rgbLed); return 0; }

The library also has support for reading and writing to the EEPROM of the controller. Class wrappers for C++ and C# .NET are also provided.

Download from GitHub
Documentation

Bluetooth Smart Monitoring System V2.0

This article only provides a sneak peek into the new features of the network monitor.I’d recommend having a look at the original post first.

  • New PCB design
    The new PCB is now an almost single board design, just a separate board for the USB connector. The old monitor had a small main board which connected to the LCD and Bluetooth modules. This new board has everything soldered straight on.
  • Revamped microcontroller code
    Refactored a lot of the microcontroller code, reduced RAM usage and improved performance a little bit.
  • New router program
    The router program is now completely written in C! Uses much less CPU time than the old shell script.
  • New host program
    Written in C# .NET and uses LibUsbDotNet. It’s still in early development, but at the moment allows uploading images (takes around 2.5 – 3 seconds to upload), drawing stuff (mouse click and drag) and controlling the display brightness.
  • Other new features
    New efficient binary protocol instead of a text protocol.
    Added a temperature sensor since there was a lot of room left on the PCB, however this turned out to be a bit useless for measuring the room temperature because of the heat dissipated by nearby parts, mainly