Maker Pro
Maker Pro

Need help delaying a voltage feed for about 150ms to 300ms.

Akrylamid

Sep 4, 2015
8
Joined
Sep 4, 2015
Messages
8
I am designing a circuit board for a flashlight and I need to put a delay on the battery voltage to a voltage divider. The background is that I use a capacitor which is charged when the light is operational, and read the capacitor value when turning the light on. This is to determine weather power off was a quick power off to change modes of the flashlight, or if it was off for longer (no mode change). I also need to monitor the voltage level from the battery so it is not discharged to deeply (Li-ion cell). Previously I have had the "off time" capacitor and the voltage divider on separate pins to the MCU. No problem, works fine. On startup the pin that the capacitor is on is set to input, I read the value with analog to digital converter, then I set the pin to output high to charge the capacitor for the rest of the power cycle.

Now I want to do this on the same pin (all other pins on the ATtiny85 are used for other things). When I turn on the power I would like to delay the voltage that goes to the voltage divider with about 150ms to 300ms, and then keep feeding the voltage to the divider after the delay. This is because I have the "off time" capacitor on the same pin and would like to read the voltage level of the capacitor before the battery voltage feeds the voltage divider, which will charge the capacitor. I have extremely limited space and need to do this with as few and as small components I can find. What would the best solution be?

By searching I found a Microprocessor Reset Circuit that I thought I could use, it's the ADM1818 from Analog Devices. It's small (SC-70) and appears to have a delay of about 150ms before sending out high on reset. My problem is here that I can't figure out if the high that comes out on the ADM1818's reset pin after the delay is a pulse or if it stays on constantly high while the flashlight is on. I need it to stay on as the ATtiny85 will be used to monitor voltage level of the battery after reading the capacitor. Will it work? If it does work, will the output on the ADM1818 basically be the same as VCC (with voltage drop)?

I've been searching and searching, but as a total beginner I don't know what terms to use when searching. I don't know what delay devices that I'm looking for are called. I don't know how best to solve this. I looked at delay lines, but the delays on the ones I found are far to short.
 

Alec_t

Jul 7, 2015
3,587
Joined
Jul 7, 2015
Messages
3,587
I can't figure out if the high that comes out on the ADM1818's reset pin after the delay is a pulse or if it stays on constantly high while the flashlight is on
According to the datasheet "RST remains low while VCC is below the reset threshold and remains low for 150 ms typical after VCC rises above the reset threshold. Applies to the ADM1810, .... and ADM1818 only."
After that 150mS the output will be pulled high to Vcc by the internal 5.5k pull-up resistor and will stay at Vcc. If you want to drive something with that output signal you will need to allow for voltage drop across the 5.5k resistor.
 

Akrylamid

Sep 4, 2015
8
Joined
Sep 4, 2015
Messages
8
Thanks. I only want to feed the output into a voltage divider for voltage monitoring, and also charge a small 1uC capacitor. A voltage drop over a constant 5.5K resistor should be fine (I guess).

By reading what I want to do, is using the ADM1818 a good choice? Or should I look at something like the Texas Instruments TPL5010DDCT Nano Timer? Or something else? It's all new to me, I am clueless...
 

Alec_t

Jul 7, 2015
3,587
Joined
Jul 7, 2015
Messages
3,587
Maybe I haven't understood exactly what you're trying to do, but I think you'll have problems trying to use just one pin for the cap function and the voltage divider. From what I've read ADCs don't generally like source impedances greater than ~ 10k, and 10k with a 1uF cap has a time constant of only 10mS. Is that long enough to do all your processor configuration/set-up stuff at power-up?
 

Skidood

Aug 24, 2015
35
Joined
Aug 24, 2015
Messages
35
Use a simple RC circuit to build up a charge on a capacitor (taking about 300 mS) then use that charge level to turn on a transistor which supplies power to the voltage divider. 1 resistor, 1 capacitor, 1 transistor and I'm guessing the voltage divider can serve to limit the current through the transistor (otherwise you need another resistor to do that). The resistor in the RC network can be chosen to also limit the transistor base current as well as control the charge rate of the cap.
 

Akrylamid

Sep 4, 2015
8
Joined
Sep 4, 2015
Messages
8
Thanks for the replies.

The voltage divider that I've used on it's on pin have had 47.5K and 4.7K resistors. Tried and tested, these work fine and are used commonly.

