Video není dostupné.
Omlouváme se.
EEVblog
Vložit
- čas přidán 18. 08. 2024
- Fundamentals Friday
Dave takes you through designing a signal overload detector circuit from scratch and then builds it up on the breadboard.
Window comparators, schmitt inverters, capacitor charging, pulse stretching, common mode input range, tongue angle tweaking, it's all here.
Forum Topic: www.eevblog.com...
EEVblog Main Web Site:
www.eevblog.com
EEVblog Amazon Store:
astore.amazon.c...
Donations:
www.eevblog.com...
Projects:
www.eevblog.com...
Electronics Info Wiki:
www.eevblog.com...
My father was an engineer and a real perfectionist. The phrase "good enough" was never allowed to be uttered in our home. As a result, I grew up to be a real perfectionist. It does me a world of good to hear someone whom I respect say, "What the hell, it's close enough." Thanks!
This makes me wonder why we never had such electronic lessons. On my university it was mostly like "lest calculate this random gigantic resistor-transistor network". You know, for practical design knowledge and fun... I was never before in a situation when I sit down, listen and understand every single thing. And English is not even my native language, while those classes were!
IDK why
That's the problem with professors who've done nothing but instruct. They don't teach much that is practical because they've never worked in the industry.
So true
Love fundamentals Fridays, please keep em' coming Dave!
Thank you!! ... the identification of the building blocks and options of a circuit to achieve a result ... priceless.
The old '339 is quite a useful beast!
I just used it in an automotive device that has several 0-5V analog input signals.
I needed to include a voltage clamp on the micro-controller analog inputs in case some IDIOT (that'd be ME) accidentally shorted the input direct to the 12V battery.
With 100% negative feedback (inverting input directly connected to the output), and a simple resistor pull up to the +5V micro controller power rail, the output will (fairly) accurately follow its input in the 0-5V range. If the input exceeds 5V (due to the IDIOT), the comparator will saturate at 5V since the pull up cannot pull the inverting input high enough to match the non-inverting input.
One of the beauties of the venerable '339 is that it doesn't have the pesky input protection diode to the positive supply rail so the input can be 'over driven' right up to the CE breakdown voltage of the input transistor (>30 volts).
Since there ARE no voltages below chassis ground in the car, I shouldn't have to be worried about the input pins being driven below 0V. (However, a resistor + diode clamp to ground on the input pin would almost do it)
I included positions for external pull up resistors on the PCB, but I am hoping that simply enabling the MCU pin internal pullup resistor (around 50k) will be enough.
The comparator output should cause the MCU input pin pull up resistor to be loaded just enough such that the voltage follows the comparator input (unless it exceeds 5V)
It wouldn't have been quite as easy if I had to use a 3.3V based microcontroller as I would have had to scale down the input signal first!
I love following along as you solve the problem on the whiteboard. It's like watching a mystery unfold, my mind scrambling to uncover problems and solutions before they are revealed!
Dave, thankyou for Funda-Friday. Its the greatest idea you've ever had for your show imo. I'll be watching every one.
I remember Ben Eater using that T = R•C formula for a clock pulse iirc - so cool to see different engineering CZcamsrs mention the same things!
This was perfect for me Dave, going through the design decisions step-by-step, but not getting too bogged down in the basics. I look forward to more, cheers!
I'm really glad you're doing more of these, I'm an electronic enthusiast and student, but I sometime lack the rough basics of some circuits, and you're making it so simple to understand... I'm actually watching your videos instead of making homework... But, electronic theory videos count as homework, right?
awsome, loving this segment. had to watch the RC explanation on the capacitor changing. two times (the high and low voltages were confusing me), but i got it. keep sharing the knowlege. thumbs up!
1. Common mode voltage range of LM339 ends around Vcc -2V, so other comparator is needed here.
2. LM339 has bipolar transistor output, so our capacitor should discharge very slowly around "Low-level output voltage" 150-400mV, as listed in the datasheet.
3. Its a better idea to ground third comparator's positive input and change resistor value to achive desired delay.
Thanks Dave,can't wait to next Friday....
PLEASE! More fun-damentals fridays!
I agree with Alyx about the longer videos. I disagree with the knowing everything about comparators, at least for my part. :) I know some useful stuff now. Thanks!
Keep these up please, Dave.
I don't even do electronics that much but Dave is a frequent-welcome guest to my screen.
I really like this segment. A good balance to all the other videos. I'm looking forward to more Fundamentals Friday videos. The ~30 minute videos are OK and it is nice to have the theory with details and the real implementation and testing of the circuit.
Hey Dave! I'm only 5 minutes but I just wanted to tell you that I LOVE Fundementals Friday!!!
4. A simple option for detecting voltages close to the rails would be an NPN and a PNP from each rail in common emitter configuration. Several more transistors are needed to deal with the signals from the collectors of those transistors, so it's arguable whether that solution is better, but at least it avoids the common mode input range problem of the comparator.
Absolutely ACE Dave! Theory and practical... couldn't be better.
As a vintage computer enthusiast I'd also like to request a F.F. covering switch mode power supplies, showing waveforms if possible. Thanks for listening.
Thank you Dave for your simplistic way of explantaion !
I like this new segment format, Dave. Please, keep them coming.
Fundamentals Fridays is a winner. Thanks very much Dave. :D
Super stuff. I don't pretend to understand it all, but it's so damn interesting. Big thumbs up for FundFri.
Thank you again for your walkthroughs. The best ive ever listened to. Thank you for helping us understand!
This new segment is perfect! Please keep them coming! And I think that the lenght is about optimal too.
Fundamentals Fridays are great, thanks Dave! 30 min. is perfect.
I like these at about 30 minutes. I think depending on the topic they can go as high as 45 and still keep it watchable but much longer on a weekly basis would be tough to keep up with. Can't wait for episode 3.
I made a very similar setup to test ATX power supplies, using four LM393s, an LM431 reference, transistor-driven Green (pass) / Red (fail) LEDs and a brighter overall "FAIL" LED, with an added CD4069 hex inverter and some diodes for logic. Also a set of 1ohm and 3.6ohm high-watt resistors and some NTD series power mosfets to generate a ~150W test load.
Never got to build it, but I did get as far as a tentative board layout.
Dave,
These segments are fantastic. Thank you.
Funny, I just did this last week (see video response).
I probably screwed up some of the details, because I'm really new to electronics, but I wanted to be able to detect a short duration signal with an Arduino program that spends a couple of seconds in a timing-sensitive loop with interrupts disabled. I used an LM358N and an R-C circuit similar to yours to stretch out the pulse to the point where my program can read it at leisure.
Depends on the timing I would think. The PIC needs time to convert that voltage to digital so you would miss very fast signals. Check the conversion time in the datasheet.
Hi Dave
Your new Fundamentals Fridays is great. Hope that you can keep doing them.
Would like to see a segment on Switching Power Supplies? Keep up the great work.
Willy
Friday is my new favorite day.
As you are using an isolated supply use the scope probe as the 10m resistor instead, and just have an inverted trace.....
LOVE IT, LOVE IT... Hey Dave, so your tear downs were getting a bit old for me. I love this kind of video and it's more like your earlier ones where you spent time on theory and then into a real world build up. Brilliant! And just love how you show a working circuit and how to use lab equipment to study it. Keep Fundamental Fridays coming!!!
Late in the nigth here in Portugal. So let me see this before bed.
I can't tell you how many times I've forgotten to read the datasheet for the output configuration for a comparator. I'm a little wiser now, but fortunately many comparators share pinout - saved me a few times.
thanks dave I will have to save this video for later watching for my solar stuff. would work great for charging. were I can charge up to a certian voltage and use it to turn off the solar once the battery reaches a preset discharge voltage it will go back in to charge mode untile the battery once again reaches the charge voltage. IE stop chargeing at 28.8 volts and dump any voltage to gti. and when battries goes below 24.4 volts start charging them again. nice video dave. love it.
nice idea. i think the only problem there would be voltage drops in the rectifier but you can compensate for that easy
Excellent tutorial really clear instruction another problem solved thank.
Love fundamentals Friday.
I agree, this is the best segment. I don't mind 30 minutes at all.
My first thought for a pulse extender was to just put a cap on the comparator output. It would then recover by the same current that feeds the LED. That variant would have a more complex time, uneven light, and require a larger capacitor, so probably not work as well... just thought I'd toss it out here anyway.
Nothing like watching Dave's head on a 42" display in high definition, surround sound system, dimmed lights and popcorn, right?
I've had that one since I was a teenager!
Hi Dave ! Don't worry about the time it takes the "fundamental Friday"! I don't mind!
In fact if you want to set the limit to 1 hour, I'll find the time to see!
Too bad a week only has one friday... I like this segment. :)
Love it! Great stuff.
I'm brutally bad at understanding analog theory so you beating a dead horse with terminology, cause, effect, and traps is appropriate for me :) Thanks again, keep it coming!
Exactly what I was thinking!!.. Great comment.
This is my usual workbench area. That whiteboard is right next to my main bench you see in most videos.
I'm really enjoying your Fundamental Friday videos. Keep up the great work!
"There are practical effects when you probe things" -> That's what she said
Yes, it counts. I can write you a note if needed!
i dont mind the longer videos ... i have plenty of time to spare and you learn more! .... i thought i knew everything about comparators ... but not CM voltage!
The only way a micro could help here is if you needed to dynamically attenuate or amplify the input signal to keep it inside the window. That gain adjustment problem is WAY beyond the scope(hah) of Dave's demo here. (Thanks Dave for showing the rough edges of this technique!
Something similar should come pre-installed with your OS, however you may need to install the 'practice' upgrade to get the same quality output.
3. In practice I would use a PNP emitter follower from the RC driving an LED, and a resistor between the comparator outputs and the capacitor so it doesn't discharge fully and immediately on every overload. This gives a smooth range of brightness that's proportional to the amount of overload, which I find more useful for audio use, though you may want the behaviour you've designed for. (A pulse time of 0.1 seconds would be plenty long enough though.)
That is usually what happens to me when I try to do designs with integrated circuits, op-amps. You get all kind of strange problems when you get near the voltage supply. You would probably have been better of using a diode to sense when you are near the +/- supply.
Great to see something like this done with real hardware, instead of whacking in a microcontroller.
Why does the datasheet say you can power it on +- 1V when the inputs have to be at least 1.5V away from the rails?
wait WHAT your telling me I can build circuits with out a atmel and a few msp430's? lol
TI makes a convenient window-comparator IC (TPS3700) for overvoltage/undervoltage detection. The voltage thresholds are set by an external 3-resistor tree (voltage divider). It has open drain outputs too, so they can be wire or-ed together.
www.ti.com/lit/ds/symlink/tps3700.pdf
5:30 Technically you could also use a perfect diode circuit and then only need one positive reference voltage? that could save you some money for only one precision reference if precision is needed of course
Absolutely love these educational videos Dave!
Thank you
You have an excellent method for explaining circuits.
Keep it up
Hello Dave, i learnt alot about electronics through your videos.Can you make a video on how to send data to a TFT LCD screen through a microcontroller and display some graphics. Thank You.
I build my first little timer with a capacitor and a comparator so proud of me that time :)
I love this stuff! but it also makes me realize how long its going to take to learn all this stuff but its worth it!
I got through the theory relatively easily, but once into the practical.... i think i have to watch that half a few more times. Great video though!
I love these tutorials! Way to go!
LOVE fundamental Friday! Keep um comin'. This one was a tad confusing though because you started with a design goal that was to be low parts and cheap and ended up using a 2nd IC instead of the quad comparator initially mentioned. Still, got to see some 'traps' in action.
Thanks Dave this new segment are really helpful!
Very well presented, well done!
The point of adding the extra bits on the circuit is to stretch the duration that the LED lights up to make it visible even on short pulses. Is there any possibility of the pulse being so short that it cannot discharge the cap in time? How to address that? I would think you'd want the cap as small as possible.
The comparator has open collector output so it is only shorting the capacitor to GND if "active" ...
Hey Dave, good vid. I was going to make a circuit using the LM339 to drive LEDs but found the output max sink current of only 20ma to be too low for me to feel comfortable using a setup like this. I need the circuit to work out in the desert where it is bright and hot out so I was worried sinking max current to drive a green LED at 20ma would run into thermal runaway issues, and running less that 20ma into seemed undesirable as the LED might not be bright enough to easily see.
Dave! I like the long videos! and I like the Fridays videos .. keep it up sir.
Dave you need to take your hobbyists on a long range project. Why not design and build an oscilloscope!!! Yay !
Dave, I believe the 10M resistor should be in series with the output of the window comparators. Am I wrong??? Cause to me it looks like if the window comparators have enough current drive, they would follow their inputs really fast, and charge the caps fast.
I was thinking about doing this right before I read your post but on my 56'' display
You can download DaveCad at Amazon and various online stores, simply search for Post-It!
Hey Dave! I really like these new Fundamentals videos. It's too bad you were in a rush and didn't have a lot of time to shoot this one. Otherwise you would have certainly realized an easy solution to making this work at ±1V - by using a divider not to ground, but to -1V. I thought of that immediately because I never work with a split power supply... I cannot afford it, haha.
Anyway, as a lecturer, you're very interesting to listen to. Keep this Fundamentals Friday going!
A micro also adds V&V headaches, potential regulatory nightmares depending on the project and its overkill as you mention. New players need to avoid tossing software at a hardware solution.. Great video.
These are really fun!
Could you make the circuit so that you have multiple levels of overload? For example you have an input of +0.5v, a green led comes on, you have an input of +1v a yellow light comes on and etc?
Hey Dave! Maybe next fundamental friday could be a tutorial on how to read opamp datasheets and what does every characteristic means!
Excellent. Love these segments!
Excellent as usual =) Very interesting, i've learnt lots from this. Keep up the great work!
Keep up the good work! Great video as usual...
Great video! I was worried in the first half though!
OK MY DEAR. MANY TKS ABOUT MORE THIS LESSON, I AM ONLY ELETRICAL ENGINERING, 60 YEARS, AND I LOVE DIGITAL ELETRONICS
THE BEST FOR YOU
LUIZ
RIO DE JANEIRO
BRASIL
It's much cheaper but if your circuits already includes an µC with free ADC channels you could just use it.
I don't think it detects 1ns peaks because of the relatively bad slewrate on the low-end opamp, but with an better one and maybe changed R and C values it should detect 1ns.
lol, how did I forget that crutial fact. Thanks for the reply. I would have been all ''Dave fucked up..."
What if you use a rectifier and take into consideration both positive AND negative parts of the signal?
great show of yours. really helps understanding (at least for me as only half an ee student^^)
Thank you. god bless you
Voltage follower has a problem with Voltage Commond Mode also? If yes there is a problem with your old uSupply in rev C U12A is supply by V+, and on +Pin is (V+ -1V), on -Pin there should be also (V+ -1V), no way there will be (V+ -1V) on the output.
my understanding is for the window comparator circuit, you omitted two diodes right at the output of the two opamps, right?
or divide em in to a couple of videos and maybe finish the first one with a problem we had a week to solve befor you gave us your answer :) ..
Actually in most cases the LCD's digital part will work fine with 3.3V.
Most likely the backlight will work too if you replace the current limiting resistor for it.
The contrast of course will not work with 3.3V so you need the 5V but that requires less than a mA.
Also note is that in many cases it is not safe to power stuff directly from a uC pin. Some LCDs will draw much more than the pin can give and in the general case there is also a limit on the total current a uC can supply on all pins.
It's all in the datasheet.
I agree that 30 minutes is OK too; no problem. I would even say an hour would be OK. If it's too long, you can always pause & come back....