TSOP and IR sensors ??? - Page 1
Forum section: electronics / beginners

author: RobH
author_rank: Regular Contributor
timestamp: November 20, 2021, 05:59:49 pm
content: Basically, I'm in a muddle!!I am trying to build a visitor counter using 7 segment displays and 4026 ics. The schematic I amusing comes form gadgetronicx website and calls for a TSOP1738 on the main circuit and also a IR transmitter circuit.I have put both circuits together but , although the receiver works from a tv remote, the transmitter IR led doesn't seem to work . When I place an object between the TSOP1738 and the IR led nothing happens.This is the link to the said circuits:https://www.gadgetronicx.com/people-object-counter-circuit-diagram-ic555/Thanks

author: jpanhalt
author_rank: Super Contributor
timestamp: November 20, 2021, 07:05:58 pm
content: Have you checked that the transmitter is transmitting? You can see it with any solid state camera viewfinder.At best, that transmitter circuit gives a solid CW IR signal. The receiver won't very sensitive to that. Look at the datasheet, and it shows the modulation to use. A second 555 can easily do that.

author: RobH
author_rank: Regular Contributor
timestamp: November 20, 2021, 08:11:14 pm
content: Thanks for the reply, but I don't have a solid state camera, and nor do I have access to one. I'll have to see what other way I can check if it is transmitting.Edit:Using a multimeter in diode mode, the transmitter IR led gave a reading of 1.29, and the receiver led , in Ohms, gave a reading of approx 1.5M ohm. That was across the positive and negative pins.

author: Twoflower
author_rank: Frequent Contributor
timestamp: November 20, 2021, 08:23:58 pm
content: I would take the bet that you have few of them accessible. Smart phones have two (or more) solid state cameras build in.But be from my experience the main cameras have a strong IR filter but the 'selfy' cam works as IR detector reasonably well. Also normal cameras might have a well working IR filter build in. You should check that with a working IR remote before come to the conclusion that the no IR radiation is transmitted. I killed one IR LED because the used camera was totally IR blind (iPhone 4S main Cam).

author: Benta
author_rank: Super Contributor
timestamp: November 20, 2021, 08:51:02 pm
content: Sooo...A handful of resistors and capacitors with tolerances, plus a 555 with even worse tolerances shuld produce an exact 38 kHz frequency?Not very likely..How I hate 555 circuits. They lead people astray.

author: Manul
author_rank: Super Contributor
timestamp: November 20, 2021, 10:39:35 pm
content: The problem is that this type of IR receiver can not receive CW signal, only modulated. You need to look into what is called IR "light barrier", "fast proximity", "presense detect" receivers. For eg. TSSP4038. Notice, that they don't have AGC (auto gain control) in the block diagram. They can accept CW, unmodulated. These, which have AGC just eliminate your CW signal as ambient / noise.

author: Benta
author_rank: Super Contributor
timestamp: November 20, 2021, 10:49:25 pm
content: Quote from: Manul on November 20, 2021, 10:39:35 pmVery good point and completely correct. Yet another reason to dislike untested "paper" 555 designs from the interwebs. So many charlatans out there.

author: RobH
author_rank: Regular Contributor
timestamp: November 20, 2021, 11:05:01 pm
content: The camera on my smartphone doesn't see anything apart from the actual LED on the board. Also with the selfie camera, it doesn't see anything like waves , etc..What am I actually looking for with the phone camera.

author: RobH
author_rank: Regular Contributor
timestamp: November 20, 2021, 11:10:30 pm
content: Thanks for the replies above and the one regarding the TSOP 1738. It seems then that it is not suitable for what I want in the said circuit.What would I be better off using then.Thanks

author: Benta
author_rank: Super Contributor
timestamp: November 20, 2021, 11:14:39 pm
content: Quote from: RobH on November 20, 2021, 11:05:01 pmLook, both Manul and I agree that what you have is a cr*p circuit. It just won't work.The transmitter frequency is undetermined (but hopefully somewhere between 20 and 50 kHz), and the receiver will not understand what you're transmitting anyway.Remember the old light barriers in a shop from the 80s? An incandescent lamp with optics, and an LDR, also with optics? Worked great.

author: Manul
author_rank: Super Contributor
timestamp: November 20, 2021, 11:20:17 pm
content: Quote from: RobH on November 20, 2021, 11:05:01 pmYou said you have TV remote. So take that and test your camera. Usually just a slight glow is visible when LED is shining directly into the camera. If you know that your camera works, test your transmitter. If it also glows, test frequency. If it is correct, try to put in front of receiver and do fast beam interruptions. But there is no guarantee that TSOP1738 will work at all, or if it will somewhat work, it is still not supposed to be used for such application.

