Laundry soap dispenser

In making the above project I was going to use 3 buttons for small med large loads then just push the button to start the sketch. I would like to use a 3 position dial instead and somehow activate the sketch. I was thinking about two relays on each of the solenoid coils for the water but then it would add soap again in the rinse. Anyone have any ideas.

yes.

write out step by step what you want.
create a simple flow chart.

select some things I suggest you look at peristaltic pumps as they are common for this application.

order a small one, some buttons, your dial switch and an UNO
this seems like a good beginners project.

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

my washer uses an encoder
dirty, not too dirty, lightly soiled
it has gentle, middle, harsh
it has warm wash, cold wash, mild wash
and warm rinse, cold rinse, mild rinse.

you might want to add fabric softener as an option, an another peristaltic pump

this is inserting. encoder and push the button for the switch.

encoder menu

OK you might have missed what Im asking. I have all the hardware. I just want to be able to turn on the washer and have the pump turn on.
Not sure but Im presuming the encoder is for different amounts of soap. Im going to use a 3 position switch for that.
Just need an idea or two to start the pump for eg the relays on the solenoid coil so when the water in the washer starts it will run the sketch.

Are you asking about how to detect if the washing cycle has started and water is flowing so that you know to add soap, or are you asking about how to add soap only once when you detect that start condition, whatever it is?

please clarify what you want. every individual step would be one line, or multiple lines of code

detect if switch is ON
turn on the motor relay for the washer
turn on the relay for the pump

if this is what you are after, the pump will run and the washer will run for as long as you leave the switch on.

so, yeah, I am pretty sure I missed what you are asking.

Read up on STATE MACHINE’.
This will help organise your sequencing of events / steps.

Most washers have a LID switch, use that to set a state machine variable.

When you detect the solenoid is energized, check to see if the LID switch variable is also true and if so, set LID switch to false and run your pump routine.

Even more tricky would be to reset your LID switch variable back to false if the solenoid does not turn on after a time out period of say 20-30 seconds. That way you can inspect your wash mid cycle without triggering more soap to dispense during rinse.

Patty0465:
In making the above project I was going to use 3 buttons for small med large loads then just push the button to start the sketch. I would like to use a 3 position dial instead and somehow activate the sketch. I was thinking about two relays on each of the solenoid coils for the water but then it would add soap again in the rinse. Anyone have any ideas.

You might use an opto-isolator to read the water relay (not 1 for hot, 1 for cold?) and more of the washer itself.

Keep track of what is going on and for how long with variables, record state changes and use those to know when and when not to add soap. The water relay is just one thing to sense, how about the drain and motor? Water level?

Patty0465:
OK you might have missed what Im asking.

Me too - probably for lack of a clear question.

I have all the hardware.

And that hardware is?

And which exact pieces of hardware have to do what exactly?

What kind of current/voltage is in play?

Cattledog
yes Im asking how to add soap only once when the wash cycle starts and not again on the rinse
wvmarle
I have an arduino mega and the pump and some relays

There is some confusion from some what I want answered (sorry)

I have a sketch that will write pin 8 high (for a few seconds when pin 7 is high) this is connected to a relay that will start the pump
I have a 120v relay NO contacts connected to pin 7 and 5V from arduino,
The question is how do I turn on the relay (120v) for the wash cycle only
It was suggested to time the cycle but there are 3 different cycles my wife can pick from each a different length of time. Also suggested is to monitor the water level well there are 2 different size of loads to pick from. I think there are too many variables

I think the only way is to just push a button when I want soap
I can see any other way

Its too bad I cant monitor the amps or wattage then I could use that as a variable to re set or re start timer for another load when the wattage drops to 0.

Patty0465:
I have a 120v relay NO contacts connected to pin 7 and 5V from arduino,
The question is how do I turn on the relay (120v) for the wash cycle only

If this means your relay is connected directly to pin7 then, STOP. The processor chip is not an output controller, it only provides logic level signals to devices designed to handle larger currents/voltages, like optocouplers, MOSFETs, and BJTs. Directly driving a few LEDs is one exception.

For driving inductive loads (motors, solenoids, relays) use this diagram as a guide.

You can get relay modules that switch on signal current. They usually have an opto-isolator on board and power the relay using external power (power not from/through the controller, the module needs power and ground).

They don't need added protection diodes, those are built-in to the module. They switch as easily as a led --- but --- you have to make sure to not switch them very often in a short time or they can burn up.

Patty0465:
It was suggested to time the cycle but there are 3 different cycles my wife can pick from each a different length of time. Also suggested is to monitor the water level well there are 2 different size of loads to pick from. I think there are too many variables

So what signals CAN you monitor? And how exactly do they relate to when you want to run this pump?

This sounds like a logic problem to me.

Thanks for the concerns about the relay yes I know about the relays I have a relay specifically for Arduino
The only thing I can monitor is the solenoid for hot and cold water and the water level. I could meter the wires on the washer dial the one you select the loads with. See what ones are live on the wash cycle. If I can find the correct wires then I could use that to supply relays. I guess I should see if I can find a wiring diagram for my model

The only thing I can monitor is the solenoid for hot and cold water and the water level.

Do you want that when either of those solenoids turns on for the first time in a cycle then soap should be dispensed?

How you get the Arduino ready for the next cycle is the question, but if you have access to the boards reset button, can implement a reset button located with the selector switches, or can cycle the power, you can have the Arduino waiting for the water solenoids and then perform a one time soap dispense.

Patty0465:
I guess I should see if I can find a wiring diagram for my model

They used paste a diagram on the inside of the front panel on top-loaders. If the water level is by a pneumatic tube fed to a pressure switch you may be able to tap into that with your own sensor.

REMEMBER, most washers are switching and sensing with mains voltages.
Keep your wiring & fingers safe.
People other than yourself will use the machine - they will have no idea what you have installed. It must be foolproof.

Patty0465:
I could meter the wires on the washer dial the one you select the loads with. See what ones are live on the wash cycle.

Does the dial turn as the washer runs? In the 70's we had electro-mechanical controls on washing appliances, they turned by clock movement and different spots would make or break contact -- it's a very solid system but used more parts than something chip-based would.

But if the dial turns, you can find ways to sense that yourself. Cut notches or holes or find something to watch underneath.

Thanks for the input. Thats a good Idea. Ill tinker around with that and see
Thanks

So everything in this post you wrote in the first person, but then you slipped and wrote-

Patty0465:
but there are 3 different cycles my wife can pick from each a different length of time.

So “your” project is to keep your wife from having to pour the soap in the washer or your trying to prevent your wife from buying a new washer that adds soap automatically?

I have envisioned doing a similar project because everyone else in my family thinks they need to pour a whole cap full of soap into the washer to “ get it clean” wasting what I estimate to be about $10 month in soap.