A retriggerable multivibrator. If you're not familiar with 'em, it sounds scary but essentially it's a gizmo that emits an output pulse in response to a trigger (i.e., an edge from your modulating 40 KHz) and that can be "re-triggered" while the original output pulse is still going on.
Take a look at the data sheet for a 74HC123, for example:
formatting link
and you'll see that the output pulse width can be set with a simple resistor + capacitor pair. Aiming for about 50 usec might be a place to start, which would be a 10K resistor and a 5 nF cap.
Why not just use a comparator that turns on when there is a signal and off when not? Use a LP filter to keep it on when the wave is on it's negative half cycle. This is basically what you are asking for and should work if you choose the appropriate time constant. Too much and you'll read high when it is not and too low you'll read lows. Since your bit rate is 40x slower it should be fairly easy to get the time constant...
e.g., the period of your 40khz single is 25uS. This mean's that the signal is off for 12.5uS and your time constant needs to be about 12.5uS which will mean that it will drop to about 63% of V. Or if you build in an appropriate amount of hysteresis then even something lower will work.
How big is the 40kHz square wave? You could just rectify the signal and add a bit of low pass filtering to take care of the swithing transients from the rectifier.
It just so happens that I was toying with a circuit for a similar purpose recently. This circuit here may be what you need.
formatting link
The upper trace is expanded to show the ripple. The inverting buffer serves two purposes: It generates a clean square wave, and also inverts the signal back to the original polarity.
Note that there's a slight delay to the output pulse. This is due to the finite time constant of C1 and R4 on discharge.
With modern OpAmps with great GBW, an active filter at 40kHz is trivial. ...Jim Thompson
--
| James E.Thompson, CTO | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona 85048 Skype: Contacts Only | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon at http://www.analog-innovations.com | 1962 |
I love to cook with wine. Sometimes I even put it in the food.
I didn't actually build the circuit as it wasn't what I needed, and I was just tinkering on-screen. It was for processing the output from an IR remote control receiver module. You can adapt it to suit your application. E.g., You can drop the 5V output to
3.3V with a resistive voltage divider. If you don't want to invert the pulse polarity but still want a clean square wave, you can either use a non-inverting buffer or add another inverter.
Is the signal already clean digital levels (1=light sensed, 0=dark) or is it analog? If it's digital, any simple lowpass/schmitt thing is fine.
If it's analog, it's a more interesting problem, the ASK decode threshold issue. The long "start" bit is probably there to allow a receiver to establish a 50%-of-max amplitude threshold, where 'max' could vary over a huge range for something like an IR remote.
Is '1' a 0V to 3.3V digital signal and a '0' is just zero volts?
If so, just use a _retriggerable_ one-shot with tau > 25us as a pulse stretcher. ...Jim Thompson
--
| James E.Thompson, CTO | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona 85048 Skype: Contacts Only | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon at http://www.analog-innovations.com | 1962 |
I love to cook with wine. Sometimes I even put it in the food.
See my recent DC-restorer posts for sample circuits that work O:-) ...Jim Thompson
--
| James E.Thompson, CTO | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona 85048 Skype: Contacts Only | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon at http://www.analog-innovations.com | 1962 |
I love to cook with wine. Sometimes I even put it in the food.
If your goal is to understand and build your own demodulator, you've had -- as you say -- lots of good suggestions. If you simply want to decode a TV remote control, there are a lot of one-chip and inexpensive solutions out there from Sharp, Vishay, Siemens (Infineon?), and others.
You can get a good idea of what they look like by grabbing a datasheet from (say) Digi-Key:
http:/
formatting link
On Digi-Key, these TV remote control receiver/demodulator chips are filed under "Sensors - Optical - Photo Detectors - Remote Receiver", like this one:
$1.31 Vishay TSOP321xx, 323xx series
They are avalilable to respond to various IR "carrier frequencies", e.g. the Vishay TSOP32140 expects a modulated 40kHz carrier. To learn about their performance and how they work, review a datasheet or three.
You mentioned 40kHz. If you are generating the LED signal, then that will be under your control. If not, be sure to match the transmitter frequency with the IR Receiver module; while you _can_ pick up a
36kHz transmission with a 40kHz IR Receiver, you'll have to have the two closer or put out a "louder" signal to do it.
Enjoy...
Frank McKenney
-- Satisfaction of one's curiosity is one of the greatest sources of happiness in life. -- Linus Pauling
-- Frank McKenney, McKenney Associates Richmond, Virginia / (804) 320-4887 Munged E-mail: frank uscore mckenney ayut mined spring dawt cahm (y'all)
Then there's some exotic remotes out there. The highest frequency I have come across was just shy of 60kHz. So if a reader of this thread has the goal of checking remotes for repair purposes a wideband solution may be better.
[...]
--
Regards, Joerg
http://www.analogconsultants.com/
"gmail" domain blocked because of excessive spam.
Use another domain or send PM.
Something I'm considering for a home IR repeater that's independent of remote modulation frequency...
formatting link
...Jim Thompson
--
| James E.Thompson, CTO | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona 85048 Skype: Contacts Only | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon at http://www.analog-innovations.com | 1962 |
I love to cook with wine. Sometimes I even put it in the food.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.