You could probably fit a small Arduino (Attiny?) inside that housing. I guess it just uses the USB for power.
...R