Simple 1 second 1mA-10mA analog oscillator for green/red/white/blue LED pulsing - Page 1
Forum section: electronics / projects

author: eneuro
author_rank: Super Contributor
timestamp: December 25, 2024, 08:22:10 pm
content: Hello,I am working on a simple 1 second 1mA-10mA analog oscillator to pulse green/red/white/blue LED using only resistors, capacitors, BJT transistors,diodes powered by 3.9V 18650 Na-ion batteryOld school THT PCB layout best sized for a 18650 battery holder 75mmx20mm.Any ideas?UPDATE: It seems that it is worth testing this RC phase-shift network oscillator circuit in a simulator with C=10uF and R=6.8k I should have ~1HzFor now I have no idea how to choose R1, RL, Re and whether these output capacitors are needed in what values?

author: Zero999
author_rank: Super Contributor
timestamp: December 25, 2024, 10:49:22 pm
content: It's just a common emitter amplifier.Here's a tutorial.https://blog.mbedded.ninja/electronics/circuit-design/bjt-common-emitter-amplifier/

author: PCB.Wiz
author_rank: Super Contributor
timestamp: December 26, 2024, 12:26:47 am
content: Quote from: eneuro on December 25, 2024, 08:22:10 pmLinks should tell you this needs a gain of (exactly) 29. It is normally used for (quasi) sine generation, but you wanted pulsed drive ?There are simpler (fewer RC parts) oscillators that will give pulsed drive.You should work back from what duty cycle you actually need, and how accurate do you need the 1-10mA ?3.9V has very little headroom for white/blue led drive.

author: Analog Kid
author_rank: Super Contributor
timestamp: December 26, 2024, 12:34:40 am
content: When you say "pulsed", what exactly do you mean?IOW, what duty cycle do you want (meaning how long do you want the LEDs to be lit for each cycle)?If the answer is "about 50%", meaning equal on and off times, my vote would be for a simple astable multivibrator circuit that gives a nice square wave output:(Ackshooly, if you want something other than 50% duty cycle you can make it "lope" by choosing a different RC for each side of the oscillator.)

author: TimFox
author_rank: Super Contributor
timestamp: December 26, 2024, 01:17:31 am
content: The simplest solution to a low-frequency generator is the old-fashioned 555 timer IC.The original bipolar version can output up to 200 mA.https://www.onsemi.com/pdf/datasheet/lm555-d.pdf

author: PCB.Wiz
author_rank: Super Contributor
timestamp: December 26, 2024, 01:41:19 am
content: Quote from: Analog Kid on December 26, 2024, 12:34:40 amCircuit is correct, but the waveforms you attached do not belong to that.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: December 26, 2024, 01:42:25 am
content: Quote from: TimFox on December 26, 2024, 01:17:31 amThe OP did state :using only resistors, capacitors, BJT transistors,diodes

author: Analog Kid
author_rank: Super Contributor
timestamp: December 26, 2024, 01:45:36 am
content: Quote from: PCB.Wiz on December 26, 2024, 01:41:19 amI didn't attach anything: I harvested that graphic from the web complete.So the cap waveform is wrong: BFD.The square-wave output is correct, and that's what matters.

author: TimFox
author_rank: Super Contributor
timestamp: December 26, 2024, 02:30:15 am
content: Quote from: PCB.Wiz on December 26, 2024, 01:42:25 amSo he did. However, the 555 is simpler, which is what I said.

author: themadhippy
author_rank: Super Contributor
timestamp: December 26, 2024, 02:45:44 am
content: simplest way is buy a flashing led or is that cheating.Pity the lm3909 is long gone.

author: eneuro
author_rank: Super Contributor
timestamp: December 26, 2024, 05:14:57 am
content: In a simple simulation, such a circuit for NPN BC547C transistors seems to work as required, but I did not have time to test it in practice, and I did not simulate it at a lower battery voltage of 3.3V

author: inse
author_rank: Super Contributor
timestamp: December 26, 2024, 05:56:26 am
content: And add the LED with the according forward voltage + do a supply voltage sweep.

author: Zero999
author_rank: Super Contributor
timestamp: December 26, 2024, 11:34:56 am
content: It can be done with a single transistor phase shift oscillator. Here's a circuit I designed awhile ago, but I haven't built.phaseshift LED flash.asc

author: eneuro
author_rank: Super Contributor
timestamp: December 26, 2024, 04:39:14 pm
content: Quote from: Zero999 on December 26, 2024, 11:34:56 amI haven't tested mine on a PCB yet, in the simulation for power supply values ​​from 3V3 to 3V9 and for 9V the frequency was around 1Hz, only the Ton/Toff times changed a bit, but that doesn't matter in this case.Two additional transistors can be used for current limiting

author: PCB.Wiz
author_rank: Super Contributor
timestamp: December 26, 2024, 06:23:30 pm
content: Quote from: eneuro on December 26, 2024, 04:39:14 pmRun the sim for a while ?That cap into a base is going to DC restore over time.The cap may not be needed at all, if the first stage bias is trimmed.Also see #12 for a way to keep those 10uF polarised.

author: Zero999
author_rank: Super Contributor
timestamp: December 26, 2024, 06:37:13 pm
content: Here's a version, which will work from 3V to 4.2V. It uses a red LED and much lower value bias resistors. There isn't enough headroom for a white LED, without a separate driver.Why use phase shift and not the usual astable? I though it was just an interesting way to flash an LED with only one transistor.

author: eneuro
author_rank: Super Contributor
timestamp: December 26, 2024, 08:38:34 pm
content: Quote from: PCB.Wiz on December 26, 2024, 06:23:30 pmCreating a non polar capacitor from 2 polarized capacitors

author: Analog Kid
author_rank: Super Contributor
timestamp: December 26, 2024, 09:13:21 pm
content: Quote from: eneuro on December 26, 2024, 08:38:34 pmWelllll, maybe ...Don't think that'll work under all circumstances, as the caps will be reverse-polarized half the time. They're not diodes.Hey, how about this? Although you have that pesky ~0.7 volt Vfto deal with:

author: TimFox
author_rank: Super Contributor
timestamp: December 26, 2024, 09:22:42 pm
content: Quote from: Analog Kid on December 26, 2024, 09:13:21 pmThe illustration is a normal way to construct a non-polarized electrolytic capacitor from two polarized units.The unit that is reverse-polarized will conduct like a diode enough to make the series connection work.In a phase-shift oscillator circuit posted above by Zero999, the junction between two capacitors in the phase network is returned through its resistor to a bias voltage to keep each of the two capacitors polarized (rather than make one non-polarized unit).

author: inse
author_rank: Super Contributor
timestamp: December 26, 2024, 09:28:28 pm
content: Analog Kid, run the Grey Matter (tm) simulator for both polarities twice and check the result

author: Analog Kid
author_rank: Super Contributor
timestamp: December 26, 2024, 09:28:58 pm
content: So will the total capacitance be 5 or 10μF?

author: Analog Kid
author_rank: Super Contributor
timestamp: December 26, 2024, 09:29:54 pm
content: Quote from: inse on December 26, 2024, 09:28:28 pmLooks OK to me; what am I missing here?

author: inse
author_rank: Super Contributor
timestamp: December 26, 2024, 09:31:32 pm
content: I meant your diode suggestion

author: inse
author_rank: Super Contributor
timestamp: December 26, 2024, 09:36:54 pm
content: The antiserial construction is supposed to work but the applied voltage has to be far below the rated voltage to avoid destruction of the oxide layer, afaik.The capacitance will be 5uF

author: Analog Kid
author_rank: Super Contributor
timestamp: December 26, 2024, 09:37:25 pm
content: Quote from: inse on December 26, 2024, 09:31:32 pmYes, that's what I'm referring to.Can you tell me what's wrong with it? Not that I think it'll actually work, just threw it out there as a semi-joke.Polarity-wise it looks OK to me.Of course, I realize the non-linear operation of the diodes would be a problem.Trying to learn here.

author: eneuro
author_rank: Super Contributor
timestamp: December 26, 2024, 09:47:28 pm
content: Quote from: inse on December 26, 2024, 09:36:54 pmIt is enough to use eight 10uF capacitors to have an equivalent electrical circuit in the case when you do not have two non-polarized 10uF capacitors, but there are such in the SMD version, but they are probably several times more expensive than the regular polarized 10uF, and I do not have such, and it is Xmas time, so we use what we haveNow all that's left is to design the PCB in Kicad 8

author: Analog Kid
author_rank: Super Contributor
timestamp: December 26, 2024, 09:57:43 pm
content: Any reason why you don't want to use the somewhat simpler astable multivibrator here?

author: TimFox
author_rank: Super Contributor
timestamp: December 26, 2024, 10:01:55 pm
content: See page 9 ("anti-series connection" paragraphs) of this CDE application note for electrolytic capacitors for a discussion of back-to-back connection for non-polarized unit.https://www.cde.com/resources/technical-papers/AEappGuide.pdfThis non-polarized circuit is often used in loudspeaker crossover networks, where bias voltages are not available.The note discusses voltage ratings, especially for use in AC motor circuits.The net capacitance for two identical capacitors in anti-series is 1/2 the capacitance of each.

author: inse
author_rank: Super Contributor
timestamp: December 26, 2024, 10:05:01 pm
content: Regarding the diode circuit:If alternating voltage is applied, each cap can be charged only once and never be discharged

author: Analog Kid
author_rank: Super Contributor
timestamp: December 26, 2024, 10:10:18 pm
content: Quote from: TimFox on December 26, 2024, 10:01:55 pmHere, I'll save people the trouble of downloading that PDF:Quote

author: Analog Kid
author_rank: Super Contributor
timestamp: December 26, 2024, 10:11:14 pm
content: Quote from: inse on December 26, 2024, 10:05:01 pmOK, thanks.You could have said that before and saved a bit of back-and-forth here.

author: TimFox
author_rank: Super Contributor
timestamp: December 26, 2024, 10:26:02 pm
content: Quote from: Analog Kid on December 26, 2024, 10:10:18 pmI posted the site so that other people could find details about aluminum electrolytic capacitors.Another important paragraph discusses the voltage capability of the anti-series connection:"CDE also offers non-polar capacitors in a single can, using two anode foils and no cathode foil. Most motor-start capacitors arealso constructed this way. These are available for momentary-duty AC applications like motor starting and voltage-reversingapplications, but the high dissipation factor of aluminum electrolytic capacitors— often exceeding 2% – causes excess heatingand short life in most continuous AC applications. The reverse voltage capability is not constrained to be the same as the for-ward voltage, as we can also create special designs that have, for example +400 VDC and -25 VDC capability. This is done by usingtwo anode foils with different formation voltages."

author: Zero999
author_rank: Super Contributor
timestamp: December 26, 2024, 11:16:36 pm
content: Quote from: eneuro on December 26, 2024, 09:47:28 pmThat's just silly. The capacitors can easily biased, so ordinary polarised capacitors can be used. Refer to my schematic.There's also the issue of that capacitor on the input to your LED driver just charging up, so the LEDs will stop flashing fairly quickly.Quote from: Analog Kid on December 26, 2024, 09:13:21 pmYes capacitors are diodes. The diodes are just in parallel, not series. In fact, the electrolytic capacitor was originally used as a diode.https://en.wikipedia.org/wiki/Electrolytic_capacitor?useskin=vector#OriginHere's an equivalent circuit for two electrolytic capacitors connected back-to-back.

author: Analog Kid
author_rank: Super Contributor
timestamp: December 27, 2024, 12:02:58 am
content: Quote from: Zero999 on December 26, 2024, 11:16:36 pmDon't want to belabor the point (a side issue in this thread), but wouldn't that suffer from the same problem as my example, the caps never getting a chance to discharge?For some reason that one always bites me in the butt.

author: Konkedout
author_rank: Frequent Contributor
timestamp: December 27, 2024, 05:16:27 am
content: How about using one LM324 quad op amp?This seems to work in LTSpice. It is hard to beat the price of a single LM324.

author: inse
author_rank: Super Contributor
timestamp: December 27, 2024, 05:37:35 am
content: Quote from: Analog Kid on December 27, 2024, 12:02:58 amC‘mon, just think through the two phases:+ on the left, - on the rightand then reversed polarity..You will have nominal capacity if amplitude >> Vf

author: eneuro
author_rank: Super Contributor
timestamp: December 27, 2024, 09:27:40 am
content: Quote from: Analog Kid on December 26, 2024, 09:57:43 pmEnjoy these beautiful analog current slopes powering the LED

author: eneuro
author_rank: Super Contributor
timestamp: December 27, 2024, 10:36:38 am
content: Quote from: Konkedout on December 27, 2024, 05:16:27 amI tested this circuit in the simulator, the power cut, i.e. negligible current consumption will be at 1.5Vcc, which is ideal in the case of powering it from many Na-ion batteries connected in parallel, while at 2.5Vcc a few more red LEDs connected in parallel will be visible at night.The advantage of this simple oscillator in this version is that it works for a wide range of supply voltages and protects even a single Na-ion battery from complete discharge, also in the case of a single Li-ion, especially with white or blue diodes, it will be very difficult to completely discharge it.

author: Zero999
author_rank: Super Contributor
timestamp: December 27, 2024, 01:45:48 pm
content: Quote from: Konkedout on December 27, 2024, 05:16:27 amI've put the model in the .asc so only one file is needed.It's a ring oscillator.

author: Ian.M
author_rank: Super Contributor
timestamp: December 27, 2024, 01:53:37 pm
content: Way back in 2018 I posted a squegging Joule Thief LED flasher:https://www.eevblog.com/forum/beginners/weird-one-transistor-led-blinker-circuit/msg1981934/#msg1981934You'll need the freeLTspice simulatorto open the sim I attached.For a Joule Thief (or other boost LED drivers) LED Vf must be greater than the battery voltage. If you are using a LiPO or Na-ion battery, you will need a few LEDs in series to meet this requirement - two for blue or white, more for other colors. There is no undervoltage cutout so use a protected battery.

author: Zero999
author_rank: Super Contributor
timestamp: December 27, 2024, 06:07:50 pm
content: Quote from: Ian.M on December 27, 2024, 01:53:37 pmOr just connect the LED between the output and +V?

author: Konkedout
author_rank: Frequent Contributor
timestamp: December 27, 2024, 08:34:13 pm
content: Quote from: Zero999 on December 27, 2024, 06:07:50 pmWhat I do not like about this circuit is that reverse Vbe on the 2N2222 may destroy it. I am seeing 4V in your simulation. Back in 1980 I had a design which had a few volts of reverse Vbe on a small signal transistor. Even though the reverse Vbe was absolutely within the device ratings, those transistors were dying. I fixed the problem by clamping this voltage with a 1N4148 diode added across Vbe.Unfortunately this diode makes your oscillator run at 774 KHz,

author: PCB.Wiz
author_rank: Super Contributor
timestamp: December 27, 2024, 09:27:15 pm
content: Sine we have many variants. here is one with asingle capacitor timing.It is a discrete BJT thyristor/UJT sawtooth oscillator, with optional temperature compensation, (tested at 5V) and gives a pulse drive to the LED for extended battery life.

author: Zero999
author_rank: Super Contributor
timestamp: December 27, 2024, 11:00:45 pm
content: Quote from: Konkedout on December 27, 2024, 08:34:13 pmThe diode can be put in series with the base instead, but I wouldn't worry. The 2N2222 can withstand a reverse voltage of 6V, without being damaged.https://www.onsemi.com/pdf/datasheet/p2n2222a-d.pdf

author: eneuro
author_rank: Super Contributor
timestamp: December 28, 2024, 04:13:33 am
content: Quote from: Ian.M on December 27, 2024, 01:53:37 pmNa-ion batteries can be discharged to very low voltages, the ones supplied are around 2.5V.I added a current limit by using additional transistors, thanks to this circuit generates pulses around 1Hz in the voltage range of 2.5V-24V, you can insert several LEDs in series as a load with several batteries connected in series, but in practice this load will be several LEDs with small resistors powered in parallel from batteries connected in parallel protected by a diode to prevent current flow between cells, so it's good that it works at low voltages below 3.2V with red LEDs.

author: eneuro
author_rank: Super Contributor
timestamp: December 28, 2024, 08:18:10 pm
content: Quote from: PCB.Wiz on December 27, 2024, 09:27:15 pm5v is useless for 18650 cells, because to extend the battery life it is better to charge to 3.9V for Li-ion"Most Li-ions charge to 4.20V/cell, and every reduction in peak charge voltage of 0.10V/cell is said to double the cycle life. For example, a lithium-ion cell charged to 4.20V/cell typically delivers 300–500 cycles. If charged to only 4.10V/cell, the life can be prolonged to 600–1,000 cycles; 4.0V/cell should deliver 1,200–2,000 and 3.90V/cell should provide 2,400–4,000 cycles."https://batteryuniversity.com/article/bu-808-how-to-prolong-lithium-based-batteries

author: Zero999
author_rank: Super Contributor
timestamp: December 29, 2024, 10:55:51 am
content: Quote from: Konkedout on December 27, 2024, 05:16:27 amI've just realised six of those resistors aren't needed. Use one potential divider to get half the supply voltage and connect it to all parts of the circuit which require it.

author: eneuro
author_rank: Super Contributor
timestamp: December 29, 2024, 06:33:51 pm
content: Quote from: Konkedout on December 27, 2024, 05:16:27 amPrice is not everything, ease of adaptation to new tasks. This is the version of my circuit in the "SMA" Sourface Mount Artversion because I use a single-sided board with a few insignificant SMD components, even holes will not be drilled, because the bottom of the PCB will be an insulator, the whole soldered in the middle of a 20mm copper pipe, filled with paraffin, because it is a very good insulatorThis PCB can be easily redesigned to fit into a copper pipe with an external diameter of 20mm, because then the 18650 batteries can be packed perfectly inside, even in a heat shrink tubing

author: inse
author_rank: Super Contributor
timestamp: December 29, 2024, 06:59:38 pm
content: And for what reason are you not going entirely SMD?The electrolytics won‘t be nice to solder unless they hover several mm above the PCB.

author: eneuro
author_rank: Super Contributor
timestamp: December 29, 2024, 08:23:18 pm
content: Quote from: inse on December 29, 2024, 06:59:38 pmThis is a board for testing, now it's Xmas & New Year time, the ordered electronic components in Europe won't arrive soon, it's no problem to change the footprint in Kicad 8, which I did, because of instead of resistor R4 you can solder a cut-off piece of the resistor lead, it doesn't need to be 100R there, similarly the SMD diode D3 will be useful for testing, ultimately it's not needed, previously it was a regular 5mm LED, I can solder one for testing, because this board is easy to make using the thermal transfer method, etch in home conditions, you don't even need to drill anything.