0
\$\begingroup\$

Using LTSpice and uninformed dabbling I've managed to produce positive spikes from a wall switch that I hope will wake an ESP8266 for use to control hue lights. Once awake the IC will debounce, read the switch state and send the appropriate messages to the bridge.

My question is, will it really work? I'm using a voltage controlled switch to simulate my wall switch on/off actions and I'm worried that I am only amplifying encoded artefacts like current creeps.

Note: this is not supposed to be connected to mains, it is a DC project unless considering arbitrary hue lamps which is not within the scope of the question.

Note: the idea is to wake up the IC by pulling up the reset pin. Once awake, code will take care of everything.

The question was originally posted here and the ltspice-file is attached to my final comment.

Here is the schematic:

schematic

The left part originates from this hue project which is similar to what I want to do but with toggle-switches. The voltage controlled switch simulates the on/off action of the wall switch.

The right part is an op-amp absolute value circuit the rectifies the signal. The IC, voltage regulator and pull up circuit is not included in the schematic but should be similar to the already mentioned hue project.

First here is the signal at the resistor marked R8.

r8

Next the input to the op-amp circuit, at C2. As you can see, switching on results in a large spike with a negative overshoot. Switching off results in the opposite, but smaller.

C2

Finally, the output signal, absolute value and almost equal in amplitude.

enter image description here

asked Oct 6, 2021 at 17:21
\$\endgroup\$
11
  • \$\begingroup\$ Have you measured the actual signal? Do you have any pictures of that? \$\endgroup\$ Commented Oct 6, 2021 at 19:06
  • \$\begingroup\$ Where is your AC signal? You did say wall switch right? Also, you need to put in a transistor model, right click Q1 and pick one (2n2907) and same for the diodes. The link to the HUE project is broken. \$\endgroup\$ Commented Oct 6, 2021 at 19:07
  • \$\begingroup\$ Thanks @Aaron and jay. Clarified and corrected link. Note, no AC. It could be any two state switch. I selected the transistor and picked 1N914 for the diodes. The plots turn out the same. \$\endgroup\$ Commented Oct 6, 2021 at 20:30
  • 1
    \$\begingroup\$ @Martin, You do not need any of the circuitry, except the switch, a pull-up resistor, and a small capacitor. Your code "debounces" and "detects edge". \$\endgroup\$ Commented Oct 6, 2021 at 20:46
  • \$\begingroup\$ @jay Yes, provided the IC is awake, no? The circuitry is to wake the IC (on both on and off actions) as in github.com/diyhue/Devices/tree/master/HueTapSwitch/ESP8266. \$\endgroup\$ Commented Oct 7, 2021 at 10:44

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.