Help with timer circut

So I’ve been trying to make a circuit that has a float switch which will start 3 timers plus a button for reseting the 555.

I haven’t added transistors to drive relays after the timers, but I wanted to know if my thinking is good, overcomplicated, or just terrible.

Firstly, ignore the resistor and capacitor values below. I was just trying to get it to work on the simulator, so they aren’t accurate to the times I need. Also I haven’t put any input protection or bypass cap in the simulator but I plan to once I get the PCB stage. I also haven’t put any start up delays into the 555 timer but will.

The components I’m using are a 3’ of RC timers (one delay ON) interfacing with a CD40106 and a 555 timer for latching after Timer C triggers. The 3 timer components all driven by a float switch moving to the UP position and making the input signal go from HIGH to LOW.

Timer A - ~ 15 seconds and will drive a relay and a pilot LED with driven by a MOSFET.

Timer B - ~ 20 mins and will signal pilot LED driven by a MOSFET.

Timer C - This one is more complicated (but pretty basic). If the float switch gets held on for more than 10 seconds, then trigger the 555 timer to latch triggering the emergency setup.

This will be an emergency event and indicates a failure. I was trying to use the spare inverter pins in the CD40106 for the latching component, but this was the only way I could get it working. In my naivety/inexperience,

I feel that, although I’ve made it work on the simulator, it feels like it could be simpler than what I’ve done.

Thanks in advanced for any feedback and help.

r/AskElectronics - Unsure about my timer circuit design|750xauto

EDIT: Some grammar corrections

1 Like

Hey @Hamish140240,

Welcome to the forum!

Welcome to the forum!

It looks like you’re using the 555 as a latch. You could simplify this by using a CD4013 flip-flop instead. Timer C’s output could clock the flip-flop, and you can reset it with a button.

Also, make sure to add a debounce circuit around the float switch to prevent the timers from being triggered erratically.

1 Like

Hi Hamish.
Look it does seem complex.
But I don’t see why it wouldn’t work once all the components are in and correct.

I have ideas of how to simplify it, but as it stands it seems like you understand it which is more important. :slight_smile:

If your worried about it the wiring, which will be a lot once all your components are in, I think a lot of this circuity could be re-designed in terms of logic gates. and that might do’ away with the so latch in the 555. I’d only bother if you need to make lots of these.

Cool man. Whats it for?

1 Like

Hi Hamish
Can you attach a pic that can be expanded to read it. It is almost impossible to read the text without exploding the entire screen
Cheers Bob

1 Like

Thanks Ryan, this is what I was trying to do but for the life of me I couldn’t get it working on the simulator. Maybe I got the voltage divider messed up but it wasn’t working :frowning:

Im not worried about wiring but just know that I can get it working without a 555 timer to latch but can’t seem the to get the CD4013 to latch so defaulted to do something I know in a 555 latching circut.

I will redo the schematic in KiCad and publish it shortly.

That’s the maker way. I say go for it. 555s are fun.

1 Like

Hey @Hamish140240,

That’s totally fine, flip-flops can be tricky in simulation, especially when dealing with voltage dividers and timing thresholds.

If it’s not working yet, you can stick with the 555 latch since it behaves the same way. Once your basic circuit is working, you can revisit the CD4013 for a cleaner design.

Also, make sure the signal from Timer C is a clean digital edge. Coming out of the CD40106, it should already be clean, but there may be a logic level mismatch or something weird causing an issue with latching.

Hi Hamish

I might be missing something here but I don’t see a “voltage divider” anywhere.

When you publish the KiCad version please give the components identification like C4, R2 etc. Makes it easier and less prone to misunderstanding when replying.
Cheers Bob

No voltage divider here. I was talking about struggling to make a latch out of the remaining pins on the CD40106.

I played around with KiCad and took your advice 4013 latch as I can use the other side elsewhere.

The input pin is something I did ages ago and I don’t actually know if its even necessary or done correctly but I just wanted to add protection to the external pins.

Any comments are very appreciated.

