# Timing a circuit's 'on-cycle' after a push button switch is pressed

First off, thank you for reading all of this - you are the part of the internet that gives me hope for mankind. I’m looking for a circuit that I would think is relatively straightforward, but has a few important nuances.

The end goal is to turn on a user to have the ability to hit a push button switch, which sends power an electromagnet. The electromagnet will be on for a period of one hour. I would like to be able to easily switch the design to two hours, but the PCB itself will have a single predetermined time period.

After the hour is up, the electromagnet turns off and stays off until the next button press.

• During it’s ‘off’ phase, I need minimum power drain – I would like a long shelf life

• The circuit is being run off of 2 AA batteries. With the batteries hooked up directly to the electromagnet, the 3v results in approximately 30ma is being drawn from the electromagnet, scaling down as the batteries drain (alkaline batteries).

• A cheap solution is necessary – this is going into a product with pretty low margins. Hoping for less than $2 for the PCB fabrication & assembly. • If anything goes wrong (eg soldering crack, etc) it is important that the electromagnet is off. Thus far, we have been experimenting with the TI5111 nanotimer in ‘one-shot’ mode. http://www.ti.com/product/TPL5111. We have ran into a few hiccups using this (eg voltage drop of npn transistor) I'm looking into micro controllers, such as https://www.microchip.com/wwwproducts/en/PIC10F200#additional-features but the datasheet blows my mind. I'm basically just looking for something I can put between the batteries and electromagnet that results in a button press allowing the 3V to go through to the electromagnet, then shutting it off after an hour or two. oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo on a side note: I've had a lot of people comment on the amount of button presses given I'm only using 2 AA. The electromagnet can hold what I need as long as the current is above 15ma. I'm purposefully drawing 30ma to begin, knowing that the alkaline batteries I'm using will lose voltage as they are used. Based on spec sheets, I expect 2500maH before the voltage drops from 1.5v per battery to .8, which would cut my current from 30ma to right around 15ma. Given this logic, and drawing around 25ma on average, I would expect around 100 hours of 'on-time'. I only need this to last 60ish hours, so I'm good on that aspect. But if there is a large significant voltage drop between the batteries and electromagnet due to the timing solution, I can get into some trouble because there isn't a ton of room for the voltage to decay. Eg we used a npn transistor with the ti5111 timer and it resulted in a .7V drop between drain and source (we are trying to work around this), so my electromagnet was only receiving 2.3V on a 3V battery, which would drop the number of uses significantly as the batteries drained. ooooooooooooooooooooooooooooooooooooooooooooooooooooooo Any suggestions on whether you would use a microcontroller or something like the TI5111 timer? I'm not an engineer, so this is all new to me. We are looking to implement this in a consumer product, so the less than$2 per for the electronics is on a relatively large order (1000-5000).

Any help is very much appreciated - let me know if you have any questions!!

• TI5111 is bad choice since it is designed to drive logic input. What you need is TI5110, designed for P-FET. Everything else is exactly the same. – Maple Aug 10 '18 at 2:01
• We initially were using the TI5110 with a p channel transistor, but if something was soldered incorrectly we thought there was risk that it would stay on past the allotted time - which is why we switched to the 5111. Could we make a failsafe design with the 5110? – Steve Butler Aug 10 '18 at 2:09
• Sorry, that does not make any sense. If something soldered incorrectly you can for example short-circuit the battery, regardless of what chip you are using. The behavior of both chips is exactly the same, so the imagined "risk" is also identical. And I hope you mean p-channel MOSFET, not PNP BJT. Also, if this is supposed to be mass-production then "soldered incorrectly" sounds really strange. That's what quality control is for. – Maple Aug 10 '18 at 2:23
• You can do this with a 20 cent CMOS Clock /binary counter with a power Logic level FET (Vt<1V) delay outputs are clk /2^N next output goes to disable with inverter. Button controls Reset. – Sunnyskyguy EE75 Aug 10 '18 at 2:32
• We have ran into a few hiccups using this (eg voltage drop of npn transistor) .... you will run into the same "hiccups" with almost any chip that you decide to use ... the issue is with using a correct driver circuit to interface a digital output to an electromagnet – jsotola Aug 10 '18 at 2:42