Circuitjs currently only implements ideal switches, which transition immediately between connected and disconnected. However, I would like a feature request to simulate a bouncy switch in circuitjs.
What looks like an inverter is a buffer delay with a fixed delay of 1 millisecond. The switch is connected to input "C" (for "Closed") of a custom logic chip, with the delayed version connected to input "D" (for "Delayed"), and a noise signal into input "N". That custom logic chip has the following input-output definition:
00?=0
010=0
011=1
11?=1
100=0
101=1
That custom logic chip definition basically says:
When both C & D are the same value, then the switch is in a stable position and so the output is simply that same stable value.
However, when the C & D are different, then the output is in the bouncy stage (for simplicity I'm simulating by copying the value of the noise input to the output).
The scope shows what looks like a bouncy switch that has a 1 millisecond period of noise after the switch is clicked on. However, there are some limitations of using this custom logic chip to simulate a bouncy switch which would be nice for a feature request:
A real bouncy switch would have a random time range for bouncing, not a fixed duration, maybe which can be set between a minimum bouncing time and a maximum bouncing time, before it settles.
While the custom logic chip has the concept of high impedance output with the symbol _, it doesn't seem to allow the concept of a closed connection (a short circuit). I can only copy a logical 1 or logical 0 voltage to the output, but that doesn't actually simulate a closed connection. If I'm just dealing with logical inputs, this is fine, but if the inputs are connected to an actual circuit, then simply copying a logical voltage to the output doesn't properly simulate the effects of connecting a circuit together.
A real bouncy switch actually has some random resistances while the switch is making contact. In my attempt at simulating the bouncy switch, I'm just copying a logical value of a noise voltage over, but in reality I should be simulating a random resistance between input and output.
Would be nice for the switch graphics to be animated like a bouncy switch, randomly making or breaking contacts.
Would be nice to easily extend to multiple poles in addition to just SPST.
(And of course there are more minor details involved in a bouncy switch, but probably too much for circuitjs to worry about.)
Anyway, just wanted to make a feature request for a bouncy switch. If it is too much effort or out of the scope of circuitjs then that is of course understandable. As always thanks for such a powerful and simple simulation tool.
Circuitjs currently only implements ideal switches, which transition immediately between connected and disconnected. However, I would like a feature request to simulate a bouncy switch in circuitjs.
I tried making a circuit using the available tools here that simulates a 1 millisecond period of noise after the switch is clicked on:
What looks like an inverter is a buffer delay with a fixed delay of 1 millisecond. The switch is connected to input "C" (for "Closed") of a custom logic chip, with the delayed version connected to input "D" (for "Delayed"), and a noise signal into input "N". That custom logic chip has the following input-output definition:
That custom logic chip definition basically says:
The scope shows what looks like a bouncy switch that has a 1 millisecond period of noise after the switch is clicked on. However, there are some limitations of using this custom logic chip to simulate a bouncy switch which would be nice for a feature request:
_
, it doesn't seem to allow the concept of a closed connection (a short circuit). I can only copy a logical 1 or logical 0 voltage to the output, but that doesn't actually simulate a closed connection. If I'm just dealing with logical inputs, this is fine, but if the inputs are connected to an actual circuit, then simply copying a logical voltage to the output doesn't properly simulate the effects of connecting a circuit together.(And of course there are more minor details involved in a bouncy switch, but probably too much for circuitjs to worry about.)
Anyway, just wanted to make a feature request for a bouncy switch. If it is too much effort or out of the scope of circuitjs then that is of course understandable. As always thanks for such a powerful and simple simulation tool.