I don't have room on the circuit board for another resistor, capacitor and transistor without sacrificing other components. As a beginner I though that components that give a delay I'm looking for would be common, I was not expecting to have to make it myself with several components. I guess I was wrong. I've maxed out all space on it and just managed to squeeze in the SC-70 so I've ordered a PCB from OSHPark and will just have to test the ADM1818 myself and see what happens.
 

AnalogKid

Jun 10, 2015
2,884
Joined
Jun 10, 2015
Messages
2,884
You will probably get more useful responses if you post your schematic so we can see what we have to work with.

ak
 

Akrylamid

Sep 4, 2015
8
Joined
Sep 4, 2015
Messages
8
Here are some simplified schematics. First, this is what it looks like when running on two pins. It's tried and tested, and works:
2pin.jpg

The sequence of operation is:
1: Turn on the flashlight.
2: Read voltage level of 1uF off-time capacitor (COT) with ATtiny85 ADC on pin PB0 once.
3: Once read, set pin PB0 to output and set high (this charges the COT capacitor).
4: Read voltage from voltage divider (R1 = 47.5K, R2 = 4.7K) with ATtiny85 ADC on pin PB1 continuously in intervals for the rest of the on cycle (battery level monitoring).
The COT reading allows me to detect short off cycles which are used to change the mode of the flashlight. I can detect up to one second duration of off time with this setup, which is more than enough.

I want to have the off-time capacitor (COT) testing and voltage divider on the same pin. To do that I have to delay the battery+ feed to the voltage divider or it will just instantly feed the pin with the divided voltage and make the COT reading useless.
1pin.jpg

I'm thing about 150ms to 300ms would be a practical delay, giving me enough time to read the COT voltage level, and short enough so I can do quick mode changes to cycle to the desired mode on the flashlight without having to have it on for a long time when cycling though several modes.

Space is very limited, I've squeezed in a SC-70 package where I'll test the if the ADM1818 will work. If I wanted to sacrifice other components for more space I wouldn't be here as I'd just use the ATtiny84 (more I/O pins) that I've used in other projects. I would really like to be able to it on one pin so I can stick with the ATtiny85, and thought there would be delaying/timing components that I could easily use.
 
Last edited:

Akrylamid

Sep 4, 2015
8
Joined
Sep 4, 2015
Messages
8
Schematics didn't seem to help. I guess I'll just have to take my questions and move on.
 

AnalogKid

Jun 10, 2015
2,884
Joined
Jun 10, 2015
Messages
2,884
This forum is not an on-demand service bureau. Your last two posts are fewer than 22 hours apart. You might ant to adjust your expectations just a bit.

At its core a delay circuit needs a timing part and a switching part. ADI, Maxim and others make uP reset parts that have 140 ms delay times without needing an external R or C, but they can't do high-side voltage switching. Plus, even though you don't state the operating voltage range for your circuit in any of your posts, you would need a P-channel MOSFET with a very low Rdson. The simplest circuit would be a resistor, capacitor, and logic-level P-channel MOSFET or PNP transistor. Either way, the transition from off to on will be a relatively slow ramp, and the voltage into the R1-R2 divider will be different with the switch circuit installed. But, if you don't have the room, you don't have the room.

ak
 

Akrylamid

Sep 4, 2015
8
Joined
Sep 4, 2015
Messages
8
This forum is not an on-demand service bureau. Your last two posts are fewer than 22 hours apart. You might ant to adjust your expectations just a bit.
Sorry about that, will do.

At its core a delay circuit needs a timing part and a switching part. ADI, Maxim and others make uP reset parts that have 140 ms delay times without needing an external R or C, but they can't do high-side voltage switching. Plus, even though you don't state the operating voltage range for your circuit in any of your posts, you would need a P-channel MOSFET with a very low Rdson. The simplest circuit would be a resistor, capacitor, and logic-level P-channel MOSFET or PNP transistor. Either way, the transition from off to on will be a relatively slow ramp, and the voltage into the R1-R2 divider will be different with the switch circuit installed.
So I guess there are no single components that do this. I thought that delays like this would be common enough that there would be components avaible. The amount of functionality manufacturers have squeezed into the SC-70 package is amazing, I thought delay circuit components like this would be a common thing.

Voltage is 3 to 4 volts for single cell lights, 6 to 8 volts for dual cell lights (MT-G2 and XHP70 based lights). As mentioned, I've got a board design on the way with the ADM1818, I'll test it and see what happens. If it doesn't work I'll test without any delay components as the charging of the cap should take longer than the discharging (because of the difference between R1 and R2), maybe rendering usable readings. If that doesn't work I've just designed and ordered a backup board with the ATtiny84, sacrificing two AMC7135 regulators.
 
Top