I have a problem with this 433MHz receiver I bought.
Red is 5V, Blue is GND and Yellow is the sensor pin
When I first used it, it worked fine. It is supposed to output random noise while no signal is received for a short period of time, which is what it did the first time I used it, but now it just outputs digital 0s all the time. When I connected it to an analog pin instead of a digital one I found out that it never goes over 2V, and it only gets a voltage different than 0 when there is some sort of signal at 433MHz.
I don't think that it is broken since I tested 5 different receivers (I bought a set of 5 receivers and 5 transmitters), all with the same output.
Could the Arduino be faulty?
The code is really simple, just outputting the value of a digital pin.
Write a simple sketch that reads an analogue value from a suitable pin every 10ms for example and plot the resulting value using the serial plot function. Look at what happens if you turn a transmitter on and off, does it change? It may be that the pin you are connecting to needs to be read as analogue then a threshold applied to derive a digital value.
I did that and it seemed to stay at 0 at all times and then go to about 350 (1.7V) when I transmitted at a frequency of 433MHz, when I stopped it went back to 0.
But when the signal lasted for longer, it went back to 0 even while I was actively transmitting the signal.
I guess I could use the receiver this way but I can't trust the data, since it is supposed to work differently.
And the first time that I used it, it seemed to work fine, so something must have changed in order for it to behave differently.
When the sensor hasn't detected any signal it enters a cycle where it becomes more and more sensitive over time, until it detects a signal again. When there hasn't been a signal for a given amount of time, the sensor enters this cycle until it becomes so sensitive that it reads false positives, then it bounces around really fast reading positives and negatives until an actual signal is read.
It's your responsibility to mention odd things like that in your first post, so people don't waste time catching them.
By the way, the strange output voltages are due to the module's use of a cheap non rail-to-rail op amp or comparator as a detector. It can't pull all the way to ground and Vcc.
I tried it on every digital pin and got no output, I also tried mySwitch.enableReceive(0) while on pin 2, which is what the documentation uses, and also got no output on the Serial Monitor. Maybe the Arduino is broken? If so, how could I check? As I said, I doubt that all 5 receivers are broken, so the Arduino is the only option that I can think of.
That is called "automatic gain control", or AGC. All modern receivers use it, except for the Super regenerative receivers. All electronic devices create noise when current passes through them. A silicon junction of any type creates noise. I have a VHF noise generator that I built many years go that generates noise by passing a variable current through a silicon diode junction.
All you are getting is the noise generated by the receiving device itself. The better quality device will generate less noise and cost more.
All you really need to generate random noise is a diode and a variable current source. Google for diode noise generator.
Possibly another thing that wasn't set out in the first post. If it was meant that way. This device wouldn't make a good noise generator for the obvious reason that it is a receiver, that will receive non-random signals from time to time.
Pin2 on an Uno is interrupt#0. An Uno has ony two interrupt pins. Interrupt#1 is on pin3.
So which Arduino has interrupt#21 on which pin. See this page.
Leo..
Pin 21 is on an ESP32 but that has nothing to do with the usability of the program. As changing the pin number is problematic, don't start to program. It is one of the most easiest things.
Every one that use electronic components must learn to read datasheet.
Is it the intention that copy paste, without understanding what the code makes, is the rule?
As of reply #13, we are still not really sure what the OP is trying to do. I guess a 4cm wireless connection is not very useful (except for some interesting microwave chips that are coming out now, to replace some types of plug/socket connections...).
First we dwelled on the intricacies of a cheap receiver, now we're tossing around ideas about interrupt pins.
I have a 433MHz receiver, the first time I used it it worked as expected, reading the "noise" when no actual signal was detected for a while. The second time I tried to use it, it functioned in a different way, not outputting digital 1s ever and only going up to about 2V when I used a 433MHz transmitter.
My questions are: Why did this happen? Can I trust that whenever it reads those 2V it means that a signal is active? I wouldn't trust this sensor since it works in a different way than how it is supposed to, but maybe this is normal. I was hoping to find someone who has experience with this type of sensors or has had a similar problem, that's all.
I use an Arduino Uno, the receiver has no antenna, and neither does the transmitter (I believe they don't need them to solve the problem I am having)