Lavitating water drops

Hello folks,

I need help. I am stuck. I tried to build a project similar to this one RGB-Time-Fountain. The LEDs flash at about 45 Hz, and due to the stroboscopic effect the water drops seem "frozen" over time.
But unfortunately mine doesn't work.
I do not know why!

My code:

Inspired from
Using PWM library from

#include <PWM.h>

int ledPIN3 = 3;                  // the pin that the Diaphragm Water Pump is attached to
int dutyCyclePIN3 = 245;          // ~ 96%; between 0-255
int ledPIN10 = 10;                // the pin that the LED strip is attached to
int dutyCyclePIN10 = 20;          // ~ 7.8%; between 0-255
int32_t initialFrequencyPIN10 = 55;  // frequency in Hz
int32_t readPotentiometer;        // initialise variables betwen 0 - 1023

int32_t frequencyPIN3 = 200; //frequency (in Hz)
int32_t frequencyPIN10 = 55; //frequency (in Hz)for PIN 10, it will depend on the potentiometer

void setup()
  //initialize all timers except for 0, to save time keeping functions

  //sets the frequency for the specified pins PIN3 and PIN10
  bool successPIN3 = SetPinFrequencySafe(ledPIN3, frequencyPIN3);
  bool successPIN10 = SetPinFrequencySafe(ledPIN10, frequencyPIN10);

  //if the pin frequency was set successfully, turn pin 13 on for PIN3
  if (successPIN3) {
    pinMode(13, OUTPUT);
    digitalWrite(13, HIGH);

  //if the pin frequency was set successfully, turn pin 13 off for PIN10
  if (successPIN10) {
    pinMode(13, OUTPUT);
    digitalWrite(13, LOW);

  // designate pin A0 as an Analog INPUT for the potentiometer
  pinMode (A0, INPUT);

void loop()

  // set frequency for PWM PIN 10, duty cicle remains 8% i.e. 20
  readPotentiometer = analogRead(A0); // read values from potentiometer in terms of voltage
  frequencyPIN10 = map(readPotentiometer, 0, 1023, 45, 65); // map those values from 45 to 65; the frequency between 45 Hz and 65 Hz
  if (initialFrequencyPIN10 != frequencyPIN10) {
    SetPinFrequencySafe(ledPIN10, frequencyPIN10);
    initialFrequencyPIN10 = frequencyPIN10;

  //use this functions instead of analogWrite on 'initialized' pins
  pwmWrite(ledPIN3, dutyCyclePIN3);
  pwmWrite(ledPIN10, dutyCyclePIN10);


Thanks in advance

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

That is a very lame description. What does it do or not do exactly ?

Thank you for your prompt answer. Sorry for not being precise. The pump is not pumping water, and the led strip is not lightning.

There is no ground connection to the Arduino from the rest of the circuit.

Get each individual part of the project working separately, then put the project together.

Connecting a 5V supply to the barrel jack of the Uno (as the diagram suggests), won't work.

It's my mistake. I corrected the diagram.

I attach a picture of the physical circuit.

I have two power sources, one of 5 V and another of 12 V (see diagram).

What troubleshooting steps have you performed?

Breadboards are for low-power logic circuitry (up to 100 mA), and are not suitable for high current lighting or motors (pumps). The tracks tend to burn, leading to faulty connections.

Also, the horizontal power tracks at bottom are often not connected across the middle.

Use your multimeter to check continuity of all wiring.

If I measure the voltage at the LED and at the pump it gives me 0.1 V and 0.4V.
I disconnect the plus from the engine and led and power the arduino board with 5 volts and also 5 volts instead of 12 V the LED and the engine and collect the signal from the two drains I get the following graph using a logical analyzer.

A logic analyzer is not a useful tool for this debugging.

If I measure the voltage at the LED and at the pump it gives me 0.1 V and 0.4V.

"at the pump" ... which terminals? Where are the two probes connected?

Unless you provide a clear, complete wiring diagram of the entire circuit (no shortcuts or omissions), this thread is likely to drag on for several days or just die.

The photo is helpful, thanks, but doesn't permit signal tracing...

I’m sorry I made you so angry. The probes are connecting the plus and minus of the pump and the plus and minus of the LED respectively. I wil try do do my best.

Thank you jremington.
I modified the code:

int dutyCyclePIN3 = 20; 
int dutyCyclePIN10 = 245; 

The LED lights up, the pump buzzes, and smoke comes out of the plastic of a wire. I'm learning on my own skin.
But now the analysis of the signal looks like this:

... is moot.

I am not angry at all. I just wanted to make sure you read it. Apparently not, since you still haven't provided any diagram.

Not a good sign! Redo all the associated wiring, NOT using a breadboard for motors and high current LEDs.

The diode across the motor is backward, it's a short circuit.
Shows the worth of Fritzing pictures.
Tried to check diode polarity on the picture but it's cleverly obscured by two wires running above it.
Shows the worth of pictures.

The diode is put in the following way.

Is it wrong?

What's that "traffic jam" of wires in the proto board, connecting the cathode of the diode? The second diagram is, frankly, a joke. Can you see that it conveys absolutely no information at all? If you showed the diode upside down, it would mean the same. All it shows really is that the diode is connected to the motor. Since the other connections are left out, it's completely meaningless.

Also, after repeated requests, you still have NOT provided a circuit diagram!!!!