Mouse's Utility for Arduino
Useful utility classes and function that don't fit elsewhere
Mouse's Utilities for Arduino (Mutila)


Re-usable utility components for Arduino projects. All the stuff we all end up re-implementing every project - buttons, averaging samplers, voltage and current measurements calculations and so on.


A collection of classes and functions for nice handling of basic inputs (buttons and such). The classes are kept as simple as possible while having enough functionality to be useful. ''Timeslice-based'' classes should have their ''update()'' method called as frequently as possible, which will return rapidly. These classes are an alternative to interrupt driven IO for projects where interrupts can't be used - e.g. where Mutila inputs must not intefere with timing of other parts of your project which might use interrupts themselves (e.g. motor control)

Terms used for Mutila input classes:


Samplers read from analog input pins and allow some operations to be performed on the data - typically calculating some sort of average value for the pin to help de-noise signals from sensors.

Sampling voltage and current values may be performed using the following classes, which are good examples of how to derive custom samplers from BufferedSampler and EMASampler:

Current measuement may be achieved using an Allegro ACS756SCB-050B-PFF-T Bi-directional 50A hall effect sensor and the class

DFPlayer Mini MP3 audio module

DFPlayer Mini is a neat and affordable audio module which can play MP3 files from an SD card, with a serial interface for control. It can also drive a small speaker. Mutila provides the class DFPlayerMini for controlling such a device. DFPReader is a class which can be used to read out numbers and durations, using the samples in the audio/ directory.

HC-SR04 Ultrasonic Ranger

HC-SR04 ultrasonic range finding modules are inexpensive and popular modules used in Arduino projects. While using them is simple (it only takes a few lines of code to fetch and calculate the range), Mutila provides the following classes for clean usage of these modules, and enhanced functionality:

Author & License

All code written by Mouse, and licensed under the GNU GPL v3. See the LICENSE file for details.

API Documentation

Doxygen-generated documentation can be found on the Orthogonal Systems website at

Generating documentation

  1. Install Doxygen
  2. Run ''doxygen'' from the root of this project - html is generated in doc/html

Ideas for future development



n-state button