Unexpected electrical behavior of LM555 in printed PCB

Hey there,
im Currently building a clock, powered by an NODEMCU-ESP8266.
For controlling this im using an KY-040 Rotary encoder which ive debounced with three LM555. I was inspired to do so by Ben Eaters Clock Design. I pretty much copied the 'block' around U2 in his design.

In addition i used one button-LM555 Combi, a T-FlipFlop and a Mosfet to turn on and off the MCU and the other two button-LM555 combis. Since i havent found a single T FlipFlop IC, i used the SN74hc112 which is a dual-JK-FlipFLop where disabled one side, and connected one J and K pin to HIGH so that every time the CLK pin goes HIGH the output toggles and the clock turns on or off.

The Problem:
I Prototyped everything on a breadboard, and is working flawlessly!
When i printed the PCB i now have this strange 0.5V to 1.7V always on my (ON/OFF) Button output. Also the output Pin of my (first) LM555 is always HIGH. In addition im mesuring a weird capacitance across the Resistor.
The Pullup Resistor of the buttons are 1K and still it take a couple of seconds to get up to this wierd floating in between voltage. I swapped the IC to a Fresh one. but thats not the Problem. As Far as i can test everything the mechanism of toggleing the flipflop an turning on the MCU is Working. As well as the Debounce-group around U2. U3 seems to have the same issue wenn powered.

I found one Problem. in my original Circuit i havent made the bridge between Pin 6 and 7 of U1. But ive bridged them afterwords. this isnt the Problem.

I you can help me with this! i uploaded my original EasyEda Circuit diagramm and aswell as the Gerberfile. And an aproach to make this Diagramm a littlebit easier to undestand.

Thank you in advance!
Janosch
extraCircuitDiagramm.pdf (128.9 KB)
Gerber_70x35 Mit Overlap.zip (72.4 KB)

I've not looked at the gerbers. Do you have a blank board? If so use an ohmmeter to check out all the traces that involve the trigger.

How could that possibly go wrong? :grimacing:

If i havent missed anything: All connections are <0.5R . Most of them are .2R or .3R
so this shouldnt be the Problem - quite astonishing, considering my soldering skills ^^

You are attempting to use a low side switch in the MCU's (ESP8266) ground path. Are you certain that it won't find another path to ground?

Good, so I don't have to try to understand what your design is about.

One thing I noticed is that you seem to power some of the LM555 chips with 3volt (3.3volt?).
The LM555 is 5-16volt (4.5volt absolute minimum), so doesn't work reliably on 3.3volt.
You could use a C-mos version of the chip to get around that.
Leo..

Hi, @mrdoode
Schematic;

Please post your images as jpg, that way all platforms can view them.

Also can you post an EXPORTED image of your PCB. Not everyone has the CAD you use.

Thanks.. Tom... :grinning: :+1: :coffee: :australia:

Thank your all for replying!

Yes im pretty shure. because when i unplug my MCU, U2 and U3 dont have any connection to either Ground nor 3,3V.

I happily answer any questions!

Yes you are right! I looked again and i actually used the NE555P from TI to be precise. This chip is rated for 3.3V. I think i just had the Wrong thing in Mind while typing, since the LM- Version is used in the Example!

Thanks you for pointing this out! I thought you guys prefer PDF whenever possible.

Here are my top and bottom view of the printed PCB


Rotary encoders don't need debouncing as quadrature signals are unambiguous when bounces happen - the count just shuttles back-and-forth one count, and since there are 4 counts per detent this is easy to ignore by dividing the count by 4 suitably.

You can initialize the count at power up to 2, so that truncating integer division will thereafter treat 0,1,2,3 counts all as 0, ie a change of +/-1 from the detent position is simply ignored and no further debouncing code or hardware is needed.

Where on your schematic is this output? I can't see anything matching that description.

I can't see any 1k resistors on your schematic, where are they?

As @MarkT has pointed out you don't need to debounce rotary encoders, if you use a state based approach to reading them no debouncing is required. Not only that, when I was using rotary encoders and checking the output on an oscilloscope I don't ever remember seeing any contact bounce, not that you should rely on that.

Why do you want to disconnect the power from the ESP8266? I suggest it would be better to use sleep if you want to power it down.

There is a phantom path to ground while the rotary encoders are not in their rest position: from the ground connection to the rotary encoders, through their output to the 555 timers, through the 555 timer input protection diodes to their ground and back to the ESP8266. I can't find another phantom path to ground but I'm not convinced there isn't one.

The aerial of the ESP8266 is over other tracks on the board, this might or might not cause a problem. The problem, if there is one, would show up as difficulty connecting to WiFi, or a poor signal if there is a connection.

I think you should start again addressing the above points and the ones made by others, in particular forget the 555 timers, you don't need them. Use sleep instead of trying to disconnect the power, if you really do need to disconnect the power at all.

Hi,
Here is a schematic of the rotary switch, the "button" does not appear to have a pull up resistor.

KY-040 Arduino Manual.pdf (153.4 KB)

Thanks.. Tom... :grinning: :+1: :coffee: :australia:

1 Like

Wishful thinking?
The NE555 is exactly the same chip as the LM555.

Or the enable (EN) pin.
Leo..

