Arduino Forum

Topics => Home Automation and Networked Objects => Topic started by: alex3241 on Jan 30, 2018, 06:21 pm

Title: washing machine Arduino program
Post by: alex3241 on Jan 30, 2018, 06:21 pm
Hi to all. I'm building a code, washing machine program with Arduino Uno r3. I do not know programming, but I'm a device technician, and a technician of automation, for 20 years I have a great deal of repair and construction.
this particular project I've been thinking a long time ago, I want to write a code that has all the necessary choices so we can put another Arduino brain in any washing machine.
all I do for non-profit. I have compiled a code in which continuous to convert with these few that I know. for now, I am not facing too much a problem so that I can not finish this task.
I would like a group who wants, to help for the correct compilation and modification of the existing not integrated code.
Your opinion is valuable to me for anything you answer to me. Forgive me, I know little English with Google  translation , and I also have no forum experience, and I have to present this work. do I have to present the code to github?   . Thank you very much .
Title: Re: washing machine Arduino program
Post by: wildbill on Jan 30, 2018, 06:27 pm
No need for GitHub. Either post it inline between code tags or attach it as a file (option presented when you reply).
Title: Re: washing machine Arduino program
Post by: alex3241 on Jan 30, 2018, 06:44 pm
The explanation of the code is not correct, I slowly rectification
Title: Re: washing machine Arduino program
Post by: mattlogue on Jan 31, 2018, 08:52 am
I'd like mine to notify me when it's done. Just hook a vibration sensor to the back of machine then run that from 5v and pin 1. When the thing reads several pulses of 5v per n time duration, say a minute, from a state where no pulses counted, the state of machine is ON. After that, once pulses cease, it is OFF, then it sends thru SDA upstairs.

That is very simple to do. However, to re-create the brain of a washer machine there are a lot of variables. First off, where the washer has a timer/switch, you need a bunch of relays, and possibly transistors to drive those relays. Timers are not well implemented in Ardiunos IMO, but you can create a number of vars in ref to millis(). Then you could add sensors, extra thermocouples, dont forget the op-amp. pH sensing is possible but not cheap. Likewise ozone.
Title: Re: washing machine Arduino program
Post by: alex3241 on Jan 31, 2018, 01:45 pm
Thanks for the information, but downloaded the code to see what it contains. If you notice I have included DS18B20 Digital Thermometer And many more. and if you can write an example of a code from what you write to me. because only so I can understand, because I said, I know little programming.
Title: Re: washing machine Arduino program
Post by: alex3241 on Feb 01, 2018, 05:06 pm
This works normally but can anyone tell me if this is right? And if not how else we can write?

Code: [Select]

for   (sensors.getTempCByIndex(0);  settemp > sensors.getTempCByIndex(0); )    // if the temperature exceeds your chosen settemp
    {
        digitalWrite (warmWater, 1); // turn on the heating

    digitalWrite (MotorCCW, 1);     // turn on the motor
      delay(timer);
    digitalWrite (MotorCCW, 0);     // turn off the motor
      delay(timer);
    digitalWrite (MotorCW, 1);        // turn on the motor
      delay(timer);
    digitalWrite (MotorCW, 0);        // turn off the motor
      delay(timer);
 
         sensors.requestTemperatures();            // Send the command to get temperature readings
         delay(250);
         lcd.setCursor (0,1);                            // set cursor to 0,0
         lcd.print("# Water Heating.#");
         lcd.setCursor (0,2);
         lcd.print(" Tag Temp is:");
         lcd.print(sensors.getTempCByIndex(0));
         lcd.print ("C ");
         lcd.setCursor (0,3);              // set the cursor to 0,1
         lcd.print ("  Set To: ");            // Print set to and your ideal temperature in f
         lcd.print (settemp);
         lcd.print ('C');
         
    digitalWrite (MotorCCW, 1);     // turn on the motor
      delay(timer);
    digitalWrite (MotorCCW, 0);     // turn off the motor
      delay(timer);
    digitalWrite (MotorCW, 1);        // turn on the motor
      delay(timer);
    digitalWrite (MotorCW, 0);        // turn off the motor
      delay(timer);
               
   }
