Running Water Pumps and Led Strips

I am working on a project for school where I will be making a stroboscopic water installation.
Similar to this project here: https://youtu.be/LqMFiVkvxQw

My plan is to use
-4 water pumps that use 3 - 5V ([Pump amazon link]--(Amazon.com : ALAMSCN 4PCS DC 3V 5V Micro Submersible Mini Water Pump for Aquariums Fish Tank Pond Fountain Hydroponics Garden with 2M Flexible Tube Water Pipe : Patio, Lawn & Garden))
-and about 4 feet if WS2812b LED strips
-I am planning, on using an arduino UNO but also have an arduino MEGA if that would be better

My current plan (which is admittedly probably not ideal) is to use a 5v 15a power cord to power both the LEDs and the pumps in parallel.
I would chain the pumps together in series with a relay to control the flow of water.

I have experience wiring the LED strips but havent worked with the pumps, or motors in a while and have a feeling I am overssimplifiying, is there anything I am overlooking, or just doing downright wrong?

Until you post all the code in code tags, and any error logs or relevant serial output also in code tags plus a wiring diagram, photo of a hand drawn is fine. We can't tell.

1 Like

Is this some sort of automated response? He hasn't even chosen and Arduino yet. How is he going to have any code?

@Lynk101 , You will need to provide a proposed schematic.

That doesn't sound like a great idea. Given the low current draw of these pumps, you could possibly use a single relay but wiring them in series is not something I would do.

Also, if you have experience wiring and programming LED strips (especially RGB strips) then getting a pump to turn ON and OFF will be relatively simple... much simpler than a stepper or servo.

You agreed to a user agreement ten years ago, so you know this is standard practice; To provide code and drawing, but most users fail to remember their agreement, even users with a decade of tenure. Therefore, a friendly reminder, is in order. Without information, no help can be given. You know that. Why the row?

Wait... What is the difference between asking for non-existing software and asking for non-existing hardware? Two legs bad, four legs good, except some two legs can do four leg things.

I agree on this, it will make it clear what @Lynk101 is planning to do.

The question is about hardware connections, I do not see how code is relevant at this stage.

1 Like

If you do that it would take 12 to 20 volts for 4 pumps. Are you sure you know the difference between series and parallel?

..powered in parallell.. In serie with a relay... Sounds okey I will say.

Possibly... Maybe @Lynk101 is Swedish. :grin:

1 Like

Potential problem.

WS2812 strips may not switch fast enough to use as a stroboscope.

Assuming 30 LEDs per metre, your 4ft strip will contain around 36 LEDs.

The data rate for these strips is 800KHz, 24 bits per led, so in theory you can update a strip of 36 LEDs at a rate of 800,000/24/36 = 925Hz. It takes 2 updates to make one flash (on then off) so the flash rate will be 463Hz.

In practice, there are overheads to updating the strip which will reduce that theoretical update rate, maybe significantly.

I recommend you do some testing to measure the actual flash rate you can achieve and test if that will be fast enough for your installation.

You will need to use full brightness on the strip at all times, otherwise you will get interference strobing from the strip's PWM frequency, which is around 400Hz and cannot be adjusted. So you can mix the standard 7 colours (red, green, blue, yellow, cyan, magenta, white) but not colours in-between. You cannot have a rainbow fade effect, for example.

Stroboscope pulses must be very short for stop action on a fast moving target ( < 1ms ?), for human eyes to see such a short flash, it must be very bright, an ordinary LED probably won't work. A 2 or 3 watt white COB might.
For example, the light from a xenon strobe would blind you if it were not only a few microseconds long.

@xfpd , I'm aware of forum rules and etiquette. I felt my response to the OP was more productive and more to the point. My response to sonofcy was not. I'm sorry.

@sonofcy , You appear to be an experienced and respected member here. My quip was uncalled for. Please except my apologies.

1 Like

No need, I was a little premature. The message I was trying to send is he needs to do more research to the point that he has a rough schematic and rough code at least. He has an example and links to pumps so I didn't think it was that much of a stretch to have code and schematics very soon.

Maybe, but the sooner we see his code the sooner we all will have a better idea how/if everything will work.

Sometimes, lines are forgotten and code answers why unintended things are happening.

Here's a simple LED pulser to try, notice when pulse is less than about 2 milliseconds (2000 microseconds), it appears dimmer, even though it's not. It's your slow brain response. :grin:

// LED pulser
/* Written for UNO / Nano (AtMega 328P MCU).
 * Connect an LED with 150 to 220Ω series resistor from pin 8 
 * to GND.
 * Type in serial monitor entry line:
 * Lower case "i" for pulse interval, 
 * lower case "p" for pulse length.
 * Example to set interval to 1 second: i1000000 (1 million micros).
 *   to set pulse length to 10 ms: p10000 (ten thousand micros),
 *   or both: i1000000,p10000,
 * and click the SEND button or press [ENTER].  
 */

unsigned long timerStart,
         interval = 500000, // interval between blinks, uS
         pulseLen = 10000;  // length of pulse, 10 mS
byte led = 8; // pin 8 (PORTB.0)

void setup()
{
  Serial.begin(115200); // set serial monitor to match
                        // set serial monitor line ending to "Newline"
  pinMode(led, OUTPUT); //make led pin OUTPUT
  Serial.print("interval = ");
  Serial.println(interval);
  Serial.print("pulse length = ");
  Serial.println(pulseLen);
}

void loop()
{
  if (Serial.available() > 0)
  {
    if (Serial.peek() == 'i') // lower case 'i" for interval
    {
      interval = Serial.parseInt();
      Serial.print("interval = ");
      Serial.println(interval);
    }
    else if (Serial.peek() == 'p') // lower case 'p' for pulse length
    {
      pulseLen = Serial.parseInt();
      Serial.print("pulse length = ");
      Serial.println(pulseLen);
    }
    else if (Serial.read() == '\n')
      while (Serial.available() > 0)
      {
        Serial.read();  // clear serial buffer
      }
  }
  if (micros() - timerStart >= interval)
    timerStart += interval; // restart timer
  bitWrite(PORTB, led - 8, micros() - timerStart < pulseLen);
}

We used to use xenon bulbs for our industrial vision inspection systems. Back when white LEDs were first introduced, one of our engineers designed an LED strobe. In reviewing the specs, he learned you could actually pulse the LEDs at a much higher current given a shorter duration, and still maintain it's life expectancy.

If this is something the OP is interested in, I'll dig up the info. Although the LED strips have more to consider.

1 Like

Just remember the AtMega328P's outputs are rated at 40mA absolute max. Higher current would require a transistor switch.

I have IR remote circuits running for years pulsing 100mA LED at 1000mA. Short pulses, low duty cycle...
Good luck with WS2812B though...

Find your local kitchen sink. Adjust faucet for an good drip. Pulse a standard LED.

sketch.ino for wokwi.com
// blinkprtpw

byte ledPin = 2;
byte potPin = 14;
bool state = 0;
unsigned long timerL, timeoutL = 100, timeoutLold, timerH, timeoutH, timeoutHold;

void setup() {
  Serial.begin(115200);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  timeoutH = map(analogRead(A0), 0, 1023, 50, 250); // PRF 50ms to 250ms
  timeoutL = map(analogRead(A1), 0, 1023, 50, 250); // PW 50ms to 250ms

  if ((!state) && (millis() - timerL > timeoutH)) { // compare LOW timer for HIGH timeout
    timerH = millis(); // reset HIGH timer
    digitalWrite(ledPin, HIGH);
    state = 1; // indicate pulse HIGH state
  }

  if ((state) && (millis() - timerH > timeoutL)) { // compare HIGH timer for LOW timeout
    timerL = millis(); // reset LOW timer
    digitalWrite(ledPin, LOW);
    state = 0; // indicate pulse LOW state
  }

  showPRTPW();
}

void showPRTPW() {
  if ((timeoutHold != timeoutH) || (timeoutLold != timeoutL)) {
    timeoutHold = timeoutH;
    timeoutLold = timeoutL;
    Serial.print(timeoutH);
    Serial.print(" ");
    Serial.print(timeoutL);
    Serial.println();
  }
}
sketch.ino for wokwi.com
{
  "version": 1,
  "author": "Anonymous maker",
  "editor": "wokwi",
  "parts": [
    { "type": "wokwi-arduino-nano", "id": "nano", "top": -4.8, "left": -0.5, "attrs": {} },
    {
      "type": "wokwi-led",
      "id": "led1",
      "top": -51.6,
      "left": 100.2,
      "attrs": { "color": "white", "flip": "1" }
    },
    { "type": "wokwi-potentiometer", "id": "pot1", "top": -10.9, "left": 172.6, "attrs": {} },
    { "type": "wokwi-potentiometer", "id": "pot2", "top": -10.9, "left": 249.4, "attrs": {} },
    {
      "type": "wokwi-text",
      "id": "legendservo1",
      "top": -38.4,
      "left": 201.6,
      "attrs": { "text": "PRT" }
    },
    {
      "type": "wokwi-text",
      "id": "legendservo2",
      "top": -38.4,
      "left": 268.8,
      "attrs": { "text": "PW" }
    }
  ],
  "connections": [
    [ "nano:GND.2", "led1:C", "black", [ "v0" ] ],
    [ "nano:2", "led1:A", "green", [ "v0" ] ],
    [ "pot1:GND", "nano:GND.1", "black", [ "v9.6", "h-57.6" ] ],
    [ "pot1:SIG", "nano:A0", "green", [ "v19.2", "h-96.4" ] ],
    [ "pot1:VCC", "nano:5V", "red", [ "v28.8", "h-39.2" ] ],
    [ "pot2:GND", "pot1:GND", "black", [ "v9.6", "h-76.8" ] ],
    [ "pot2:VCC", "pot1:VCC", "red", [ "v28.8", "h-77.6" ] ],
    [ "pot2:SIG", "nano:A1", "green", [ "v19.2", "h-202" ] ]
  ],
  "dependencies": {}
}