Peristaltic pumps controlled by 4 channels relay via ESP01

Hi,

I have started to build a doser pump for my aquarium. I followed a tutorial to achieve this and everything is working so far.

But I have two questions for which I do not find any answer. The parts for this project are :

  • 4 channel relay board with ESP01 mounted
  • a Kamoer KFS peristaltic pump for the moment, here a the way they are connected :

image

  1. Is it possible to reduce the speed of the peristaltic pump via ESPhome? Or Home Assistant? Or do I need to add some hardware to the project?
    Because when I only have to distribute 1ml the pump is announced to run only for 0.71 second, so I think it is better for the pump to run slower.

  2. I’d like to have the possibility to run that peristaltic pump in reverse, how could I achieve that?
    Do I need another par of hardware or what code do I need please? It’s for another project but with the same kind of hardware.

Here is the yaml code for the ESP module :

esphome:
  name: 4ch-reef-pompes-doseuse

esp8266:
  board: esp01_1m

# Enable Home Assistant API
api:
  encryption:
    key: ""

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  power_save_mode: none

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: ""
    password: ""

# Example configuration entry
web_server:
  port: 80

ota:
    platform: esphome
    password: ""

captive_portal:

logger:
  baud_rate: 0 #need this to free up UART pins

uart:
  baud_rate: 115200 # speed to STC15L101EW
  tx_pin: GPIO1
  rx_pin: GPIO3

switch:
  - platform: template
    name: 'ReefDoser Kh'
    id: PomdosKh
    turn_on_action:
      - uart.write: [0xA0, 0x02, 0x01, 0xA3]
    turn_off_action:
      - uart.write: [0xA0, 0x02, 0x00, 0xA2]
    optimistic: true
  - platform: template
    name: 'ReefDoser Ca'
    id: PomdosCa
    turn_on_action:
      - uart.write: [0xA0, 0x01, 0x01, 0xA2]
    turn_off_action:
      - uart.write: [0xA0, 0x01, 0x00, 0xA1]
    optimistic: true
  - platform: template
    name: 'ReefDoser Mg'
    id: PomdosMg
    turn_on_action:
      - uart.write: [0xA0, 0x03, 0x01, 0xA4]
    turn_off_action:
      - uart.write: [0xA0, 0x03, 0x00, 0xA3]
    optimistic: true
  - platform: template
    name: 'ReefDoser Min'
    id: PomdosMin
    turn_on_action:
      - uart.write: [0xA0, 0x04, 0x01, 0xA5]
    turn_off_action:
      - uart.write: [0xA0, 0x04, 0x00, 0xA4]
    optimistic: true
  - platform: restart
    name: "RS4switch_a Restart"

To resolve both questions, you need motor driver module.

Hi, so am I correct in understanding that all four relays on the board are controlled by a single STC15L101EW MCU? And you can only control the relays by writing serial to the MCU? What board is that and where did you get it?

I used this board below:

Each relay is directly controlled through the IO pins, so it’s more “direct” than that MCU design.

Maybe the MCU allows for a type of precise timing, but generally esp32’s aren’t great for vert precise timing as they do not run an RTOS (time based operating system) so you can’t schedule or control very precisely the timing of relay openings.

Many thanks! I will give it a look, I just have found another solution for the polarity of the pump, but if that piece grant me the possibility to achieve both of my goal it’s great!

I don’t know your pump specs, but TB6612 and DRV8833 are cheap and good options if your specs match.

I’m a beginner so I will not be able to explain correctly how it works, but from what I understood it use the ESP01 module as an interface to control each relay independently.

I got the board on aliexpress.

I just want the pump to go slower because for 1mL it only run for 0.71sec, and I’m afraid that it’s not really good for the pump in a long term use.

I found the ADS1115 while browsing, it that the same kind of device?

It has nothing to do with driving motors. It’s converting analog signals to digital.
Why you think it could serve your purposes?

I didn’t know that component so that is why I asked. :sweat_smile:
I just start learnng electronics. The only things I did in Home Assitant was pretty basic.

aliexpress.com/item/10000326147777.html

1 Like

From what I read the DRV8833 will not be able to work with my current parts right?

The 4 channel relay board I have doesn’t have GPIO as the ESP01 is directly mounted on it.
And I see the DRV8833 has to be powered in 5V, and my board is powered with 12V.

So to get my project working, I will need to change the parts to get a 4 channel relay board controlled by an ESP32 on which my DRV8833 board will be connected to, right?

I use this board for my aquarium, but it is only for 2 motors
https://vi.aliexpress.com/item/1005005958341077.html

To control 4 pumps you need 2 drivers and one Esp32 board. No relays needed.
But you need to verify your pump specs before you move on.

Thank you, I have found this, in the same range of product as yours.

Your product is interesting, but I will need 2 ESP8266/ESP32 per board.

Many thanks! As I thought I need to change my parts. As I told pepe59, I found the driver L9110S 4 channels which seems to suit my pumps well. I’ve got a Kamoer KFS 12V, so with that kind of board only one driver is enough with my type of pump right?

I found this video that runs a single pump with that type of 2 channel board, but the pump has 4 wires, mine got only two terminals.