STINKJET: The Valve-Controlled Smell Generator
The microcontroller software was developed in C using the Codevision AVR C compiler. It provides the user with a command line interface via the PC. The code is fairly simple. A main loop waits for a command from the serial port on the PC. Upon receiving a command, it identifies it and inputs any command arguments necessary. It then executes the appropriate command. In addition to the main loop, an interrupt service routine (ISR) runs every 50 milliseconds. It checks the status of the sensors and changes any valves as necessary.
The user has the option of setting conditions which automatically change the valves depending on the status of the sensors. One condition per valve may be set at a time. That is, up to 24 conditions may be set (one for each valve). The following conditions are available:
- Open valve when sensor is broken
- Close valve when sensor is broken
- Open valve when sensor is unbroken (obstruction is removed)
- Close valve when sensor is unbroken
- Toggle valve each time the sensor changes