maandag 11 juli 2011

Mystery LED in a box: part 1

see also: Mystery LED in a box: part 0

So the puzzling started. After receiving the small transparent mystery box on our wedding party, already the next day I diligently started deciphering the led's ON/OFF sequence.

As a leftover from a energy monitoring project (that I never finished) I still had a USB datalogger (build around the VDIP1 module) which can log 4 channels of analogue values as a 10 bits value with a maximal sample rate of about 4Hz. It is unfortunately not faster (the software contains some bugs that I still have to fix), but for the mystery led it seemed appropriate. I plugged in an optical sensor (type unknown) to log when and how long the led is ON and OFF. Not knowing how long a unique data sequence was, I logged the optical sensor for 30 minutes.

With the analogue values of the optical sensor stored in a CSV file, I can write some signal processing scripts to analyse the data. In a spreadsheet program the data showed up nicely. A high analogue value (around 700) means the led is ON, the lower values indicate the led is turned OFF. The total sequence was around 7500 samples long. Not a very pleasant job to decipher that by just looking at the led. I definitely needed some software aids for this.

I have some experience with MATLAB, a widely used mathematical software environment. With MATLAB this shouldn't be difficult to decipher, I figured. A 'small' difficulty was that I had no clue what to look for. It can be a highly encrypted telephone number for which I needed a key, or a 800x600 black&white picture giving us a new clue or even a QR code leading us to a website. I stared at the data for a small week and played around with it viewing it from different angles. But nothing that looked useful.

To make sure I didn't miss any data, I watched the Attiny's led output on an oscilloscoop. Maybe a signal with a frequency higher then a visible sequence of 20Hz would show up. Some of my friends know their way pretty well in in the GHz working areas, so I was aware of some very high frequency clue. Luckily, the Attiny2313 has an internal clock of only 1MHz, and my 15MHz scoop showed no hidden suprise. The data that I had from the datalogger still looked as the only useful data.

I definitely was thinking too difficult. It was time to get help from my wife (no offense, honey). Maybe she can look at it from a different (non-technical) perpective which I didn't see with my biassed technical view.
Funny thing was that from the beginning I told everybody that a Morse-code would be out of the question, since this should be way to easy to solve for me and would be kind of an insult to me. I must say, I did look at this option, interpreting the '1' as a dash '-' and the '0' as a dot '.'. The spreadsheet sample from the picture above would then be deciphered as '----.-.-.-.'. But it didn't gave me information when a certain letter started or ended, so the data stream could mean a enormous amount of letter combinations. Very hard to go through all that options. I quickly put aside the Morse-code option.

Eventually it was my brilliant wife that came up with the idea that not the '1''s are dashes and the '0''s are dots but that the lengths of the sequential '1''s were the way to go. So a long stream of '1''s means a dash and a short stream of '1''s means a dot. The length of the '0' streams would then indicate the ending and starting of letters and complete words. The beginning of the data is then deciphered as '-... . ... - .' which means 'BESTE', the dutch word for 'DEAR'.

Victory was ours! A few hours of additional MATLAB programming eventually gave us the information that we needed.


The text basically says that my wife Rianne needs to solder a push button between ground and PIN7 on the Atmel.

That is our first clue, we are going to search for the next one! More to follow....

see also: Mystery LED in a box: part 2
see also: Mystery LED in a box: part 3
see also: Mystery LED in a box: part 4 
see also: Mystery LED in a box: part 5  
see also: Mystery LED in a box: part 6 
see also: Mystery LED in a box: part 7

Geen opmerkingen:

Een reactie plaatsen