hi i am still new to all this arduino coding and just want to make sure i don't cause any damage to my mega board by connecting it up wrong
i have an RF device which watches for a signal from the transmitter.
once it receives the signal it will pulse 3V to one of its recving pins
i would like to detect when it turns the pin from GND to 3v
the image above shows the reciver board.
the pin marked is either high or low
i need to detect whether it high or low
if it's high i want to run a function if it low just ignore
whats the best way to connect this to the mega board
and what code can i use to detect in the main loop
thanks in advance for any replys
Robin2
August 24, 2015, 2:57pm
2
If you are sure that the voltage on the pin will never ever exceed 5v you can connect it directly to an Arduino I/O pin and also (of course) connect the GND to the Arduino GND.
Although the Mega works with 5v it should correctly detect 3v as HIGH.
How long does the pulse last ?
If it is very short-lived you will probably need to use an interrupt to detect - read about attachInterrupt().
If the pulse stays high for a few millisecs you will probably be able to detect it by polling the relevant I/O pin.
...R
its 3 or 4 short bursts of data
the voltage is 1.8—3.6V working voltage
and the trigger will stay at high as long as the transmit button is pressed
so im going to put it into the main loop on a poll as the board isn't doing that much else
so its ok to do a if such a pin is high etc
on one of the digital pins then safely?
system
August 24, 2015, 5:50pm
4
so its ok to do a if such a pin is high etc
on one of the digital pins then safely?
Yes, just be sure to read the pin with the yellow wire connected to it. Oh, wait, that's all of them. Why?
because i only need to read one pin. ???
system
August 24, 2015, 9:37pm
7
because i only need to read one pin
That would be the one with the yellow wire connected to it, right?
MarkT
August 24, 2015, 10:03pm
8
3.3V should reliably read as HIGH, 3.0V is borderline (in practice you are likely to get away with it,
but this is luck, not design)
yes paul pin No 3 not that it makes a difference to the question
thanks everyone. it works a treat