author: Benta
author_rank: Super Contributor
timestamp: November 20, 2021, 11:29:48 pm
content: Quote from: RobH on November 20, 2021, 11:10:30 pmFirst off, parts that are not obsolete (the TSOP1738 is).Relevant parts can be found here:https://www.vishay.com/ir-receiver-modules/Second, the idea is not bad. But you'll need to modulate and drive the IR LED correctly. And you'll need to receive (or evaluate) the received data correctly.The idea is good in that it's pretty immune to outside optical disturbances, but the 555 "solution" is laughable.

author: Benta
author_rank: Super Contributor
timestamp: November 20, 2021, 11:32:20 pm
content: Quote from: Manul on November 20, 2021, 11:20:17 pmActually, most cameras and mobile cameras have a filter against this, unless they're very cheap. I'm not sure this will work.

author: jpanhalt
author_rank: Super Contributor
timestamp: November 20, 2021, 11:35:05 pm
content: Quote from: RobH on November 20, 2021, 11:05:01 pmHave you ever heard of running "controls" with any test? There are two types, positive and negative. Did you try a positive control? Hint: Power that IR LED with DC and see whether you see it lit? Maybe, you just have it installed backwards.

author: Manul
author_rank: Super Contributor
timestamp: November 20, 2021, 11:52:37 pm
content: Quote from: Benta on November 20, 2021, 11:29:48 pmYes, the modulated barrier is better, it is more resistant to interference and ambient light. Although, as far as I remember, it is slower. So if application requires fast reaction, CW is probably the way to go. I was building IR light barriers for race timming some 10 years ago and I went with CW there. Putting transmitter and receiver inside short black pipe solves the interference issue. Also CW system is simpler, that is also an advantage for a hobbyist. 555 timmer could be ok, but needs a pot for manual frequency adjustment, frequency should be around +-3% accurate.Quote from: Benta on November 20, 2021, 11:32:20 pmYeah, I know, but some cameras show the 940nm as a slight glow of LED die. 940nm is not super deep into infrared, and also filters are not perfect. So worth a try. If no, then no.

author: jpanhalt
author_rank: Super Contributor
timestamp: November 21, 2021, 07:05:22 am
content: About 20 years ago, I used a pair of 555's to give a proper modulated IR signal. That was certainly not unique. I believe the Paisley site (http://www.circuitous.ca/LM555.html) also has a circuit for doing that.In case it might help, I have attached the .asc file from LTSpice. With a long time scale, you can see the bursts ("IR_555_sim.png"). Expanding that, you can see the individual signals ("Capture.png").

author: RobH
author_rank: Regular Contributor
timestamp: November 21, 2021, 07:33:59 pm
content: Thanks again for all the replies etc, and I will try adding another 555 to the transmitter circuit to see if that helps it. If not then I'll scrap it and find somethingelse.I don't have any test equipment except a digital multimeter, and I am only an amateur at this.

author: Manul
author_rank: Super Contributor
timestamp: November 21, 2021, 08:13:04 pm
content: If your multimeter can show frequency, measure and ensure that it is close to 38khz.

author: Benta
author_rank: Super Contributor
timestamp: November 21, 2021, 08:41:05 pm
content: Quote from: RobH on November 21, 2021, 07:33:59 pmWhich wil only make your problem worse. Then you have even more tolerances to fight with.A 50 cent, 8-pin microcontroller would be a better option.

author: RobH
author_rank: Regular Contributor
timestamp: November 21, 2021, 08:47:20 pm
content: Quote from: Benta on November 20, 2021, 11:32:20 pmYes there is a slight pinkish glow when I put the phone camera close to the ir transmitter sensor, and from a 9v supply there is approx 3.2v. I don't have anything to test the frequency of it tho'.What are fast beam interruptions, is that like placing something in between both transmitter and receiver. In that case, as I said initially, nothing is registered on the 7 segment displays.Thanks

author: RobH
author_rank: Regular Contributor
timestamp: November 21, 2021, 08:51:56 pm
content: Quote from: Manul on November 21, 2021, 08:13:04 pmYes I have a meter which can measure frequency, but how do I do it.Thanks

