Gents,
I need some help.
I have an Arduino megda 2560 and I have connected it to a common 433 Hz RF module.
I can't get it working.
I am only used the left module which is the receiver.I connected the Vcc pin to the 5volt power ouput pin on my Arduino Mega board. Also connected the grounds.
Connected one of two data ports on the receiver to digital pin 7 on my arduino. I have found on the web that both two pins are fine as they are connected on the mini board.
I used the RadioHead library as you can see below:
/*------------------------------------------------------------------------------
Program: ask_receiver
Description: Slight variation of the original example code (included in the
RadioHead-1.74 library) for the ASK transmitter and receiver:
simple example of how to use RadioHead to transmit messages
with a simple ASK transmitter in a very simple way.
Implements a simplex (one-way) transmitter with an TX-C1 module.
Hardware: Standalone ATmega328P-PU/Arduino Uno R3, RWS-371 RF Receiver Module
(434 MHz). Should work with other Arduinos
Software: Developed using Arduino 1.8.2 IDE
Libraries:
- RadioHead-1.74:
http://www.airspayce.com/mikem/arduino/RadioHead/
- SPI(included with the Arduino IDE)
References:
- RadioHead Packet Radio library for embedded microprocessors:
http://www.airspayce.com/mikem/arduino/RadioHead/
Date: April 29, 2017
Author: - RadioHead (http://www.airspayce.com/mikem/arduino/RadioHead/),
modified by G. Gainaru, http://www.arduinolab.net
modified by Edwin 2018-08-27
------------------------------------------------------------------------------*/
#include <RH_ASK.h> // downloaded the overall radiohead libery and installed the ZIP file via the libery manager from Arduino IDE.
#include <SPI.h> // Not actualy used but needed to compile
// tx/rx configuration
const int txSpeed = 2000; //Default
const int rxPin = 7; // connected to digital I/O #7 on my Arduino Megaboard
const int txPin = 6; // not connected at this moment
//const int pttPin = 7; // not connected
RH_ASK driver(txSpeed, rxPin, txPin); // removed the pttPin
void setup()
{
Serial.begin(9600); // Debugging only
if (!driver.init())
Serial.println("init failed");
}
void loop()
{
uint8_t buf[RH_ASK_MAX_MESSAGE_LEN] = {0};
uint8_t buflen = sizeof(buf);
Serial.println("Sniffing for rf signals...");
if (driver.recv(buf, &buflen)) // if message received, save it
{
Serial.println((char*)buf); // print received message
delay(3000);
}
delay(500);
}
Compiling works.
Uploading is no problem.
I have used two 433 RF remotes to send data to the receiver. I see only the "Sniffing for rf signals.." text but nothing else. At least one of the remotes (from KAKU) are know to be compatible chip wise.
Is it possible that my 433 RF receiver is broken? Is it sensitive to for faulty connecting (5 volt on the gnd for example) or are these device mechanically sensitive? It is not working and I cannot find a reason why?
Did order a couple 433 RF units more from ebay but it will take three weeks or so until I get them in.
Does anyone have an idea what it could be?
There is nothing wrong with the code is there?
I see some tutorials using a resistor while connecting the RF 433 module. Other do not. Is this required? Can someone elaborate on this? Purpose and why?