# Trying to make a negative voltage charge pump using a square wave output from a microcontroller

The need to implement this circuit started in this post I made.

I could get a negative voltage by buying an ICL7660 like some user suggested, but it would take two weeks for the parts to be delivered. While I wait, I am trying to implement the circuit below to get things going:

The permanent response is what need. To create a square wave I used an ESP32 with the following code from the Arduino IDE:

When digitalWrite(32,High) happens 3.3V will appear at that pin. I am generating a square wave with an amplitude of 3.3V and a period of 100 micro seconds.

Below is a picture of the ESP32 microcontroller with gnd pin and pin 32 (pin where I output the 3.3V) exposed:

Here is a picture of the entire circuit. There are two breadboards, ignore the circuit on the breadboard where the microcontroller is at (it's not even supplied.)

Here is a closer picture of the circuit:

This is the result:

I'm reading Vout voltage and all the voltmeter displays is 0V.

The voltage at Vin is 1.62V. I would say that's because the voltmeter gives me the average voltage and because the duty cycle of that square wave is 50% i get half of 3.3V (~1.62V.)

What am I doing wrong? I'm using 1N4148 diodes, 47nF/100nF capacitors and a 10kohm resistor . Why am I not getting any results?

• In your simulation you have a frequency of 20kHz, but you say your code is pulsing at 10kHz. Which one is the intended frequency? Commented Oct 10, 2022 at 18:35
• What is the value of your load resistor? Commented Oct 10, 2022 at 18:35
• I'm using a 10kohm resistor, the LTSpice results are the target but no matter what value i put in delayMicroseconds i always get 0V at the output. Commented Oct 10, 2022 at 18:38
• Change C1 to 1 uF and C2 to 100 uF. Careful of the capacitors' polarities.
– user173271
Commented Oct 10, 2022 at 18:46
• The load voltage will be the input waveform amplitude minus two diode drops minus a bit of droop. Use shottkey diodes for a larger output voltage.
– user173271
Commented Oct 10, 2022 at 18:49

Well, dang it. I need to get my eyes checked (again.)

You have your multimeter connected to ground. Both probes are connected to wires that go to the ESP32 ground.

• Connect the black probe to the black ground wire.
• Connect the red probe to the junction of R1, C2, and D4.

I'd start by using the pulse width modulation (PWM) functions of the ESP32 instead of using the delayMicroseconds functions. It will be more reliable, and your ESP32 can do other things at the same time. Check out this description of using the PWM functions. That won't necessarily help with your current problems, but it is a good thing to learn about for future projects.

The circuit in LTspice looks OK. The simulation works, so it must be right.

Your circuit on the breadboard mostly looks OK, but one capacitor (C2 in your LTspice diagram) seems to be missing the ground connection.

I'd use Schottky diodes rather than the 1N4148. The voltage drop across the diodes will be less, giving you more voltage for the charge pump. You'll get a larger negative voltage output that way.

The final thing is that I wouldn't trust the pins of the capacitors and diodes to make good contact with the breadboards. Given how thin the legs are, it would surprise me if they are making contact at all. Disconnect power from the circuit, then use the ohmmeter function on your multimeter to check for connections between all the diodes and capacitors.

• C2 seems connected to ground in the diagram. Commented Oct 10, 2022 at 18:58
• @AmitM: It is connected in the diagram, but in the real circuit it looks like it is not connected.
– JRE
Commented Oct 10, 2022 at 18:59
• C2 is connected to that orange jumper cable, that cable is connect to ground Commented Oct 10, 2022 at 19:08
• OK. It was hard to see in the photos.
– JRE
Commented Oct 10, 2022 at 19:08
• @G0tBlackOps: This blog post gives some details about voltage multipliers. Your charge pump is a single stage voltage multiplier. Use n=1 in the equations in the blog post.
– JRE
Commented Oct 10, 2022 at 20:23

You may need a low frequency signal perhaps like 1Khz or 250 Hz. if you are just generating a voltage signal, why make it a high frequency signal? Just stick to low frequency like 250 or 500Hz. The circuit seems to be working in the simulation. Maybe the pins of capacitors or something else are not properly connected to the circuit as JRE suggested.

• The high frequency is fine. It makes it possible to use low value capacitors. This thing will never put out more than a few milliamperes because the ESP32 can only deliver a few milliamperes through the GPIO pins.
– JRE
Commented Oct 10, 2022 at 19:07
• I was just thinking that the voltage build up would be faster with a low frequency signal. It may not make any difference though with pF or uF capacitors. Commented Oct 10, 2022 at 19:16
• For a 50 percent duty cycle square wave, the energy transferred per second is pretty much the same regardless of the frequency - as long as it is considerably faster than 1Hz. What matters is the amount of current you can deliver. That depends on what the source can deliver (only milliamperes for a GPIO pin) and the impedance of the capacitors. Impedance is lower for high frequencies. At low frequencies you have to use large value capacitors to get low impedance.
– JRE
Commented Oct 10, 2022 at 19:36
• "There are frequent discharges in capacitor C2" - yes, but the recharges are just as frequent.
– JRE
Commented Oct 10, 2022 at 19:39
• It seems that a high frequency signal would keep the discharge slope of voltage shorter. So it would make the voltage build up seem continuous. Commented Oct 10, 2022 at 19:42