Something odd - if I do Rx available - the component toggles the Rx pin at 300us intervals.
If I set Tx available - then the pin behaves as expected (held high) and I can see the signal received (on a logic analyser) if I press a button on the control....
Modulo Ky-022 Sensor Receptor Infrarrojo Ir Pic
-
mnfisher
- Valued Contributor
- Posts: 2077
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 162 times
- Been thanked: 958 times
-
mnfisher
- Valued Contributor
- Posts: 2077
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 162 times
- Been thanked: 958 times
Re: Modulo Ky-022 Sensor Receptor Infrarrojo Ir Pic
Using the Rc5_Receive from the above link - the sensor does receive data correctly (not whilst using the component!)
Somewhere there is a better version that uses a pin change interrupt not the busy_wait as in this code.
There was a lot of discussion with Jan about this...
Somewhere there is a better version that uses a pin change interrupt not the busy_wait as in this code.
There was a lot of discussion with Jan about this...
-
ELECTRONICA67
- Posts: 185
- Joined: Wed Dec 02, 2020 3:59 pm
- Has thanked: 31 times
- Been thanked: 9 times
Re: Modulo Ky-022 Sensor Receptor Infrarrojo Ir Pic
Hi
I really appreciate your help. I've been working day and night for two weeks on a solution. I was confident there wouldn't be a problem, but sometimes these situations arise. The problem is that I'm pressed for time. I did something simple with an IR photodiode as a pulse counter: it would send 10 pulses and open, then with another IR remote it would send 20 pulses and close. But it wasn't reliable. It had to be at a distance of 10 or 20 cm, and there was a lot of noise in the receiver with the light, not to mention sunlight. I've tried using Flowcode and a receiver like the KC-022, which is commercially available, to at least receive two signals, but I haven't been able to get it to work. That's why I think it might be a bug.
Thanks again, and I really appreciate your help.
Enrique
I really appreciate your help. I've been working day and night for two weeks on a solution. I was confident there wouldn't be a problem, but sometimes these situations arise. The problem is that I'm pressed for time. I did something simple with an IR photodiode as a pulse counter: it would send 10 pulses and open, then with another IR remote it would send 20 pulses and close. But it wasn't reliable. It had to be at a distance of 10 or 20 cm, and there was a lot of noise in the receiver with the light, not to mention sunlight. I've tried using Flowcode and a receiver like the KC-022, which is commercially available, to at least receive two signals, but I haven't been able to get it to work. That's why I think it might be a bug.
Thanks again, and I really appreciate your help.
Enrique
-
mnfisher
- Valued Contributor
- Posts: 2077
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 162 times
- Been thanked: 958 times
Re: Modulo Ky-022 Sensor Receptor Infrarrojo Ir Pic
Hi Enrique,
Jan and I managed to get it to work very reliably on AVR and PIC (which didn't support an either edge interrupt). It's not quite the same as a component (no simulation) - but it might do the trick for you?
I'll try and find the latest version / topic....
Martin
Jan and I managed to get it to work very reliably on AVR and PIC (which didn't support an either edge interrupt). It's not quite the same as a component (no simulation) - but it might do the trick for you?
I'll try and find the latest version / topic....
Martin
-
ELECTRONICA67
- Posts: 185
- Joined: Wed Dec 02, 2020 3:59 pm
- Has thanked: 31 times
- Been thanked: 9 times
Re: Modulo Ky-022 Sensor Receptor Infrarrojo Ir Pic
Hi Martin,
I would really appreciate it if you could do that.
Thanks
Regards
Enrique
I would really appreciate it if you could do that.
Thanks
Regards
Enrique
-
mnfisher
- Valued Contributor
- Posts: 2077
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 162 times
- Been thanked: 958 times
Re: Modulo Ky-022 Sensor Receptor Infrarrojo Ir Pic
I managed to find a lot of stuff for the NEC format - less for the RC5 
However - having just done a Manchester format decoder for the wireless comms - I think I can pull the bits together fairly easily.
Couple of things...
Did you manage to get RC5_Receive to work?
Which MCU are you aiming for? Some PICs have less flexible PIN change interrupts (rising OR falling rather than both) - which we can sidestep by toggling the direction bit after each interrupt...
Martin
However - having just done a Manchester format decoder for the wireless comms - I think I can pull the bits together fairly easily.
Couple of things...
Did you manage to get RC5_Receive to work?
Which MCU are you aiming for? Some PICs have less flexible PIN change interrupts (rising OR falling rather than both) - which we can sidestep by toggling the direction bit after each interrupt...
Martin
-
ELECTRONICA67
- Posts: 185
- Joined: Wed Dec 02, 2020 3:59 pm
- Has thanked: 31 times
- Been thanked: 9 times
Re: Modulo Ky-022 Sensor Receptor Infrarrojo Ir Pic
Hi
I couldn't receive any information. I'm using the PIC12F1840 as the transmitter and the PIC16F1847 as the receiver.
The KC-022 sensor only flashed an LED when you transmitted an IR signal to it, but the receiver didn't read any data.
What model of IR sensor are you using
Enrique
I couldn't receive any information. I'm using the PIC12F1840 as the transmitter and the PIC16F1847 as the receiver.
The KC-022 sensor only flashed an LED when you transmitted an IR signal to it, but the receiver didn't read any data.
What model of IR sensor are you using
Enrique
-
mnfisher
- Valued Contributor
- Posts: 2077
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 162 times
- Been thanked: 958 times
Re: Modulo Ky-022 Sensor Receptor Infrarrojo Ir Pic
That's maybe two problems then - can you try the transmitter that came with the receiver boards?
I'm using the same board ky-022 from a pack of sensors.
If you are using the rc5 component to transmit - the data out might be wrong?
Martin
I'm using the same board ky-022 from a pack of sensors.
If you are using the rc5 component to transmit - the data out might be wrong?
Martin
-
ELECTRONICA67
- Posts: 185
- Joined: Wed Dec 02, 2020 3:59 pm
- Has thanked: 31 times
- Been thanked: 9 times
Re: Modulo Ky-022 Sensor Receptor Infrarrojo Ir Pic
Yes, I was using the RC5 component, with the KY-022 sensor and its original IR transmitter or controller.
-
ELECTRONICA67
- Posts: 185
- Joined: Wed Dec 02, 2020 3:59 pm
- Has thanked: 31 times
- Been thanked: 9 times
Re: Modulo Ky-022 Sensor Receptor Infrarrojo Ir Pic
But I need to create an IR controller using the PIC12F1840 that can send multiple numbers to the receiver and have them decoded, for example, 10, 20, 50, or 100.
so that it can read four different values.
so that it can read four different values.