Cheap Wireless COM between two attinys. Problems with IR.

Discussion in 'The Projects Forum' started by Antonio beta, Feb 21, 2019.

  1. Antonio beta

    Thread Starter New Member

    Jul 27, 2017
    2
    0
    Hello, internet
    First of all I will put you in situation,
    my project consists on making two PCBs controlled by an Attiny and powered by a micro lipo battery or a coin cell battery.

    I need to be able to communicate between the tow boards, a simple, 3 bits message from each of them to the other.

    The range needs to be around 0.5 / 1 meter and the method to be as cheap as possible, so I thought using infrared and create my own communication protocol so they are not emitting at the same time and thus avoid interference with the IR leds.

    However I have had a lot of problems with the IR and this is the reason I am here to ask about it. I am still not decided by this communication system, so if someone has any other idea, I am open to try them.

    For the part of IR I have had the following problems:

    Testing a sensor modulated [VS1838r] I have not gotten what I wanted it to be, to get simple 1s and 0s.
    This sensor only answered me only to rising edges and that made the logic of my communication protocol difficult for me to program, so I want to simplify this as much as possible before starting with the real coding.

    I also thought about using a photodiode, however it only works when it is very very close to the emitter LED so it does not work for mi application. I have tried using a led driver without results, maybe I need to modulate it but i don't know how to or if it is even possible without making the project to difficult/expensive.

    In this link [https://forum.arduino.cc/index.php?topic=596356.0] you can see all the details of my tests with the photodiode (second page) and with the vs1838r so that you can understand what I have been doing and how was I doing it.

    Any ideas?

    Thank you!
     
  2. KeithWalker

    Member

    Jul 10, 2017
    265
    82
    I have played around with IR communication with Arduino using TV remote type IR receiver LEDs and with simple IR emitting LEDs.
    The VS1838 infra red detector receives signals modulated on a 38KHz carrier and makes an extremely reliable communication link with a range over three meters but the communications protocol is fairly complicated. There are some excellent articles available on-line with examples.
    I have used a simple IR emitting LED and IR detecting diode quite successfully for transmitting data over two meters using both modulated and DC signals. It was necessary to focus the transmitter and receiver diodes with simple lenses to get that range and I had to shield the receivers from ambient light.
     
  3. Antonio beta

    Thread Starter New Member

    Jul 27, 2017
    2
    0
    Yeah that's my problem the VS1838 did not worked as I expected because it only answers to rising edges and not to level. It is all explained on the link.

    And for the second part that's what I want to do, is to take a normal photodiode and modulate it myself for extending the range, but I haven't found any good information about how to do it. Do you have any?

    If I could I would like to not use lenses since that will concentrate the light quite a bit and in the moment of the communication the two devices will be on the hand of two persons so it needs a wider margin on the emitter angle. Do you think I will achieve the range I need without the lenses?
     
  4. MrChips

    Moderator

    Oct 2, 2009
    18,696
    5,939
    I have used 38kHz IR sensors and have found them to be extremely sensitive and reliable. You can bounce the signal off walls and they still pickup the information. What modulation protocol and baud are you using?
     
  5. KeithWalker

    Member

    Jul 10, 2017
    265
    82
    Using simple IR photo emitters and detectors without lenses will not give you the range you need. You can increase the range a bit by carefully selecting the devices you use. Pick those that have high radiant intensity and narrow angle of half intensity. You can also use two or more IR emitting sources working together.
    You still need to shield the receiver from ambient light, even if you are using modulation because sunlight and other bright lights can swamp the signal completely.
    I used 2Khz as a carrier frequency for a simple ones and zeros coded signal, just to eliminate interference from AC light sources, especially fluorescent lights. If you are thinking of transmitting voice you will need a higher carrier frequency.
     
Loading...