Posts

Showing posts with the label Logic

WL101-341 OOK/ASK decoder

Image
 2.1.2022 WL101-341 OOK/ASK decoder   Arduino used for providing 3.3V and GND.   Wireless OOK doorbell signal. WL101-341 data pins (2) output same signal. WL101-341 data output is random noise when there is no signal. Arduino Due code #define SERIAL_SPEED    57600 #define DATA_PIN        5 #define DATA_SIZE       3072 #define TIMEOUT         16000 #define PLOT_SCALE      16 int32_t data[DATA_SIZE]; uint32_t timeoutStart; volatile uint16_t idx = 0; volatile uint8_t state = 0; void setup() {   Serial.begin(SERIAL_SPEED);   pinMode(DATA_PIN, INPUT);   memset(data, 0, sizeof(data));   timeoutStart = millis();   attachInterrupt(digitalPinToInterrupt(DATA_PIN), isr, CHANGE); } void loop() {   if (state == 1) {     detachInterrupt(digitalPinToInterrupt(DATA_PIN));     state = 2...