author: jpanhalt
author_rank: Super Contributor
timestamp: November 21, 2021, 09:21:30 pm
content: Quote from: RobH on November 21, 2021, 08:47:20 pmOK. that's a positive control. So your IR emitter is not emitting. Turn it around and see if that works. Or, as suggested before, just connect a battery to it through a resistor and see if that makes it light.When I tested an IRLED with my camera, I did not have to be particularly close, and the glow was white, not pink.

author: Manul
author_rank: Super Contributor
timestamp: November 21, 2021, 09:45:13 pm
content: Quote from: jpanhalt on November 21, 2021, 09:21:30 pmI understood that it is glowing, so it means it works. Pink glow is quite common camera sensor response. What I do not understand is what it means 3.2V from 9V supply??

author: Manul
author_rank: Super Contributor
timestamp: November 21, 2021, 09:48:40 pm
content: Quote from: RobH on November 21, 2021, 08:51:56 pmYou set multimeter for frequency (Hz), connect one lead to circuit ground, another to 555 output. If it does not work, use a small series capacitor. It might be, that it is too high frequency for your multimeter, but you should try.

author: RobH
author_rank: Regular Contributor
timestamp: November 21, 2021, 10:56:44 pm
content: Quote from: Manul on November 21, 2021, 09:48:40 pmOk it shows the frequency is 687.2 Hz, which I guess is much too high for the receiverthanks

author: RobH
author_rank: Regular Contributor
timestamp: November 21, 2021, 11:02:23 pm
content: Quote from: Benta on November 21, 2021, 08:41:05 pmOk, but what 8 pin microcontroller do you suggest.

author: Manul
author_rank: Super Contributor
timestamp: November 21, 2021, 11:03:29 pm
content: It is much too LOW. It should be 38khz (38000 Hz). Not sure if this is your multimeter not capable to measure, or your circuit is working wrong. Try again, but using series capacitor, like 1 - 10 uF. Does it read same?

author: jpanhalt
author_rank: Super Contributor
timestamp: November 22, 2021, 12:23:16 am
content: Quote from: RobH on November 21, 2021, 11:02:23 pmThat would be easier to answer, if you could tell us why you need 8-pins for only one signal? Wouldn't 6-pins suffice? Surface mount or through hole? Do you have any microcontroller experience?There seems to be confusion as t whether you saw the IR light from the diode attached to your 555 or from the TV remote or both. Please clarify.

author: westfw
author_rank: Super Contributor
timestamp: November 22, 2021, 02:51:47 am
content: QuoteMost cameras have an IR cutoff filter that will prevent ambient IR from dramatically altering color balance of the completed image, but I've never seen one that is so exclusive of IR that the average IRRC LED won't show up as glowing in the viewfinder. Probably because the IR LEDs are only slightly below visible frequencies.QuoteEveryone is being very negative about the circuit, and it may deserve it, but if it's putting out 687Hz (or 68.7kHz) then I'm betting that there's a component somewhere in the transmitter with an incorrect value. It would probably work fine if built properly. That said, I also can't get the desired frequency (~38kHz) out of the component values they list and the 555 astable frequency formula (1.45/((470+2*1690)*100e-9) is off by a factor of 10!)This one looks closer:https://electrosome.com/ir-transmitter-receiver-led-tsop1738/The IR receivers are frequency sensitive, but they're not so picky that a circuit with 5% tolerance components is unlikely to work.

author: RobH
author_rank: Regular Contributor
timestamp: November 22, 2021, 12:19:56 pm
content: Ok, I changed the transmitter circuit to the one in the link, and checked the frequency, but it showed 0hzI then decided to test some of the IR sensor?? leds I have, and the one I was using was shown as faulty. It didn't pass enough voltage nor current to light a generic led.I replaced it with a known working IR sensor led and this one displays a faint red light from a 5v source. Also it appears to react to or with the TSOP 1738, as when I place an obstacle between both IR sensor led and TSOP1738, a generic led I have on the output leg blinks. But this is only intermittent when the obstacle is removed rather than placed in between.Also I found that the 22ohm resistor gets fairly warm with just 5v, which I found by accidently touching it, and it made the TSOP 1738 reactThe reaction of the TSOP1738 does not trigger the counter.On the 1st 555, Pin 3 , the voltage is 0.007v, when the TSOP reacts , the voltage is then 0.018v.On the 2nd 555, Pin 3, the voltage is 4.5v, when the TSOP reacts, there is no noticeable change, which is then passed to the 1st 4026 IC.Thanks

