I connected a digital pin of Arduino to data pin of an RF434Mhz receiver. When transmitter was sending 0, the output of receiver was around 0.6V.
But, my arduino is reading it as logic HIGH. How can I solve this issue?
I connected a digital pin of Arduino to data pin of an RF434Mhz receiver. When transmitter was sending 0, the output of receiver was around 0.6V.
But, my arduino is reading it as logic HIGH. How can I solve this issue?
You could add a pull down resistor but there must be something wrong I dont think an arduino would read 0.6v as high
When a pin is configured as an INPUT with pinMode() , and read with digitalRead() , the Arduino (Atmega) will report HIGH if: a voltage greater than 3 volts is present at the pin (5V boards); a voltage greater than 2 volts is present at the pin (3.3V boards);
So it has to be a problem with your code.
M..........
Are the GNDs of the two devices connected together?
For a 5V avr the pin will read high if the voltage is over 3v. It will read low if the voltage is less than 0.6.
However for the bit in between it floats and digital read can return 0 or 1 at "random".
Check the grounds are connected and use a pull down.
Mark
Disconnect the sensor and connect the pin to ground. If it still reads as high then it is stuffed.
A 433Mhz receiver outputs random digital hash when a transmitter is "on" or "off".
You can't just measure that with a DMM or read it with the sketch.
A transmitter has to send a complex CODE to the receiver.
That data has to be decoded with the proper library.
Try the "RCSwitch" library. It has send and receive examples.
Leo..
The DMM read 0.6, but the signal is changing rapidly, so the results you'll get from a DMM will be garbage.
If you hooked it up to a scope, you'd see what's really going on - the receiver is spitting out noise, because it's automatic gain control seeks 50% duty cycle, and in the absence of a signal it will adjust it's gain until the noise is producing a dutycycle that makes it happy. Your code needs to ignore junk, and look for a signal. Because of the ACG, you need to either send a "training burst" or preamble to your messages, consisting of just a 50% dutycycle squarewave to get the receiver(s) adjusted, or send the message multiple times, and use the previous iterations of the message to train it. Bits should be a few hundred microseconds long, not more than 1000, and if the dutycycle for 11111111 or 00000000 is too far from 50%, it also won't work.
The virtualwire library does all that stuff for you - it comes highly recommended (though I rolled my own protocol, for various reasons, many of which are bad or not relevant to you)
According to ATMega datasheet any voltage sent (Vol= V output low) <= 0.9V is considered as a LOW..
Source: Atmel-datasheet_Complete.pdf
page 313..