ESP32 Dosing Pump

Home Assistant automation projects, questions, etc. go here.
FrozenSwede
LED-Curious
LED-Curious
Reactions:
Posts: 7
Joined: Sat Feb 13, 2021 11:24 pm

Working on adding my pump. But cant really understand how its added in ESP HOME. Should i use i2C or UART?

Ive added:

Code: Select all

output:
- platform: ledc
  pin: GPIO14
  frequency: 9000 Hz
  id: pwm_ph_up_pump

fan:
- platform: speed
  output: pwm_ph_up_pump
  name: " pwm_ph_up_pump "
In my yaml file, it shows up in HA and i can add it as an entity but when i try to start it nothing happens.

i have it connected to the GPIO21 (SDA) and GPIO22 (SCL) on my ESP32, but the pin says GPIO14 in the script. Ive tested changing it to 21 and 22 but the pump still wont show any kind of movement.

And about the power supply. Do i connect the 12v directly, or do i have to use relays?
morrisraybrooks
LED Enthusiast
LED Enthusiast
Reactions:
Posts: 57
Joined: Fri Dec 04, 2020 3:27 am

i changed it up a bit

this is the relevant part of the dowser code

esp32_ph_doser.yaml


#==============================================
fan:
- platform: speed
name: "PWM_ph_up_pump"
output: PWM_ph_up_pump
speed:
low: 0.30
medium: 0.45
high: 0.55
#==============================================
- platform: speed
name: "PWM_ph_down_pump"
output: PWM_ph_down_pump
speed:
low: 0.30
medium: 0.45
high: 0.55
#==============================================
- platform: speed
name: "ESP32_PH_Doser_case_fan"
output: ESP32_PH_Doser_case_fan
speed:
low: 0.25
medium: 0.50
high: 1
#==============================================
output:
- platform: ledc
pin: GPIO25
frequency: 11000 Hz
id: PWM_ph_up_pump
inverted: false
#==============================================
- platform: ledc
pin: GPIO26
frequency: 11000 Hz
id: PWM_ph_down_pump
inverted: false
#==============================================
- platform: ledc
pin: GPIO23
frequency: 25000 Hz
id: ESP32_PH_Doser_case_fan
inverted: false
#==============================================
morrisraybrooks
LED Enthusiast
LED Enthusiast
Reactions:
Posts: 57
Joined: Fri Dec 04, 2020 3:27 am

also you have to have one lead from motor connected to the same common as the chips (ground)= - and one to the (HOT)= + =pwm
FrozenSwede
LED-Curious
LED-Curious
Reactions:
Posts: 7
Joined: Sat Feb 13, 2021 11:24 pm

Okey thanks for the code.

How are you connecting the 5-pin cable to the pump on the ESP32? One of the cables arent used afaik.
One for positive and one for ground. Then the other two?

And of course the 12v needs to come from the power supply as well. Do you connect the pump directly, or thru a relay?

I have connected my first attempt like this (wich doesnt work)
https://atlas-scientific.com/files/EZO-PMP-05.jpg

INT is un-used
VCC is positive
GND is ground
RX / SCL GPIO21
TX / SDA GPIO22

So this is whats confuses me when you write other GPIO in the code. Dont know wich cable to move to have several pumps working. On another picture i see several pumps connected on the same pins with a breadboard.
hence my confusion, cant find a good "this is how you connect the pump"-thingy around yet.
FrozenSwede
LED-Curious
LED-Curious
Reactions:
Posts: 7
Joined: Sat Feb 13, 2021 11:24 pm

aargh... im hitting my head against a brick wall.. and it hurts!

I cant for the life of me, get the pump to run. Been trying all kinds of code snippets and connections. And it got 12volts hooked up and meausured.

its set to I2C (blue led is lighting up).
The log on esp says SDA pin GPIO21, and SCL pin GPIO22 so thats where ive connected my wires.
White for RX / SCL on GPIO22,
Green for TX / SDA on GPIO21.