Title: Re: washing machine Arduino program
Post by: wildbill on Feb 01, 2018, 05:23 pm
It seems odd that every delay you use has the same amount of milliseconds selected. I'd expect it to vary according to what the machine is doing.
Title: Re: washing machine Arduino program
Post by: alex3241 on Feb 01, 2018, 11:55 pm
In this last I posted is the process of water heating. and what it does is to rotate the bucket motor right and left. and you are managing the same waiting time. elsewhere in the code, it cross more time again with the delay, with double and triple etc.
Title: Re: washing machine Arduino program
Post by: alex3241 on Feb 02, 2018, 07:26 pm
I use the Real time clock (RTC) DS1307 can someone tell me how there is to use the minutes instead of the delay. to use real time in the program flow?
Title: Re: washing machine Arduino program
Post by: alex3241 on Feb 03, 2018, 08:19 pm
I see that there is no interest, and it is disappointing things, and no cooperation. so I will not share my job. I have a great deal to show you plans for a fully brain washable. and a channel with my own integrated systems. sharing and working together is the best thing, but here I do not see it :(  :(
Title: Re: washing machine Arduino program
Post by: alex3241 on Feb 05, 2018, 10:09 pm
The plan gets flesh and bone. the electrical installation I make as simple and fast as possible, I do not want to spend much time on it. the whole project base to construct a machine brain which will adjust to all washing machines. They will replace the relay with triak, and will be on a single board with motor controller for all kinds of motors outside the inverter
You can see in the photos, but do not hurry all this will fit well and will be all over
Title: Re: washing machine Arduino program
Post by: alex3241 on Feb 05, 2018, 10:34 pm
photos
Title: Re: washing machine Arduino program
Post by: gutbag on Feb 08, 2018, 02:14 pm
To be honest, you've taken on a fairly major task with, by your own admission, little programming experience. I would recommend getting more familiar with the basics before attempting something as ambitious as this. For example, study the 'blink without delay' sketch - without understanding this, you stand no chance of handling multple simultaneous operations with different timing requirements (water heating, drum rotating...). It will also eliminate the need for an RTC (at least, for timing). Perhaps building a small shield with LEDs representing the relay outputs and switches for the inputs would be a good platform for learning what you need to know.

Also, from my own experience, learning how to put some of the implementation into separate classes (C++) will be essential to prevent the main sketch from becoming an unmaintainable tangle.

Title: Re: washing machine Arduino program
Post by: alex3241 on Feb 17, 2018, 07:16 pm
To be honest, you've taken on a fairly major task with, by your own admission, little programming experience. I would recommend getting more familiar with the basics before attempting something as ambitious as this. For example, study the 'blink without delay' sketch - without understanding this, you stand no chance of handling multple simultaneous operations with different timing requirements (water heating, drum rotating...). It will also eliminate the need for an RTC (at least, for timing). Perhaps building a small shield with LEDs representing the relay outputs and switches for the inputs would be a good platform for learning what you need to know.


Thank you for your response. All these days I'm working with the code. who has proven not to handle a fast data processing, not need, For example 'blink without delay'.
Be aware that a washing machine is not only waiting for an electronic brain, but it is very important to combine with a proper electrical installation that performs various supervision during washing. For example, to mention, an engineer interrupts water control and supervision.
the code I have attached is 40% complete. what I've developed is 99% complete and who only manages delay (). I have developed a smart code for a proper wash. The ultimate goal has not been achieved. what I have done now is only for a particular type of washing machines.
And it contains 5 basic and 3 utility programs, depending on what clothes we wash. I have created a hidden menu for functional diagnostic problems. I do not use the RTC, except to get a date and time. Whichever procedure is followed during the wash cycle, you will record on the LCD screen.
Title: Re: washing machine Arduino program
Post by: alex3241 on Feb 17, 2018, 07:33 pm
Also, from my own experience, learning how to put some of the implementation into separate classes (C++) will be essential to prevent the main sketch from becoming an unmaintainable tangle.


Please explain me more about what you are writing here
Title: Re: washing machine Arduino program
Post by: alex3241 on Feb 17, 2018, 09:01 pm
completed photos
Title: Re: washing machine Arduino program
Post by: alex3241 on Feb 22, 2018, 10:56 pm
completed video
https://www.youtube.com/watch?v=EY4H1gmnmD4 (https://www.youtube.com/watch?v=EY4H1gmnmD4)
Title: Re: washing machine Arduino program
Post by: chaley63 on Feb 25, 2018, 08:29 am
Use the millis if you want no program delays.
Title: Re: washing machine Arduino program
Post by: gutbag on Feb 26, 2018, 02:08 pm
Please explain me more about what you are writing here
I just mean that it would be worthwhile learning about object-oriented design/programming in general, and how it can be implemented in C++ (the language used to program Arduinos). It's a very big subject but very useful as programs grow, to avoid them becoming overly complex and hard to maintain.
Title: Re: washing machine Arduino program
Post by: hotpointer on Nov 03, 2018, 08:49 pm
Finished my arduino washing machine project
https://youtu.be/vxtv7HNJ168