author: RobH
author_rank: Regular Contributor
timestamp: November 22, 2021, 12:33:00 pm
content: Quote from: jpanhalt on November 22, 2021, 12:23:16 amYou said: ' A 50 cent, 8-pin microcontroller would be a better option.'No, I don't have any microcontroller experience. The only thing I have a limited knowledge of is AND ,NAND and NOR gates from a basic electronics course I did about 40 years ago.There seems to be confusion as t whether you saw the IR light from the diode attached to your 555 or from the TV remote or both. Please clarify.Initially, 2 days ago, a generic led attached to the output leg of the TSOP1738 blinked / flashed when I used the TV remoteThe IR sensor led?? didn't do anything at that time, but now , after replacing the said IR sensor led, when attached to the 555 it does light up with a faint red light, and now does react or trigger the TSOP1738.

author: jpanhalt
author_rank: Super Contributor
timestamp: November 22, 2021, 12:43:58 pm
content: Quote from: RobH on November 22, 2021, 12:19:56 pmIt's early for me, but none of that makes sense.1) "to test some of the IR sensor?? leds I have" That TSOP1738 sensor is not an LED. Why would you expect it to light up?"I replaced it with a known working IR sensor led and this one displays a faint red light from a 5v source." Do you have "sensor" and "transmitter" mixed up? Then you write, "Also it appears to react to or with the TSOP 1738," Can you restate that a little more clearly. Doesn't "it" in that sentence refers to, "a known working IR sensor."2) "Also I found that the 22ohm resistor gets fairly warm with just 5v," Have you learned Ohm's Law? E (or V) = IR , so I (current in amperes) = E/R5/22 = 0.227 A; heat is proportional to current^2 and resistance (I^2 x R) , so (0.227A)^2 x22Ω = 1.13W. Anything smaller than a 5W resistor will get warm. If you used a 1/2W resistor, it would get quite warm. Why did you do that experiment?I think you need to follow advice being given, answer those questions, be careful with your words (i.e., sensor and transmitter don't mean the same thing), proceed in a logical fashion, and not go off on tangents to solve the problem you have.

author: jpanhalt
author_rank: Super Contributor
timestamp: November 22, 2021, 12:56:42 pm
content: @RobT1) I did not suggest a microcontroller and at this point, since you have no experience with them, I do not think that is a good idea.2) The TSOP1738 is an IR sensor. Its output is intended for logic and is not intended to drive LED's. Its absolute maximum output is 5 mA. A generic LED might flash as you observed. Your experiment seems to confirm your original post. The TSOP1738 is working as expected, but your transmitter is not. Focus on that.

author: RobH
author_rank: Regular Contributor
timestamp: November 23, 2021, 11:08:33 pm
content: Ok apologies, it was not you who said about the 50 cent microcontroller, my mistake., It was benta in reply 18.Benta also said that that the circuit was crap and would not work, so I have dismantled it and I am looking for another.

author: jmelson
author_rank: Super Contributor
timestamp: November 25, 2021, 06:03:05 pm
content: I built a remote terminal for a Blum touch probe used to find coordinates on a CNC milling machine. It uses IR to turn the probe on and then receives data from the probe by IR. I used the QSE159 IR receiver IC to sense the IR sent from the probe. Since this probe did not use 38 KHz modulation, I could not use one of the 38 KHz-sensitive detectors. This part has an amplifier and threshold set internally, and provides a digital output.Jon

author: Benta
author_rank: Super Contributor
timestamp: November 25, 2021, 11:55:15 pm
content: Quote from: RobH on November 23, 2021, 11:08:33 pmYes, I said that and I stand by it.I also said that an 8-pin (or even 6-pin) MCU would do the job better. Or a small CPLD.Using 555s for this kind of thing is... well, never mind.IR remote control receivers need a signal carrier with a 25% duty cycle. They also need a carrier burst that's at least 10 cycles long, plus a period with no activity that's at least 12 cycles long (A tip here: 16+16 might be a simple solution).Just for fun, I mused on how to make a 38 kHz oscillator with a 25% duty cycle output. It's actually not that simple.The circuit I designed is a divide-by-12 counter where three pulses are decoded for the output. It's not nice, but functional.I attach my solution using standard logic here, but bear in mind that it's only the oscillator. It still needs to be modulated!For your receiver, I strongly recommend the Vishay TSOP13438 instead of the obsolete 1738.

author: Manul
author_rank: Super Contributor
timestamp: November 26, 2021, 12:28:44 am
content: Maybe we sometimes scare beginners.This device can be made to work with simple parts too, but we need:1. IR receiver which can accept unmodulated (CW) signal (a must!). As I wrote earlier, I think TSOP4038 (or TSSP4038 - a newer one) is one of them.2. 555 astable circuit with a pot for adjusting frequency (a must!). Preferably film or C0G timing capacitor. Stable supply voltage (so not a 9V battery). If 9V battery is used, add 5V LDO linear regulator.3. A tool to measure frequency (a must!). Measure and adjust for 38khz exactly.4. If you are beginner, some patience and dedication, because it is often that things don't work first time. It is normal.

author: Benta
author_rank: Super Contributor
timestamp: November 26, 2021, 01:01:59 am
content: Quote from: Manul on November 26, 2021, 12:28:44 amYes, we sometimes scare beginners, but hopefully we also make them realise that the "Interwebs" is not the truth of everything.Re my post above, I'm just trying to be helpful, actually spending time designing a 38 kHz oscillator for the OP. I might need it later myself, who knows, but right now it's on free time.Re 1: No, the TSOP4038 also needs modulation,Re 2: 555s are notoriously imprecise, and even getting a 25% duty cycle is a challenge.Re 3: how many beginners have a frequency counter or oscilloscope?Re 4: I fully agree.

author: Manul
author_rank: Super Contributor
timestamp: November 26, 2021, 02:25:20 am
content: Quote from: Benta on November 26, 2021, 01:01:59 amSome 10 years ago I designed race timing system with CW IR light barrier (I remember that with CW I've got smallest jitter and best overall repeatability of response: unmodulated signal + fixed gain receiver), so I'm 100% confident about feasibility. I'm just not sure about part number, which exact receiver I used. But I'm about 99% sure it was TSOP4038. From TSOP4038 datasheet:QuoteQuote from: Benta on November 26, 2021, 01:01:59 amI would bet that duty cycle is not very critical.Quote from: Benta on November 26, 2021, 01:01:59 amSome do have scope. Also I know that one of my multimeters has frequency range up to 400khz (I think), used it once.I don't see big argument here. 30 years ago I was small kid who was obsessed with electronics, but I had so little, mostly junk parts, no good instruments, I could not buy or get many things. There is a good deal of things what you can learn trying to overcome various limitations. For example, if I would be forced to tune 555 timer at 38khz without any instruments, I would probably take an old LW radio and catch a harmonic and achieve that. You know what I mean? Or in case of IR transmitter - just tune for maximum range. Everything can be done and it is actually very educational.Quote from: Benta on November 26, 2021, 01:01:59 amBeginners are between two fires: one is complexity of proper engineering, second is disappointment from crap internet circuits. I think we should try to lead them somewhere in between these two. Peace.

author: Dabbot
author_rank: Regular Contributor
timestamp: November 26, 2021, 03:27:06 am
content: Quote from: Benta on November 25, 2021, 11:55:15 pmThe bandpass filter in these style IR receivers is quite lenient. A 555 will comfortably get you the ~38KHz you need.Quote from: Benta on November 25, 2021, 11:55:15 pmNo they do not. This is just a suggestion for IR remote control power saving purposes.Quote from: Benta on November 25, 2021, 11:55:15 pmThis varies from device to device, due to differences in supported IR protocols (short burst vs long burst). It even becomes more nuanced due to the filter specifics. Consult the datasheet for the specific device.

author: Benta
author_rank: Super Contributor
timestamp: November 26, 2021, 02:20:00 pm
content: Quote from: Dabbot on November 26, 2021, 03:27:06 amI beg to differ. The 25% duty cycle is for the receiver AGC.

author: Dabbot
author_rank: Regular Contributor
timestamp: November 26, 2021, 09:54:52 pm
content: Quote from: Benta on November 26, 2021, 02:20:00 pmLink a datasheet or similar specification with this requirement and I will grant you deferencefor that device. I cannot find anything supporting this claim in the datasheets for the devices mentioned here.The Vishay literature discussing this only talks about the carrier duty cycle in a power saving context, but does note asmallincrease in transmission distance, provided drive current is also adjusted.Fromhttps://www.vishay.com/docs/80069/circuit.pdf:Quote

author: Benta
author_rank: Super Contributor
timestamp: November 26, 2021, 10:07:53 pm
content: Wonderful. You're right and I have peace.Works with my wife as well.