0
\$\begingroup\$

I'm using the following circuit to try to simulate a button press in a speaker: circuit This is supposed to wait 2 seconds, set the output high for ~500ms and then set it to low. The output of the NE555 is connected to a transistor that is actually driving the switch's contacts, when the transistor switches on, for the duration of the 500ms, the button is "pressed", as if I did it manually.

This is the transistor stage: transistor stage

Note: AD_KEY is an ADC input on the speaker's MCU, it checks for a certain voltage provided by the voltage divider when the button is pressed.

I get 5V from the 5V pin of an USB connector somewhere inside the speaker.

The problem is that the circuit only works in certain conditions. I have made an equivalent circuit using an Arduino, the arduino project works 100% of the time without a doubt.

This circuit is problematic since the first time I power on the speaker, it doesn't work, although the output of the NE555 is properly generated - using a voltmeter I can see the voltage going up after 2 seconds and after ~2.5 seconds I can see it quickly going to 0V. If I turn the power off and measure (again, using a voltmeter) the output of the NE555, then I can see it slowly going from 1V to 0V, although after the 2.5 initial seconds have passed it was always 0 while the speaker was on - as you'd expect. Then if I turn the speaker on when the output is still in the 0.1V - 0.2V range: the circuit works every time. So power on during 0.1-0.2V window, power off, wait, again power on while the NE555 output is in that range, it works! However if I wait for that output voltage to drop very close to 0V and power on the speaker, the circuit no longer simulates the button press (on the voltmeter I can see that after 2 seconds the output voltage doesn't rise again). The same goes for quickly powering on the speaker after powering it off.

So a capacitor is discharging on the out of the timer IC? Why does it work if I power on the speaker in that 0.1-0.2V range of the output pin?

And to add to the confusion: A similar situation happens on a breadboard with an LED instead of the MCU, but this time, the circuit only works if I allow the out voltage to completely drop to 0V.

PS: This is related to: Pressing a physical button, but digitally using an Arduino in an existing circuit

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Without wading into the details of what might be wrong, that Arduino could become an ATtiny... If you really want to use a 555, then I'd start over by drawing the waveform behavior you want, then going to a 555 cookbook and finding something that produces that, or at least its inverse. If you realize you're going to need two 555's or a 556, then definitely go with the ATtiny - there are straightforward Arduino ports to the ATtiny85 in the same 8-pin dip as the 555, and if you really want there's the little ATtiny4... \$\endgroup\$ Commented Dec 3, 2020 at 19:13
  • \$\begingroup\$ Yeah, that's right, but I wanted to maybe learn something from this (partly) failed experiment. \$\endgroup\$
    – Paul
    Commented Dec 3, 2020 at 20:03

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.