@Syzd
Ардуинщик

RF433 принимает посторонний сигнал?

RF433 приемник выдает последовательность байт хотя я ничего не передаю, возможно какие то беспроводные передатчики соседей засоряют эфир, но как узнать что это?

Подключено по данной схеме: Receiver1-1024x640.png
/*

  Example for receiving
  
  http://code.google.com/p/rc-switch/
  
  If you want to visualize a telegram copy the raw data and 
  paste it into http://test.sui.li/oszi/
  
  Need help? http://forum.ardumote.com
  
  Edited by hack.lenotta  to force it receive to ‘everything’ 
  and included all the files at once.
  http://hack.lenotta.com
*/

#include <RCSwitch.h>
// Format the output:

void output(unsigned long decimal, unsigned int length, unsigned int 
delay, unsigned int* raw, unsigned int protocol) {

  if (decimal == 0) {
    Serial.print("Unknown encoding.");
  } else {
    char* b = dec2binWzerofill(decimal, length);
    Serial.print("Decimal: ");
    Serial.print(decimal);
    Serial.print(" (");
    Serial.print( length );
    Serial.print("Bit) Binary: ");
    Serial.print( b );
    Serial.print(" Tri-State: ");
    Serial.print( bin2tristate( b) );
    Serial.print(" PulseLength: ");
    Serial.print(delay);
    Serial.print(" microseconds");
    Serial.print(" Protocol: ");
    Serial.println(protocol);
  }
  
  Serial.print("Raw data: ");
  for (int i=0; i<= length*2; i++) {
    Serial.print(raw[i]);
    Serial.print(",");
  }
  Serial.println();
  Serial.println();
}


static char* bin2tristate(char* bin) {
  char returnValue[50];
  int pos = 0;
  int pos2 = 0;
  while (bin[pos] != ' ' && bin[pos+1] != ' ') {
    if (bin[pos]=='0' && bin[pos+1]=='0') {
      returnValue[pos2] = '0';
    } else if (bin[pos]=='1' && bin[pos+1]=='1') {
      returnValue[pos2] = '1';
    } else if (bin[pos]=='0' && bin[pos+1]=='1') {
      returnValue[pos2] = 'F';
    } else {
      return "not applicable";
    }
    pos = pos+2;
    pos2++;
  }
  returnValue[pos2] = ' ';
  return returnValue;
}

// Make some conversions:

static char * dec2binWzerofill(unsigned long Dec, unsigned int 
bitLength){
  static char bin[64]; 
  unsigned int i=0;

  while (Dec > 0) {
    bin[32+i++] = (Dec & 1 > 0) ? '1' : '0';
    Dec = Dec >> 1;
  }

  for (unsigned int j = 0; j< bitLength; j++) {
    if (j >= bitLength - i) {
      bin[j] = bin[ 31 + i - (j - (bitLength - i)) ];
    }else {
      bin[j] = '0';
    }
  }
  bin[bitLength] = ' ';
  
  return bin;
}

//The edited code to force recevining data:

RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(9600);
  mySwitch.enableReceive(0);  // Receiver on inerrupt 0 => that is 
pin #2
}

void loop() {
    output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(),
 mySwitch.getReceivedDelay(), 
mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol());
    mySwitch.resetAvailable();
  
}
  • Вопрос задан
  • 1103 просмотра
Пригласить эксперта
Ответы на вопрос 2
a_volkov1987
@a_volkov1987
Инженер-схемотехник
Вы не обижайтесь, но вы выбрали самый примитивный, самый ненадежный, самый незащищенный приемник на самой популярной частоте и теперь спрашиваете, как с ним работать? Выкиньте его, так будет лучше для всех.
Ну и вот легкий гуглеж говорит:
roboforum.ru/forum11/topic10763.html?style=9
easyelectronics.ru/radiomoduli-hoperf-hm-r433-i-hm...
https://geektimes.ru/post/253954/ - тут Di Halt предлагает варианты, которые стоит использовать
Ответ написан
gbg
@gbg Куратор тега Arduino
Любые ответы на любые вопросы
На 433 работает огромная куча радиохлама
-рации LPD
-автосигналиации
-брелки
-погодные станции

И много еще всего. Хотите найти источник - покупайте радиосканер и удачи вам.
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы