BeeHive-org / 5-choice-serial-reaction-time

GNU General Public License v3.0
0 stars 2 forks source link

IR emitter and receiver design #1

Open isobianin opened 3 years ago

isobianin commented 3 years ago

Hi Andre, here are a couple of questions regarding IR emitter and receiver.

First of all, my understanding is that what we really need is just a simple IR LED and simple IR receiver that is connected to the BeeHive. To make everything look neat and modular, we need to place all those things on PCBs. So: 1) I think that IR LED will probably be powered by BeeHive switch array. On the other hand, maybe it can be powered from the main board directly. I think to add two connectors: 2x pin and 4x pin for switch array and main board compatibility respectively. Basically, it is going to be a small board with 2 connectors, a resistor and an LED. Is that something similar to what you have in mind? 2) IR receiver can be pretty much anything as long as it can detect the fluctuations of another LED because of the rodent, am I right? Thus, I think to find something relatively cheap and place it on another discrete board and add 4xpin so it is directly connected to the BeeHive main board. What do you think? 3) Is there anything I missed? I mean, maybe boards need to be autonomous or something to have less wires? For instance, we can add a small pad for a coin cell 3V battery

amchagas commented 3 years ago

hi Ihor,

Thanks for looking into this! I was going to write more about it this week. sorry for the delay.

the application is what you mention in 2, as in, there will be an IR LED, shinning into an IR transistor/receiver. whenever an animal or whatever other thing breaks the beam, we can detect that break...

I like the suggestions you made, but I wonder if we should do it as a pair? I mean, you are suggesting two independent modules, one of LED and one for the receiver. Would it make sense to have one board with both LED and receiver? this way one JST 4 way plug from the main board could be connected to this one board and take care of everything...

one pin of the JST connector controls one transistor to switch on/off of the LED, and the receiver sends values to another pin of the JST connector .

For an IR receiver I was thinking about something like this https://uk.rs-online.com/web/p/ir-receivers/8801980

In a way this solution would require more boards for this one application (as there are 5 openings where the animals would put their noses in), but then we could also connect those boards close to where the animal interacts with the box (on the backside of the openings for instance).

Does that make sense?

amchagas commented 3 years ago

oh! and we are still going to need another set of LEDs, this time in the visible light range, for different things in box, such as the main light of the box, the reward indication, the indication of which opening should put their nose in, etc... So using the 8 switch board for that would be great!

isobianin commented 3 years ago

Hi Andre, do you mean that we have a somewhat long board that will be partially hidden by the behavioural box while the sensor and the receiver are detecting a mouse? I mean, I had this image in mind too but I thought that something more flexible may be needed. It is indeed easier to design, manufacture and install. The only thing is, well, as I said, it is not modular and flexible but probably that will do?

isobianin commented 3 years ago

Hi Andre, it seems that I am a bit confused of how to make less wires in this case. If the board is going to be powered by 8 switch then we still need to have one additional connector to collect data from the receiver. If we connect one connector that is responsible for everything straight from the main board, we will not be able to turn LED on/off (not a big deal here I think). Or if we do want to turn it on/off then it is going to get a bit complicated

isobianin commented 3 years ago

Okay, so for the particular case of IR emitter/receiver I can hook up one JST where one pin will be turning LED on/off and the second pin will receive data. 5V may be used to power IR receiver

isobianin commented 3 years ago

Hi Andre,

please, have a look at the IR emitter/receiver board (fig. 1). I made it quite long (10 cm) as I was not sure how much space there should be. Also, I omitted adding mounting holes for now because I suppose it will be just lying somewhere in the box? The IR LED I chose is this one. It is fed by 5V line so if JST connector is in, it will start working.

imag Fig. 1 - IR board

amchagas commented 3 years ago

Hi @isobianin thanks for designing this one!

I think a more versatile appriach here would be to have 2 pin JST connectors instead of the LED and phototransistor foot prints.. this way the board can be smaller and people could attach their leds and phototransistor to dufferent devices/use them in different applications...

another note, is that since we already have a 4 pin JST connector coming from the mainboard, we could add a transistor to turn the IR led on and off, or we could add another phototransistor and another IR LED to this board? so the digital lines would be one for each phototransistor and the LEDs would be permanently ON, as they would be connected with the 5V power line.

last point is I cannot properly see the connections on this image that you shared, but it looks as if both LED and phototransistor are connected to the same digital line on he board?

isobianin commented 3 years ago

Hi Andre,

to be honest, I am not sure I follow your line of thought. Do you mean that we leave the board as it is but just replace LED and phototransistor with jst connectors?

The way it is wired right now is that 5V line feeds LED and it is also supplied to the collector of VT. The digital line is used to register output from the phototransistor and transmit it to the ESP. Another digital line is free imag

isobianin commented 3 years ago

In other words, should we go with the variant 1) or 2) when we are talking about the modular approach? image

isobianin commented 3 years ago

Hi @amchagas , please have a look at the second version of IR board.

What I did is I made a board that is responsible for all 5 IR pairs (fig. 1). LEDs and phototransistors are connected to the board via 2pin connectors. LEDs can be switched on/off through MOSFET switch. I chose MOSFET as it seems that the transistor used for a single LED in our 8_switch_array would be working at its absolute maximum regrding the collector current while MOSFET has no problem working in these conditions. All other 4pin connectors are used to receive data from phototransistors. imag Fig. 1 - IR board schematics

amchagas commented 3 years ago

Hi @isobianin , sorry for the extreme delay in this one!

It looks neat! Do I understand correctly, that you have one MOSFET switch that turns on all LEDs at once, and then the IR phototransistors can be read independently?

Thanks for putting it together, now it is on to ordering the board and testing it...

isobianin commented 3 years ago

Hi Andre,

yes it does use a single MOSFET to control all LEDs at once. Otherwise, as I see it, we would have to use either more connectors or use a level shifter with at least one more additional connector. Apart from cameras and sensors, IR light should not be a problem when they remain turned on.

Yes, all IR sensors can be read independently.

amchagas commented 3 years ago

great, thanks!