I would like to recount an experience that happened in 1989—when bytes were expensive and smoking was allowed at work. The company I worked for was designing a new fire-detection system. It basically contained several two-wire loops, each with combined power, plus signaling with up to 99 detectors, and a controlling 8051-type microcontroller per loop. Finally, there was a central processor. In addition, it should run some of the smoke detection algorithms as well as figuring out what each detector had in mind. Was a fast fire or a smoldering fire developing? Was the detector getting dusty? However, the first calculations revealed that we needed 16 b or 2 B of read/write RAM memory per detector, or 198 b—on a processor with only 64 B on-chip. Even worse, we had written a cooperative task scheduler that needed some 20 B. Topping it with variables and the stack, we saw no “fast track.” We had not even heard that phrase, but there was one.

Code was written in PL/M-51. The hardware should be cheap; still, we could afford a serially connected external RAM containing 128 B, which was much less than we thought we needed. In the product that we were going to replace, we had used 6 b per analog value. We wished to go for 7 b this time, but we also needed the value from the previous scan (7-b resolution is always better than 6 b, we thought). However, after consultation with the manager, it was confirmed that the smoke level wasn’t really that fine grained: 16 levels in 4 b would probably do. Less was to become more. I would be able to cram all state info into 8 b per detector.

However, we now had more smoke change per score, so I had to introduce hysteresis. It should be hard to get into higher score and equally difficult to get into lower values.

On my way to one of the meetings, I carried my prototype and a battery to show to my fellow engineers. I made the processor signal a beeper each time a new score was entered. As the tobacco smoke filled the room, we could hear it beeping over the discussions. Back from the meeting, the unit beeped again, since I never smoked myself.

After some days of bicycling back and forth to work, an idea appeared. Perhaps I could count the number of score changes? Would this indicate how well the smoke detector had been located? It turned out that it did exactly this. A detector that had been mounted close to a ventilation outlet or a door with plenty of traffic through it saw an increased count. After a week or two, we could inform people about the quality of the installation. Some detectors would be moved to better locations and their count values decreased to normal levels. The fire brigade could remain more at home because the final result was a substantial decrease in faulty alarms. All of this resulted in a big competitive advantage for the company. It was just a few beeps away.