Almost never as they cannot practically be viewed on tablets/ smartphones as they are not image formats and cannot be inserted into Web pages.

While a true PDF can be magnified to an almost unlimited extent which is useful in the design process, images inserted into PDFs cannot.

Well, you actually cannot, which is the basis for my comment in #3. You will lose transitions and completely muddle the process. Maybe if you turn it slowly you will fancy it is working. :roll_eyes:

Common design blunder by those with no expertise in RF. :cold_sweat:

Nope.

Very good idea but not quite as useful on a NodeMCU as you have a CH340 as a "hanger-on" wchih does not shut down.

ESP-01 is best if you want it to completely shut down. :+1:

But why does it need to shut down? The OP seems not to have actually explained just what sort of "clock" this is supposed to be. :grimacing:

Hi,

Ditto.. @mrdoode says he got the info from Ben Eater's site, but its a complete 8 bit discreet digital IC project, brilliant by the way.

@mrdoode a couple of questions.

  1. What are the buttons for?
  2. What is the rotary encoder for?
  3. What does the ESP8266 do in this circuit?
  4. If it is a major part, why do you want to turn it off?
  5. Please tell us what your complete project is, if possible post a block or circuit diagram of how you want everything to connect.

Thanks... Tom.. :grinning: :+1: :coffee: :australia:

Completely off topic (apart from OP having cribbed a part of the main design) but that 8 bit computer made up, with small exceptions, of discrete logic elements, is amazing. https://eater.net/8bit. I agree fully with @TomGeorge. Many thanks to the OP for drawing attention to it

I and others have made this comment often in questions about rotary encoders, but I've never seen anyone explain it. Here is my explanation: Reading rotary encoders as a state machine

It is really fairly straightforward. Since the quadrature design of the encoder is such that only one phase changes at any one time (this is absolutely requisite), then contact bounce of one phase results in a "movement" back and forth only.

Now this may or may not matter. If you are acting on every "quarter step", then you will see a jitter of that amount - and it will indeed be a jitter. If you do want to debounce that, then you need to first fully calculate the derived (numerical) value according to the state of both phases, and debounce that value, not the individual phases.

But it may not be a problem, and it is suggested it is less of a problem if you do not wish to respond to "quarter steps" but only a "full step" of four sequential transitions. Even in that case there will be a jitter if it occurs on the transition which defines that "full step" unless you provide hysteresis which is to say requiring several partial steps in any one direction to change the variable. However requiring a "full step" to make a change is a gross waste of the encoder's resolution. :roll_eyes:

The point as Perry's article notes is that any delay at all in reading the encoder - and using NE555s most certainly would do exactly that - will cause errors if the encoder is rotated rapidly. (Just how rapidly depends of course, on the encoder design and the delay in question. :sunglasses:)

As for rotary encoders, in practice you can get a "bare" encoder or one also incorporating signal conditioning components. The illustrated schematic does not (necessarily) belong to the "enhanced" encoder shown. Using a pair of 555 timers to interpret a rotary encoder, as the OP has done, is certainly one of the more "creative" solutions for integrating the device in a project.

Hey There!
Thank you all for your Help and suggestions!!

At first i want to address some of your questions:

As many of you suggested i will consider a State-based approach, when using the Rotary Encoder!
Considering i somehow manged to misread the Product informations - I think i have to!
Thanks @Wawa to be persistent ^^

My Rotary Encoder Module has three 1K Pullupresistors each for one Output. So that the connection between each output and the corresponding NE555 should always be on HIGH, when i dont touch the rotary encoder. The Connection between the SW output of the rotary encoder and the Trigger of the corresponding 555 is the place this happens:

I wanted to have a Power-saving option, if i dont need the clock. So i implemented a way to just turn off everything, which isnt needed to turn it back on.
The way i implemented this is clearly not the best way. Also considering those infos:

And please note that im no expert regarding neither Arduino Code nor Electrical engeneering ^^'

I want to build a digital Bedside-Clock. Like an Alarmclock with no Alarm ^^
This has nothing to do with the kind of Clock Ben Eater is building in his Project.
I plan to use the rotary-bit of the Rotary encoder to make the Display more or less bright. To adjust for the different lightconditions. and the Button part of the rotary encoder should be used to turn off the clock. The Display is controlled by the hSPI connection, as you may have seen in my circuit diagram.

Since ive learned that i should start from the begining again i dont see the point make a new diagramm of the old design.. But im still interrested why there is this weird floating Voltage Mentioned obove. I soldered the Board in a way, that i can unplug the IC's and the NODEMCU.
So electricaly the whole circuit should look something like this:

In this configuration i use the 555 only for debouncing a simple button. While providing it with the recomended 5V. But i still got this floating voltage on the Connection Labeled SW. The Connection Labeled PWR is Always on High. Regardles of the Input on the Trigger Pin. therefore the Flipflop is not doing anything. If i Manually the Connection PWR to Gound, the Flipflop i switching.
Do you guy have any idea?

As last question:
you may have noticed, that im not that long on this Forum: so What does OP mean? mentioned in at least #18 and #15?

And one Of Topic Info:

Ben Eater has great YT-Channel talking about this Computer Project, but also about the PS2, SPI and USB Protocoll - I can full heartedly recommend him if you interressted!

Original Post and/or Original Poster, in this case, you.

1 Like