HELP needed: IR communication with LightBlue Beans 2 channels or more

Hi!
Objective :
I need to make communicate a "chain" of LightBlue Beans (sense neighbors and pass info) and it must be something that allows each part to be independent and easy to connect (by children).

Ideas:

  • The First idea was to connect them with magnets. I tried with softSerial (all the version I could find) but could not make the serial work, only the standard one. But that means only one serial channel: only one side connection. I need at least 2. Also, alignment of the contacts might be a problem... because of size.

  • The Second idea was to use IR: 2 IR-receiver and 2 IR-LED per unit (potentially more...), one of each per side.

Problem:
Idea 1 is not working, I just cant make a second serial... No matter what.
Idea 2 could be, but most of the sample I found online use IR as serial... that fall back on making work another serial... That I can't do, apparently.

Question:
Is it possible to make communication using IR in a easy way?
Something like a remote command but with many commands (my guess is nID+command-> [up to 12 ID][~6 commands, not sure here how many will be needed] ) ?
If so, is there an example I can take inspiration from? Something simple, I don't have that amount of knowledge to reprogram registers and similar...

Thanks a lot in advance!

Mote

PS: I'm open to suggestion of different ways! I considered briefly induction coils... but that would go too much in electronic... of which I have no experience and knowledge.

Cool picture ...sort of reminds me of a PACMAN! (sideways)

In general, you can get 2400 baud with IR & a quality IR receiver. Some receivers are designed to reject continuous data as noise!

NB: The output of an IR receiver is inverted!

The best way for you to do it might be:

  • use a library like IRLib or IRremote.
  • emulate a tv remote eg NEC protocol.
  • this gives you a 32 bit signal to play with.
  • just map the available 32 bits into the command structure you need.
  • you can of course use 8 or 16 bits via NEC is you want.
  • Different IR reciever models are optimised for particular protocols/environments.

FYI: Disney use serial 2400 baud for their Glow with the Show hats that are controlled by IR, using standard IR receivers. (SMD mounted)

Other issues ?:

  • all receivers may receive every signal if the devices are close, uncless you are careful with the physical layout.
  • beware of interference from sunlight
  • only use quality IR receivers (e..g. Vishay)...avoid the cheap ones available online.
  • make sure your design allows for undelivered messages. (you can send 2 or 3 times)

@AnalysIR Thanks for your comment!
Now that you mention it is a little bit like pacman phantoms...
Anyway...
Can you give me an example of the standard IR receiver? (link?)

I have this "raw" things:
A couple of IR-LED as transmitters and a couple of phototransistor (of compatible wavelength).

I'll try with the libs for IR and remote commands, might be enough... hopefully!

Thanks again!

Use a standard IR receiver with 3 pins.

Something like TSOP34438 or TSOP4038

I would need to know more about the actual physical environment setup.

i.e distance apart, location, indoors, daytime/nightime, number of units.

Until then I would start with the more general purpose TSOP34438.

FYI to use these IR receivers, you need to generate a modulated signal @ 38kHz for the above.

Search for sbprojects IR to get an understanding.

If you have any more specific questions please supply lots of details as backup.

I checked that device out & it seems like a nice unit.

Dumb question... these Beans appear to have Bluetooth. Why aren't you making them communicate with each other over Bluetooth?

As for IR, using photodiodes and phototransistors is "iffy" because of ambient IR (sunlight, fluorescent, etc). 3-pin IR receivers have an AGC (Automatic Gain Control) circuit that lets them operate over a wide range of conditions. Unfiltered IR can still be done, though you'll have to pick a fixed bias resistor and be stuck with that level of sensitivity (be it high and risking signals being swamped by interference, or low and being relatively blind to signals).

Dumb question... these Beans appear to have Bluetooth. Why aren't you making them communicate with each other over Bluetooth?

Yeh, I has thought that too but had assumed they were only 1 to 1 when paired.

Probably worth checking out if there is any sort of broadcast mode, 1 to many or many to 1 comms available with them.

@tylernt it was not a dumb question, I asked myself the same! :smiley: But the answer is more complex, every element of the "chain" need to know who is at its side(s) or if there is no one, and transmit at one (or both) side per time some command that will affect the behavior.
By using only the bluetooth I'll have to create a software (from which the system will be totally dependent, and right now it should be as independent as possible) that intersect all the event created (connections etc...) and simulate what's happening in the real environment. There is a big chance to have condition that cannot be distinguished (eg.: 4 blocks, 2 connects and at the same time other 2 get connected). I need to know "WHO and WHERE" at all the time. Much easier to just invent a way to connect and exchange messages.

Right now the beans cannot change "modality" of transmission, in bluetooth dev you have only 2 possibilities, or you are an advertiser (broadcaster) or you can exchange messages. It is not possible (yet) to simulate UUID of other peripherals. So the beans cannot (yet) connect with each others, it is only possible: many beans to 1 main handler (pc, phone, etc...).

@AnalysIR, More details:
When I mentioned a chain I mean that one of the (flat) sides will be in contact with the other element using magnets, but not in conductive contact. So I'd say that there is a good possibility to not have IR noise from outside during this exchange and I could set a very high threshold to have them talk ONLY when they are very very close to each other.

I did not understand properly... do I need to create the 38kHz+ signal with the TSOP4038(or similar) or with the phototransistor?
I'm afraid I still have a lot of confusion on how to operate with IR connections, I'll try to have a look to some example project and maybe I'll have more clever questions :D.

Thanks a lot!

do I need to create the 38kHz+ signal with the TSOP4038(or similar) or with the phototransistor?

The 38kHz signal should feed into (drive) the transmitting IR LED. The IR Receiver demodulates this received signal.

The IR receiver only reads modulated signals. That is why I suggested you do a search in my earlier post....all will be revealed if you do.

If there are several units very close, then they will all receive the IR from several units. (Think of turning on a very dim light in a dark room - it can be seen from everywhere in the room, unless it is physically blocked from view)

If you post better details of the likely layouts and functions, you will probably get better suggestions/solutions.