Do i need to connect the wires on any other pins on the ESP32?

This is my esp yaml code:

Code: Select all

fan:
  - platform: speed
    name: "PWM_ph_up_pump"
    output: PWM_ph_up_pump
    speed:
      low: 0.30
      medium: 0.45
      high: 0.55    
      
output:
  - platform: ledc
    pin: GPIO21
    frequency: 11000 Hz
    id: PWM_ph_up_pump
    inverted: false    
The code validates, uploads and i can add it in HA as a entitiy and switch it on/off and change between low/med/high. but the pump itself wont react to any commands.

Really appreciate any help i can get, feeling a little bit stuck at the moment..
morrisraybrooks
LED Enthusiast
LED Enthusiast
Reactions:
Posts: 57
Joined: Fri Dec 04, 2020 3:27 am

i see there is a miss understanding what i did was to build the entire system i used too 12v peristaltic pumps from amazon with too motor drivers both pump setup cost like $28.00 plus the esp32 + enclosure + wire + some cable management stuff like wire ties and sticky backs total $50.00
and like 2 month work on and off still don't trust it though we loose internet a lot here i have cough it running all night before
had to add a safety relay to be tripped in home assistant before dosing is done I'm going to add a prizo speaker to the sequence that will sound an alarm while dosing just because it is so sneaky
FrozenSwede
LED-Curious
LED-Curious
Reactions:
Posts: 7
Joined: Sat Feb 13, 2021 11:24 pm

Could you take a pic of how you have connected the wires on the ESP32 ?

However i place my wires i cant get it to respond in any way.

Ive tested the pump in arduino and then it works, but it wont respond to any commands from HA.
morrisraybrooks
LED Enthusiast
LED Enthusiast
Reactions:
Posts: 57
Joined: Fri Dec 04, 2020 3:27 am

20210217_195959.jpg
20210217_195652.jpg

the too pumps run off PWM form (D25) and (D26) solid white and white an black
stud
LED Lover
LED Lover
Reactions:
Posts: 143
Joined: Wed Jun 03, 2020 4:19 pm
Location: Canada

im coming guys , just got my pumps today ! :mrgreen: :mrgreen: :mrgreen: :mrgreen:
morrisraybrooks
LED Enthusiast
LED Enthusiast
Reactions:
Posts: 57
Joined: Fri Dec 04, 2020 3:27 am

i have ben moving automations over to node red got my humidity and tempters working but the ph is killing me i keep getting the errors
i built the ph pump with (esp home) but its not currently installed in my new setup does it have to be?
all the other automation works but it wont run the pumps debug shows every thing working

( output from debug window )
==============================================================================
3/1/2021, 6:59:52 PMnode: cf15dfad.a9755
sensor.hydro_kit_ezo_ph : msg.payload : Object
{ sensor.hydro_kit_ezo_ph: 6.71, input_number.ph_tolerance: 0.1, input_number.ph_target: 6.22 }
3/1/2021, 6:59:54 PMnode: PH-Down-Control
msg :
{ domain: "switch", service: "turn_on", data: object }
3/1/2021, 7:00:12 PMnode: cf15dfad.a9755
sensor.hydro_kit_ezo_ph : msg.payload : Object
{ sensor.hydro_kit_ezo_ph: 6.7, input_number.ph_tolerance: 0.1, input_number.ph_target: 6.22 }
3/1/2021, 7:00:14 PMnode: PH-Down-Control
msg :
object
domain: "switch"
service: "turn_on"
data: object
entity_id: "fan.pwm_ph_down_pump"

==============================================================================

( error in home assistant log )

Logger: homeassistant.helpers.service
Source: helpers/service.py:102
First occurred: 6:37:23 PM (23 occurrences)
Last logged: 6:46:15 PM

Unable to find referenced entities fan.pwm_ph_down_pump
Unable to find referenced entities fan.pwm_ph_up_pump
Post Reply