I'm trying to make an RF mains switch with an HT12D decoder on the receiver side. I tested with HT12E on the transmitter side and all works well (no switching yet, just lighting up LEDs). But since the encoder takes parallel input, the number of required GPIO pins would be too high.
I'd like to implement/simulate the HT12E in C using wiringPi lib. For now I'd just like to connect one GPIO pin to the data in on the decoder and send the serial data to make the decoder recognize the data sent. I know the voltage level on the GPIO is most likely too low, so this needs some extra components. But something else seems to be wrong, too.
The decoder's oscillator frequency is set to accept encoder @ 3kHz, So one encoder clock cycle should be somewhere around 300us. According to datasheets, each address/data bit lasts 3 clock cycles, "one" being represented as low,low,high and "zero" as low,high,high. The address/data sequence is preceded by a pilot and sync period, pilot being 12 bits of low and sync 1/3 bit high. One information word is pilot+sync+address+data and encoder sends it out 4 times. This should be understood by the decoder, which is not my case, unfortunately, so I'm doing something completely wrong. Since I don't have a scope, I can't rule out that I misunderstood the word structure. But there must be something wrong with my circuit, too, because the leds on the data out light up like a Christmas tree even though I'm not sending any data...
There is this one guy, who did something very similar if not the same http://www.mhr.me.uk/projects/RemotePowerRpi.html, but the waveforms he measured on his HT12E don't look like the ones in the datasheets and the ones I described here. I guess I'll drop him an email, perhaps he'll be willing to help.
In the meantime, anyone with experience with HT12E encoders and their internal workings, please be so kind and let me know what I'm doing wrong. All advice is highly appreciated.