Cant figure out CD4538 - Page 1
Forum section: electronics / beginners

author: 3dBi
author_rank: Contributor
timestamp: March 01, 2022, 09:57:39 pm
content: Cant figure out CD4538. Problem is in highlighted section, it should give single pulse on start up and that it. Rest of the circuit works fine - when "tacho" goes high, it turns on relay for 2.2 seconds. Cant get first impulse on power on to work. What did I do wrong here?...

author: Benta
author_rank: Super Contributor
timestamp: March 01, 2022, 10:33:07 pm
content: Why do you think it would give a pulse when powering up? Nothing in the datasheet suggests that. On the contrary:"On power up the IC is reset." (from data sheet).

author: golden_labels
author_rank: Super Contributor
timestamp: March 02, 2022, 12:09:46 am
content: If I understand your intention correctly, you expect that ¬CD and A go high on power up, A triggers the pulse which is not inhibited by ¬CD. However, that means that three separate events occur nearly simultaneously:Powering on¬CD going highA going highIn your circuit they happen in an unpredictable order, which means you have arace condition.Note (added after sending this post):I missed that CD4538 triggers on edge, not level, which may make predicted outcome differ from what I’ve written below. However, the general message the post conveys still holds.From 6 possible orderings:(1)1 is guaranteed to produce a pulse, 2 are guaranteed to never do that, and 3 have behavior not defined by the datasheet:Code:P C A ✓P A C ✗C P A ?C A P ?A P C ✗A C P ?(P: power; C: ¬CD)The chip must be first powered, then ¬CD must go high, then A may trigger the pulse. If A comes before ¬CD, it will be inhibited or produce some short glitch. If power does not come first, the datasheet is not telling anything about the behavior.All six possibilities in diagrams:Code:| ______________PWR |__/| ____________ . . . ok, powered on, ¬CD not inhibiting trigger¬CD |____/| _________A |_______/| ______________PWR |__/| _________ . . . ¬CD still inhibiting while A triggers¬CD |_______/| ____________A |____/| ____________PWR |____/| ______________ . . . unspecified¬CD |__/| __________A |______/| ____________PWR |____/| _________ . . . unspecified, but likely ¬CD will inhibit A¬CD |_______/ or only a tiny pulse will appear| ______________A |__/| _____PWR |___________/| _________ . . . unspecified¬CD |_______/| ______________A |__/| _____PWR |___________/| ______________ . . . unspecified¬CD |__/| ___________A |_____/There is also one more thing to consider. Since you are using two parts of a single chip and one is fed to the other, it’s possible that IC1A generates a pulse, but a race condition occurs at IC1B. For similar reasons: it may be not fully powered yet or it’s own ¬CD may still be not high.(1)More if the chip would not be able to handle simulteanous changes in signals. But, given its nature, it’s a reasonable assumption that it can deal with them just fine.

author: 3dBi
author_rank: Contributor
timestamp: March 02, 2022, 03:32:50 pm
content: Well, I presumed when eventually first sections CD, A and B are high, then it should trigger. My LTSpice simulation of circuit also worked good. If I tie externally TACHO to +12V and do power up, trigger on startup is successful.What can I do to fix this?

author: Benta
author_rank: Super Contributor
timestamp: March 02, 2022, 05:54:44 pm
content: Why is this initial pulse even necessary?If it's a tacho you have a steady pulse train coming in. I don't understand the requirement.

author: 3dBi
author_rank: Contributor
timestamp: March 02, 2022, 09:34:46 pm
content: Idea is for controlling added custom low pressure fuel lift pump for custom tuned 1.9tdi diesel engines, with bigger turbos, injectors etc on old cars like Audi 80 A4 A6, VW's etc... To help get fuel to main pump, that does high pressure stuff. Not needed on stock car. First pulse is when you turn ignition key on, to pump any air out from fuel lines and get lines filled with fuel. Pump stays on for max ~2.2 seconds on single pulse. It's not a hard requirement, but it is a nice to have. Especially when you run out of gas, tank empty. You dont have to burn starter for main pump to get fuel from refilled tank, just cycle ignition key a few times. Some much more modern Volvo's should have this thing, because it is impossible to bleed air with high pressure pump alone. If you run out of gas - get towed to service, even with refilled tank. Stupid AF. When starter kicks in and engine is running tachometer pulses comes in - pump is fully on non stop, CD4538 being re-triggered all the time. Turning it off with engine is no issue, because pump and controller power is lost with key turn to off position.

author: Benta
author_rank: Super Contributor
timestamp: March 02, 2022, 10:03:56 pm
content: I think you need to rethink this application. The connection between tacho and fuel pump is... well.

author: golden_labels
author_rank: Super Contributor
timestamp: March 03, 2022, 12:02:54 pm
content: 3dBi: I made a slight mistake in the post above. The A input triggers on edge, not level, so some specific outputs may be different. But the general message still holds: a race condition is present.If you insist on using CD4538, you may try adding a resistor and a capacitor on the A line, so the signal is delayed a bit:Code:RdV_ign o--/\/\/---o-------A|o--/\/\/-.| Rb |Cd --- |--- || |V VRd/Cd introduce a slight delay. Rb is a bleed resistor (1MΩ or so), so the capacitor is discharged after ignition is off. A bit of experimentation needed to tell, what values work. Will not work at all, at least not reliably, if CD4538 can’t deal with slow edges. The datasheet tells nothing about that. A Schmitt trigger may be required to address that issue.You may also take advantage of low standby current of CD4538: in two dozen nanoamp range. So it may be permanently powered on, with ¬CD kept high. But that has two issues. First: it’s a typical value, not the maximum one. The maximum is in 1000× of that. Which is still not that much if you use your car regluarly, but also not something to completely ignore. For production you would need to test each device and discard those, which draw too much energy. For single implementation it’s of less concern, since most chips will be near the typical range, but you may get unlucky. The second issue is: voltage regulator will take some current too. So unless you already have that available and always on, this solution is a no-go.But I would support Benta’s idea to choose a different solution.Also, since this is automotive, remember that all lines — inputs, power supply and outputs — may see a lot of noise, including high voltage spikes. The design should take that into account.