Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
You mean like "ATtiny85"? Or Atmega328 or similar. There will be a ESP8266 involved in the circuit where this needs to be included (this controller can be used with Atmega328 compiler).I assume you're looking for an answer other than an 8-pin micro?
You can do that with the ADC on those micros. Just feed a pot straight to it.You mean like "ATtiny85"? Or Atmega328 or similar. There will be a ESP8266 involved in the circuit where this needs to be included (this controller can be used with Atmega328 compiler).
Yes, go ahead..
But if possible a simple hardware solution would be preferred because the adjustments if needed can be done by a trimpot.
Hi dknguyen, I know that can be done. But my prefered solution would be a hardware solution if possible: the ESP8266 does not have an accurate ADC and I do rather not include one more controller just for this. Would this not be possible with a 555 or other simple hardware?You can do that with the ADC on those micros. Just feed a pot straight to it.
Yeah, but the circuitry would be a lot more complicated. Complex 555 timer circuits arent my strong suit.Hi dknguyen, I know that can be done. But my prefered solution would be a hardware solution if possible: the ESP8266 does not have an accurate ADC and I do rather not include one more controller just for this. Would this not be possible with a 555 or other simple hardware?
Yes. I think.The signal triggers a 5 s timer (adjustable). The end of that period triggers another timer that adds 5 s (adjustable) to however long the original signal stays high.
yes / no ?
ak
Amazing! Thank you for your work!! I will try that out on a breadboard.Below is the LTspice simulation of a circuit, to do the pulse detection and stretching.
This is the simplest analog circuit I could generate.
I first tried using 555's but that became even more complicated.
This circuit uses one LM339 comparator chip, one CD4013 flip-flop, two diodes, and some passive components.
The two LM339's, U1 & U2, are configured to provide about a 5 second delay each.
U4 is configured as an input buffer.
The simulation is shown for an input pulse of >5s.
≈5s after the input pulse V(input) goes high, U1 Out goes high.
This triggers the flip-flop, U3, causing its Q Output to go high.
At the end of the input pulse, U2 starts to time, and after ≈5s its output, Out2 goes high, resetting the flip-flop and terminating the Output.
The circuit thus gives an output pulse that starts when the input pulse exceeds the 5s delay, and continues the output pulse until 5s after the end of the input pulse (hysteresis?), which I think is what you wanted.
These periods can be adjusted by pots U6 and U7.
So you have to decide between the complexity of this circuit and a simpler micro circuit.
I wouldn't worry about the accuracy of the A/D in the micro, since it's just reading a pot.
It's stability you want, and the micro's A/D should be quite stable.
(...)
Looks more complicated, and you still need to get the 5s stretch after the end of the input pulse with no glitches, which is not trivial.What do you think of that circuit?