Controlling DC motor with weight and set values.

Hello.
I need help with the solution of my product.
Unfortunately I'm still a beginner and I don't know anymore. I wanted to create a weighing system with dosing. The principle is that I enter a value of 250 on the keyboard and the peristalist pump starts to feed the material.
When the value is reached, the pump stops and the second pump starts to dispense.
This will dispense a material that has also been entered for example 100. So the weight will know that it has to stop at 300.

I don't know how to write the condition. When the value reaches 200 stop and start the second pump that stops 100 + the first value.

I use arduino uno, the weight sensor is hx711, the L9110S provides motor control.

I attach the written code for me - #include <LiquidCrystal_I2C.h>#include <Wire.h>#include <Keypad.h>#include - Pastebin.com

Unfortunately I got stuck and I don't know how to continue ... Thank you very much for your help.

And sorry for my english..

#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include <Keypad.h>
#include <HX711_ADC.h>
// ---------------------------------------------------------------------------------------------------------
HX711_ADC LoadCell(10, 11); // inicializace vahy
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // inicializace display 

const byte numRows = 4;
const byte numCols = 4;
char keymap[numRows][numCols]=
{
{'1', '2', '3', 'A'}, 
{'4', '5', '6', 'B'},  
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
byte rowPins[numRows] = {9,8,7,6}; //Rows 0 to 3
byte colPins[numCols]= {5,4,3,10}; //Columns 0 to 3
Keypad keypad = Keypad( makeKeymap(keymap), rowPins, colPins, numRows, numCols ); // inicializace keypad  
// ---------------------------------------------------------------------------------------------------------


void setup() {
  LoadCell.begin(); // spusťte připojení k HX711
  LoadCell.start(2000); // Váha dostane 2000ms na stabilizování
  LoadCell.setCalFactor(1074.0); // kalibrační faktor pro snímač zatížení
  lcd.begin(16, 2); // Připojení k LCD modulu
  lcd.backlight(); // Připojení k LCD modulu
}


void loop() {
  LoadCell.update(); // načte data ze snímače vahy
  float senzor_vaha = LoadCell.getData(); // získat výstupní hodnotu
  lcd.setCursor(0, 0); // nastavte kurzor na první řádek
  lcd.print("Vaha[g]:"); // Přenese údaj na LCD
  lcd.print(senzor_vaha); // Přenese načtenou hodnotu vedle textu 
}

If you post your code as described in the how to use this forum sticky more members will be able to see your code and help you.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html . Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom... :slight_smile:

groundFungus:
If you post your code as described in the how to use this forum sticky more members will be able to see your code and help you.

Hi. Excuse me. I've fixed it :slight_smile: