IR transmitter and reciever with reflector up to 2m
hi, try make sport timekeeping "agility" on principle of ir transmitter , receiver on 1 side , reflectors on other. have try more variations, without success.
1st option
#include <irremote.h>
irsend irsend;
void setup ()
{
}
void loop () {
int = 38 khz; // 38khz carrier frequency nec protocol
unsigned int irsignal [] = {9000, 4500, 560, 560, 560, 560, 560, 1690, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 1690, 560, 1690 , 560, 560, 560, 1690, 560, 1690, 560, 1690, 560, 1690, 560, 1690, 560, 560, 560, 560, 560, 560, 560, 1690, 560, 560, 560, 560, 560 , 560, 560, 560, 560, 1690, 560, 1690, 560, 1690, 560, 560, 560, 1690, 560, 1690, 560, 1690, 560, 1690, 560, 39416, 9000, 2210, 560}; // analysir batch export (irremote) - raw
irsend.sendraw (irsignal, sizeof (irsignal) / sizeof (irsignal
}
it works @ distance of 4 meters via reflector, did not catch faster movement. not unusable
option 2
#include <irremote.h>
irsend irsend;
irsend.enableirout (38); // 38khz
irsend.mark (0)
captures every movement, distance within 1 meter.
do have ideas how solve it.
used equipment
arduino nano
ir leds hsdl-4230
ir reciever pna 4602
i found post, there transmitter , reciever on opposite.
http://forum.arduino.cc/index.php?topic=311521.0
here industrial solution, expensive.
https://www.amazon.co.uk/velleman-photoelectric-sensor-retro-reflection/dp/b001irvdog
1st option
#include <irremote.h>
irsend irsend;
void setup ()
{
}
void loop () {
int = 38 khz; // 38khz carrier frequency nec protocol
unsigned int irsignal [] = {9000, 4500, 560, 560, 560, 560, 560, 1690, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 1690, 560, 1690 , 560, 560, 560, 1690, 560, 1690, 560, 1690, 560, 1690, 560, 1690, 560, 560, 560, 560, 560, 560, 560, 1690, 560, 560, 560, 560, 560 , 560, 560, 560, 560, 1690, 560, 1690, 560, 1690, 560, 560, 560, 1690, 560, 1690, 560, 1690, 560, 1690, 560, 39416, 9000, 2210, 560}; // analysir batch export (irremote) - raw
irsend.sendraw (irsignal, sizeof (irsignal) / sizeof (irsignal
- ) khz); // note approach used automatically calculate size of array.
}
it works @ distance of 4 meters via reflector, did not catch faster movement. not unusable
option 2
#include <irremote.h>
irsend irsend;
irsend.enableirout (38); // 38khz
irsend.mark (0)
captures every movement, distance within 1 meter.
do have ideas how solve it.
used equipment
arduino nano
ir leds hsdl-4230
ir reciever pna 4602
i found post, there transmitter , reciever on opposite.
http://forum.arduino.cc/index.php?topic=311521.0
here industrial solution, expensive.
https://www.amazon.co.uk/velleman-photoelectric-sensor-retro-reflection/dp/b001irvdog
you don't want send (interrupted) tv code, continuous 38khz signal.
the code in void setup() of sketch that.
an arduino pin can directly drive ir led 100ohm current limiting resistor.
if distance problem, can increase led drive current external drive transistor.
the code in void loop() receiver.
transmitter , receiver can run on same arduino.
leo..
the code in void setup() of sketch that.
an arduino pin can directly drive ir led 100ohm current limiting resistor.
if distance problem, can increase led drive current external drive transistor.
the code in void loop() receiver.
transmitter , receiver can run on same arduino.
leo..
code: [select]
const byte ir_led = 11; // ir transmitter led 100ohm (minimum) cl resistor
const byte ir_receiver = 8; // receiver output
const byte onboard_led = 13; // onboard indicator led
boolean receiverstate;
void setup() {
pinmode (onboard_led, output);
pinmode (ir_led, output);
pinmode (ir_receiver, input);
// nick gammon
tccr2a = _bv (com2a0) | _bv(wgm21);
tccr2b = _bv (cs20);
ocr2a = 209; // ~209 = ~38khz | ~219 = ~36khz
}
void loop() {
receiverstate = digitalread (ir_receiver);
if (receiverstate == high) { // beam interrupted
digitalwrite(onboard_led, low); // green onboard led off
delay(1000);
}
else { // beam detected
digitalwrite(onboard_led, high); // green led on
}
}
Arduino Forum > Using Arduino > Sensors > IR transmitter and reciever with reflector up to 2m
arduino
Comments
Post a Comment