2 Likes

Hey @Hamish140240,

A couple of quick notes:

  • According to the CD40106 datasheet: “When using multi-bit logic devices, inputs must never be left floating.” Make sure to tie unused inputs to either VCC or GND. It’s fine to leave the outputs unconnected.
  • Consider adding a simple debounce circuit to the RESET_BUT if you haven’t already.
1 Like

Hi Hamish
That makes it a bit easier.
I see you heeded advice and dropped the 555. It was not used as a timer anyway, just a latch. The timing appeared to happen in the trigger input circuit.

Firstly the float switch circuit.
I don’t know what R24 is doing. It could be meant as a pull up for the float switch but whether it is needed or not would be open for discussion. What it WILL do however is prevent the float switch pulling this point any lower than about 1V above ground. This should only affect the timing a bit as the caps will only discharge to this point plus 1 diode drop. That is they will always start at about 1.7V.
By the way R23 and R24 combination is the only voltage divider I can see BUT ONLY when the float switch is closed.

Timer A and B. Pretty straight forward. Timed C charge via series resistor and trim pot. Rapid discharge via diode and float switch.

Timer C. The reverse. C20 charged rapidly (??) via R19, D13. Timed discharge vis R18, RV2 and float switch. C20 and R19 give a time constant of 1Sec. If this is a bit long you may have to reduce R19 and /or C20 to suit but changing C20 will upset the discharge timing.

It has been a long time since I have had anything to do with a 4013 but I do remember it being a very handy IC to have around. Will have to brush up on how it behaves before I comment further.

The outputs MUST be left unconnected. Connecting these to VCC OR Gnd could have disastrous results. But DO do something with the inputs, usually grounded.

Ryan. I am not sure this is required. I think the reset will respond to the initial action and ignore anything else until the latch is “set” again. I think the same applies here, everything else is ignored until “Reset” is activated. Will have to look at the data sheet to make sure of this. I think this is one of the things that makes this IC so useful.
Cheers Bob

Add on: I WOULD recommend using multi turn (10 or 20 turn) pots for your timing adjustment as they will be much much easier to set than the little 270º devices.

Another Add on:
If that apron 1V drop across R23 is embarrassing or a nuisance it can be avoided.
I think that 1kΩ should be there to tame the discharge currents from a total of 1200µF. This will be limited to 12mA by R23.
The voltage divider effect due to this R can be negated by moving R24 to the other end of R23, that is to the float switch end. The pull up will still be there if you feel you need it but you will now have only 0.6 - 0.7V (one diode drop) above Gnd for the caps.

Another thing. The 1000µF cap could be embarrassing. There is a practical limit to high values in this type of timing circuit. Not all caps are perfect. The one you use (or all of them) need to be low ESR types and low leakage currents. Especially the 1000µF one. If the leakage is too high the equivalent parallel resistance will form an unwanted voltage divider and the capacitor might never charge. If you find it is behaving strangely, particularly if the time seems to be too long, this might be the reason. So don’t panic looking for non existent problems. There is probably a way around it, all we have to do is find out what.

1 Like

Hey @Robert93820,

Just looking at section 8.1 of the CD4013 datasheet, it does sound like switch debounce is optional as the device will usually respond correctly to an edge from a mechanical pushbutton.

I do think it’d be best practice to include a pull‑down resistor (say 10 kΩ–100 kΩ) from RESET to GND, to ensure that pin is always at a valid logic level when the switch isn’t pressed. Floating CMOS inputs can behave unpredictably, so I’m thinking a pull‑down here would keep it deterministic.

Hi Ryan

Agreed. Always a good idea I thing to have these very high impedance inputs in some sort of controlled state. I did get the impression though that these circuits provided are incomplete and any “outboard” bits not shown.
Good thing to mention this though as it is often overlooked.
Cheers Bob

2 Likes

Hey @Hamish140240,

Just see above for ensuring you have the outputs set up correctly on the CD40106. As well as notes about the RESET line for CD4013 :slight_smile: