The Chaos Device

Working from home with high levels of noise around my home office, I needed something like a radio studio 'on air' light to let passers-by know they should try to keep the volume down. I wanted something lightweight and portable, and there was nothing like this for sale at the time. Thus, I designed and built the Chaos Device, partly as a test of my prototyping capabilities.

The cases were designed in OpenSCAD and 3D-printed in PLA.

Here's a demo of it in action.

Transmitter

The electronics consist of:

The transmitter broadcasts the square wave generated by the 555 timer for as long as the switch is held down.

Interactive 3D print model

The STL viewer widget is borrowed with permission from mitxela.com.

Sorry, your browser doesn't support embedded 3D models.

Receiver

The electronics consist of:

Case front

I made the printed sign on the front after a visit to Bletchley Park, a cryptography museum that was the former site of the British Government Code and Cypher School where the Enigma code was cracked during the Second World War. The museum features a number of mockups demonstrating how the buildings were used for codebreaking, and the walls are decorated with supposedly authentic posters and directives written in a tone that attempts to be simultaneously aloof and scientific, but also paternalistic, expecting the reader to do their best. "It's for your own good — just look at the data!" I attempted to replicate the tone on the sign here, fully-justifying the text in the era-appropriate manner.

The red glow from inside the case comes from an LED mounted on the boost converter circuit board.

The case has a slightly ramshackle appearance due to being glued together, as a slightly easier alternative to using screws in the screw sockets which are unused in this prototype.

Case rear

I printed the case to fit around some components I had to hand. The speaker, switch and battery contacts are recycled from old electronic toys.

Interactive 3D print model

Sorry, your browser doesn't support embedded 3D models.

Programming the attiny85 processor

The processor was programmed using avrdude by plugging it into a breadboard and using an Arduino Uno as a programming interface.

The code

The program running on the processor is conceptually pretty simple:

Practical considerations

Signal to noise ratio

The signal from the preassembled receiver is very noisy. Simply trying to read the radio receiver pin for a 5V high resulted in the Device activating and deactivating itself repeatedly as it continuously registered false positive signals. I tested a few approaches to make the signal clearer:

Ultimately I had to resort to denoising the signal algorithmically. The processor uses a state machine to verify that the receiver pin performs two uninterrupted oscillations. In simpler terms, that means a signal is only registered when:

Voltage drop

A single AA battery does not have a very high impedance, and this is evident in the Chaos Device when, after days of use and with the battery beginning to go flat, the pitch of the activation and deactivation sounds starts to droop and squawk like a broken robot. This amusing malfunction occurs because:

  1. Activating the speaker increases the power draw.
  2. This causes the circuit voltage to drop.
  3. As a result, the processor's clock slows down.
  4. The rate at which the speaker output pin is cycled consequently falls.
  5. The perceived pitch of the sound from the speaker also falls.

In theory, a big enough capacitor wired in parallel with the power supply can smooth out any variations in the voltage, but I found that even a 10mF electrolytic capacitor (which is physically too large for the case as designed) made no noticable difference.

If possible, I prefer a device to require only a single cell: it reduces the size of the case and, more importantly, removes the need to find matching batteries. Using batteries with different levels of charge in the same device is dangerous, and a lot of batteries are thrown away because they end up partially charged, and can't be matched with another one. Even if you don't care about waste, nothing is more annoying than having a drawer full of odd batteries and not being able to use any of them!

I decided this defect was hilarious enough to live with. The only functional issue it presented was that the voltage drop eventually gets so severe that the processor actually turns off. It immediately turns back on again as power is no longer drawn and the voltage rises to 5V again, but it starts in inactive mode, which is obviously not the intended behaviour from pressing the button on the transmitter to activate it. My solution was to make the activation sound different to the deactivation sound, which is an audible reassurance that the receiver is in the correct mode.

The name

The Chaos Device was named after the item in the game Heretic, for MS DOS.

Using the item teleports you back to the start of the level. This feature will be implemented as budget constraints allow.