water Softener logic/code creation for $$

Hi all,

I am new to this forum and have starting tinkering with Arduino because i was kinda forced this way

I have a Kenmore Ultra Soft water softener, it is a pretty old model but it still works great internally. I had a crazy ant problem around here were they damaged the control board on the unit and it will not function anymore but all the downstream items are perfectly fine. I bet you are saying why not just buy a new control board, here is how buisnesses work, low demand and they stop production. These boards are not for sale anywhere and repair places charge almost 100 bucks to just SEE if they can repair it.

Well i am pretty good with electronics and building "manual" electrical systems but this microprocessor area is not my cup of tea. I would like to pay someone to build me a simple code to run this softener

Here is what you have to work with, and depending on how extravagant you want to make it will depend on the final agreed apone price.

Arduino Uno Board
I have a Adafruit multiple line display that i would love to have working

Water softener specs
Geared motor to move the water valve (running or not running)
single micro switch (detects/counts number of depressions for the controller to know when the valve is in the correct location)
Hall-effect sensor that gives water flow to know when to run the clear cycle

All i want the code to do is these two things

  1. Manual button press starts the cycle NOW
    Cycle runs like this
    Button pressure, activate motor (Places in bypass and starts Fill Cycle)
    Micro switch activated, stop motor
    Wait X Mins then activate motor (Cleaning)
    Micro switch activated, stop motor
    Wait X Mins then activate motor (Purging)
    Micro switch activated, stop motor
    Wait X Mins then activate motor (Flushing)
    Micro switch activated, stop motor
    Wait X Mins then activate motor (Takes out of bypass and places back in service)
    Micro switch activated, stop motor
    Wait until manual button is pressed to start cycle over again

  2. Reads hall effect sensor and calculates total gallons
    When X number of gallons is sup past - starts the cycle
    cycle runs like this
    X number of gallons, activate motor (Places in bypass and starts Fill Cycle)
    Micro switch activated, stop motor
    Wait X Mins then activate motor (Cleaning)
    Micro switch activated, stop motor
    Wait X Mins then activate motor (Purging)
    Micro switch activated, stop motor
    Wait X Mins then activate motor (Flushing)
    Micro switch activated, stop motor
    Wait X Mins then activate motor (Takes out of bypass and places back in service)
    Micro switch activated, stop motor
    Wait until manual button is pressed to start cycle over again

It is very simple and i attempted to create the code but the hole wait then move to next step kinda was over my head.

If i can get the display to say what is happening and current gpm or total flow would be great as well

Let me know who wants to do this

It is very simple and i attempted to create the code but the hole wait then move to next step kinda was over my head.

Why? You have several possible states. Periodically it becomes time to change states.

On any given pass through loop(), you see how much water has been used and see if the manual switch was pressed. If either condition is true, you set the state to "Fill" and turn something on and record when you did that.

On any given pass through loop(), you might, or might not, be in the "Fill" state. If you are, it might, or might not, be time to move to the "Clean" state. If it is, you do what needs doing and record when you did that.

Similarly, it might be time to transition to the "Purge" state or the "Flush" state or the "Done/Idle" state. If it is, do what needs doing, and record when you did that.

If, on any given pass, you are in the "Done/Idle" state, and the amount of water used doesn't warrant changing states, and the manual switch hasn't been pressed, there is nothing to do, no matter how long you have been in this state.

Of course, it might be easier to program this using numbers for the states or an enum where the states have names that are really numbers.

Thanks for the reply, first

Coding is just difficult for my to "visualize" i am a very visual person, so coding to me is difficult to keep up with. More so with all the different transitions between code lines and all. I must admit when i first started this i wrote the steps down on paper and attempted to look up the different command/transitions i was going to need to make it work in the manual route but after a bit i knew i was getting over my head for a first attempt at coding so i stopped and backup-ed.

I made a simple led light setup to blink at a certain rate until button pressed, i did some searching and found some coding online that i figured i would be able to use for the LED code. I powered thru it but for something so simple because i couldn't "see the code in my head" i had a hard time. It is still blinking away on my desk at work right now LOL

I would rather just pay someone to assist with this, instead of spending countless hours of trial and error that might not even lead me to a proper code

Pros:
You have made a very clear statement of what you need done! I wish more people could do this as well as you have.

Cons:
It may end up cheaper to buy a new water softener.

Here's where some decisions need to be made:
If you have one "Start" button, one pressure switch (I assume that's what button pressure means), one motor output to control, and one micro switch, then you're looking a simple application that can be done easily.

Complications come in when you
a) Want to vary the number of minutes X
b) Measure flow by the Hall sensor.

(b) is not a difficult task, so the time multiplier here is small. (a) can be a simple or a huge task. Anything that involves a user interaction has the potential to become very complex!!!

Since you are a visual person, a PLC might be a good choice if you still want to DIY. Automation Direct has a cheap series of PLCs (Click starting at $69) and PLC programming is historically designed to be done by electricians who are not software experts.

Send me a PM if you want to get deeper into what it would cost, but even the simplest solution I see is already a good fraction of the cost of a new Kenmore Ultra.