//####################################################################################################### //## This Plugin is only for use with the RFLink software package ## //## Plugin-073 Deltronic Doorbell ## //####################################################################################################### /*********************************************************************************************\ * This Plugin takes care of reception And sending of the Deltronic doorbell * * Author : Stuntteam / Jonas Jespersen * Support : http://sourceforge.net/projects/rflink/ * License : This code is free for use in any open source project when this header is included. * Usage of any parts of this code in a commercial application is prohibited! ********************************************************************************************* * Technical information: * * The doorbell uses the UM3750 circuit which sends out a 12 bit signal: * * AAAAAAAA BBBB * * A = Always 1 * B = Address (Can be either 1, 5 or 9) * * Address 1 * 20;0D;DEBUG;Pulses=26;Pulses(uSec)=600,1150,525,1175,500,1175,475,1200,500,1175,500,1200,475,1175,475,1200,475,575,1075,575,1075,575,1075,1225,450; * 000000001110 * Address 5 * 20;17;DEBUG;Pulses=26;Pulses(uSec)=550,1075,425,1100,400,1125,425,1100,400,1125,400,1150,375,1125,400,1125,375,550,900,1125,375,550,900,1150,375; * 000000001010 * Address 9 * 20;1B;DEBUG;Pulses=26;Pulses(uSec)=600,1150,500,1175,525,1175,500,1175,500,1175,500,1175,500,1175,475,1200,500,1200,475,575,1075,600,1075,1200,475; * 000000000110 \*********************************************************************************************/ #define DELTRONIC_PULSECOUNT 26 #define LENGTH_DEVIATION 300 #ifdef PLUGIN_073 boolean Plugin_073(byte function, char *string) { if (RawSignal.Number != DELTRONIC_PULSECOUNT) return false; //================================================================================== unsigned long bitstream = 0L; unsigned long checksum = 0L; //================================================================================== if (RawSignal.Pulses[1]*RAWSIGNAL_SAMPLE_RATE > 675) return false; // First pulse is start bit and should be short! for(byte x=2;x < DELTRONIC_PULSECOUNT;x=x+2) { if (RawSignal.Pulses[x]*RAWSIGNAL_SAMPLE_RATE > 800) { // long pulse (800-1275) if (RawSignal.Pulses[x]*RAWSIGNAL_SAMPLE_RATE > 1275) return false; // pulse too long to be valid if (RawSignal.Pulses[x+1]*RAWSIGNAL_SAMPLE_RATE > 675) return false; // invalid manchestercode (10 01) bitstream = (bitstream << 1) | 0x1; // 10 => 1 bit } else { // short pulse if (RawSignal.Pulses[x]*RAWSIGNAL_SAMPLE_RATE < 250) return false; // too short if (RawSignal.Pulses[x+1]*RAWSIGNAL_SAMPLE_RATE < 700) return false; // invalid manchestercode (10 01) bitstream = bitstream << 1; // 01 => 0 bit } } //================================================================================== // Prevent repeating signals from showing up //================================================================================== if( (SignalHash!=SignalHashPrevious) || (RepeatingTimer+2000>= 1; } // Send sync digitalWrite(PIN_RF_TX_DATA, LOW); delayMicroseconds(periodSync); digitalWrite(PIN_RF_TX_DATA, HIGH); delayMicroseconds(period); } digitalWrite(PIN_RF_TX_DATA, LOW); delayMicroseconds(TRANSMITTER_STABLE_DELAY); // short delay to let the transmitter become stable (Note: Aurel RTX MID needs 500µS/0,5ms) digitalWrite(PIN_RF_TX_VCC,LOW); // Disable the 433Mhz transmitter digitalWrite(PIN_RF_RX_VCC,HIGH); // Enable the 433Mhz receiver RFLinkHW(); } #endif // PLUGIN_TX_073