I recently built an interactive LED table. The table consists of 49 squares that each have IR sensor to detect if an object has been placed on the table. Now during the evenings the table works great but daylight wreaks havoc on the IR sensors (I will put a link below to the sensors that I am using); it is also quite tricky to get a reading on a glass object, I have angeld the sensor to work on a certain type of glass object but then ceases to work on another.
The reason I picked them is because they are quite cheap at about 1$ each and I needed 49 of them. I have been searching for an alternative to these sensors but I have come up black. Doesn't anyone know of an alternative that I could consider ? I appreciated any info/advice.
Industry solved your problem many decades ago by modulating the LED source 38kHz and receiving the same signal on the the IR sensor. When the signal is gone, the IR is blocked. When the sensor receives a 38kHz signal, it is from your reflection.
Paul_KD7HB:
Industry solved your problem many decades ago by modulating the LED source 38kHz and receiving the same signal on the the IR sensor. When the signal is gone, the IR is blocked. When the sensor receives a 38kHz signal, it is from your reflection.
Wessel0203:
Thank you for the response. Modulating by PWM ?
You can read some basics about IR modulation here - IR Remote Signals | IR Sensor | Adafruit Learning System
Popular PNA4602 IR sensor and its analogs (TSOP4038, TSSP4038, TSOP34338,TSOP32338 etc) have an embedded de-modulator, so you will get a signal only when modulated signal detected.
Ok I will take a look. I had no idea about IR modulation so I will research a bit. I do not need to send any data by IR I just need to detect presence of an object. The IR detector and emitter need to be next to each other and be able to detect an object above them. Distance of object will be around 45 mm above the sensor.
I also need 49 of these modules so I used the Sensors that I linked to keep the cost low as they were 1$ per module.
Will I be able to modulate from the Arduino directly or will I need external 555 circuits (I am guessing external 555 circuit since the Mega has only a few PWM outputs.) ? In the event of external 555 circuits would I be able to drive all 49 IR LEDs with a MOSFET/s (49 LEDs would need around 1 amp to drive) and a single 555 circuit ? Sorry for all the questions I am not familiar with 555 timers.
You can use tone() for IR modulation. Your sensor is "dumb" sou you will need to check presence of modulation frequensy in your code. It;s durable but requires some extra coding . In that case you can select any frequency for your modulation . Or you can keep your IR led but use sensor with embedded de-modulator. It will change state of output pin only when modulation frequency detected. You don't need to send any data. You can constantly feed all your IR diodes from the same source of modulation .
A logic level MOSFET will easily work to drive 49 IR LEDs at 1 Ampere, total.
The typical 555 timer output cannot sink or source more than about 200 mA, but there are many versions, so always check the data sheet for the one you have, or are planning to buy.
jremington:
A logic level MOSFET will easily work to drive 49 IR LEDs at 1 Ampere, total.
The typical 555 timer output cannot sink or source more than about 200 mA, but there are many versions, so always check the data sheet for the one you have, or are planning to buy.
Thank you I will use MOSFET either way just to be safe, I have bunch lying around. Will the MOSFET be quick enough to switch at 38kHz ?
Is the Vishay TSSP4038 a decent receiver for beam detection and could I pair any old IR led with it ? I also found a TSSP58038 but it is more expensive.
I have some IRLB8721s at home so planning on using those since the gate can be driven by 3.3V or 5V logic and has a decent. Could I not drive the gate straight off of the 555 timer output ? Looking at using LMC555.
Wessel0203:
Is the Vishay TSSP4038 a decent receiver for beam detection and could I pair any old IR led with it ? I also found a TSSP58038 but it is more expensive.
Cross interference between some types of sensor could be a problem because some are extremely sensitive. You can mitigate this to a certain extent by a scanning technique where the led illuminating the object is active during its turn.
Some sensors deliver only a binary result back, detection or no detection, which means the only means of adjustment is physical positioning of the sensor.
Some proximity sensors do deliver some graduated result back say by timed pulses proportional to distance or a digital signal.
Depending on how your table is constructed, you may be able to use a method similar to one I used for detecting objects in a mailbox. That used 4 IR LEDs, embedded in a mat at the base of the mailbox, switched on sequentially in a round robin configuration together with one single TSOP type device to detect a beam break. The project is here: Arduino NRF24L01 Mailbox Monitor/Notifier - Exhibition / Gallery - Arduino Forum
But, anyway, some experimentation with various types of solution is going to be necessary to cover reliable detection for all types of target object, their placement, resistance to flooding by sunlight etc. etc.
So just to give you guys an idea I have uploaded an image of what the table looks like. Each sensor will have its own "pocket" so they will not interfere with each other. Its works perfectly at night but sunlight the sensors go wonky. Luckily you gentleman/ladies pointed out about the 38kHz modulation so that is what I will try.
6v6gt:
Some sensors deliver only a binary result back, detection or no detection, which means the only means of adjustment is physical positioning of the sensor.
That is perfect for what I need I only need detection, so no data need to be sent. I will maybe add some rotary pots for the emitters to adjust the senor sensitivity. I will also be sure to checkout your project, the rotating sensors is a good idea.
Thank you sir, can this code be executed on any pin or does it need to be a PWM pin ? I need to ad 49 LEDs. Also could you perhaps elaborate what your code does as I do not recognize the syntax in the setup function below the pinMode instruction.
The kit looks perfect, except that from Amazon and other distributors of "no name" parts, there is a very high risk of defective, reject or even counterfeit parts.
Don't expect all of them to work, so test each part separately before you install it.
jremington:
The kit looks perfect, except that from Amazon and other distributors of "no name" parts, there is a very high risk of defective, reject or even counterfeit parts.
Don't expect all of them to work, so test each part separately before you install it.
That is true. Thank you guys, hopefully this will solve my sunlight problem.
Will I be able to drive a logic level MOSFET gate from the arduino @ 38kHz ? I have some IRLB8721s at home and planning on using those. So at 38kHz the charge time for the MOSFET needs to be less than 26μS correct ? According to the data sheet the td(on) is 9.1ns the tr(rise) is 93ns. Is the total switch time 102.1ns / 0.1021μS ? Which quicker than the required switching correct ? Please shine some light if I am reading into this incorrectly.
jremington:
The MOSFET switching time will depend on how fast you charge/discharge the gate capacitor.
If from an Arduino output, the current should be limited to about 20 mA with a resistor, typically 220 Ohms.
From the IRLB8721 data sheet, the gate charge is 7.6 nC, so the total charge time (t = Q/I) at 20 mA would be about 380 ns.
Well I will be charging at 38kHz from the arduino output. So theoretically (if I understand correctly) if in needed the MOSFET at 26us I would need to supply 7.6/26000 = 0.29mA. But obviously the fast the better so the 20 mA should be more than enough.
Looking at the gate voltage on the data sheet (1.8v typ) wouldn't I need a lower value resistance ? (5 - 1.8)/20ma = 160 Ohms.
The season I was asking is because while researching I see many circuits where the MOSFET was being driven by a BJT, but I have driven logic level MOSFETs directly from the arduino so I was just checking to make sure it will still be possible at this high frequency.
Thanks for taking the time to help me I really appreciate it.