The title description is quite broad so allow me to explain more clearly what I’ve been working on for the past couple of weeks. Think of the television remote or more specifically using IR diodes and IR receivers to transmit information:
The received data is a total mess! A good metaphor for this situation is to imagine two people talking to you at the same time about two entirely different things while you try to understand both simultaneously. This is just not possible. One thing that can be said about the received signal at the IR sensor is that it is a combination of both of the input signals. This is an important fact and FFTalk is based on this.
Information CAN be sent with both of the IR diodes transmitting at once but not in the normal way i.e. not in the time domain ‘101010’ serial data pattern shown in the above diagrams. Instead of thinking in the time domain, we could think in the frequency domain. By converting the received signal from its time domain representation to the frequency domain using an FFT(Fast Fourier Transform) it is possible to determine the frequency of the input signals. See the below diagrams for more explanation of this. Note : for clarity’s sake I won’t show the 38Khz modulation with the IR transmitters. From now on just assume any data coming out of the IR diodes is 38Khz modulated:
Ok so the received data is still totally scrambled but if we were to perform an FFT on it we could say well there is a 200Hz component here so IR Diode 1 must be transmitting and there is a 300Hz component also so IR diode 2 must be also transmitting. Imagine IR Diode 1 and 2 are attached to sensors. These sensors could only transmit 1 byte of data this way (on/off) but this could still be useful. It might also be possible to send very slow asynchronous serial data using this method – more on this later – for now lets stick with on/off sensing and I will show the experimental results.
The Circuit :
The breadboard got extremely messy as the project went along. I’m afraid to breath near it incase something shakes loose and it stops working :D. To explain what is going on:
The Tiva C has one of it’s ADC pins connected to the IR receiver output so it can sample the received signal and perform an FFT on it. It is also responsible for sending the FFT result data over serial to a computer where analysis is done via a python script.
The logic analyser is looking at each of the input signals to the IR diodes (lets call them f1 and f2) and it is looking a the IR receiver output also.
The switches are so I can change things like the frequency of f1 or f2 and turn either diode on/off etc
The dsPIC microcontroller is responsible for generating the variable frequency 38KHz modulated signals being fed into each of the IR diodes and reading the input switches.
Here is the logic analyser output: Note that the solid white bars of f1 and f2 are 38khz modulated it’s just solid because it’s not ‘zoomed in’ enough
Notice how the receiver output doesn’t perfectly match up with the f1&f2 input signals – This is probably because of the el cheapo chinese logic analyser I’m using but it is good enough for this purpose. OK so now lets take a look at a graph of the FFT results for the 3 available states:
f1 on & f2 on
f1 on & f2 off
f1 off & f2 on
the 4th state is both off but sure who wants to look at a graph of a staight line?
For this experiment f1 is at 324Hz and f2 is at 519Hz
Note: X axis is frequency bins I didn’t bother converting them to frequency. The frequency range of the fft is 0-500Hz.
FFT graph for f1 on – f2 on:
Why these graphs look the way they do doesn’t really matter for this application – all we care about right now is that there is three very different FFT outputs depending on the input states – whether f1 or f2 is on or both. This means we can tell which sensors are turned on/off.
All of the code for this project is available at this GitHib repo : https://github.com/wattnotions/fftalk
More experimentation is needed to see how robust this idea is. Will I be able to get a PIC microcontroller to do the FFT and analyse the result and work out which sensors are on instead of using a python script? How many diodes can be transmitting at once before the FFT result gets so messy you cant tell which sensors are on? What is the best frequency range to use? (right now I’m using 100-500hz just chosen basically at random). Will get some PCBs made up with some kind of sensor on it and an IR diode. Right now there is a couple different ways I am classifying each FFT result, this is done by searching for the max value position and the standard deviation of the sampled data – maybe there is different/better way of classifying each state.