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.
@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!
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).
@tylernt it was not a dumb question, I asked myself the same! 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.
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.