-
Making it smarter
03/12/2017 at 21:00 • 0 commentsLast night I was finishing some washing and thought about ways to make this thing smarter.
Maybe adding a flow meter to the pump so when the train cycle has finished and there is no more water being pumped out the spin cycle ends.
Using something like this.
https://www.aliexpress.com/item/OKD-HZ32DN-flow-sensor/553216447.html?spm=2114.01010208.3.30.4OhXxy&ws_ab_test=searchweb0_0,searchweb201602_3_10065_10068_433_434_10136_10137_10138_10060_10062_10056_10055_10054_302_10059_10099_10103_10102_10096_10052_10053_10050_10107_10051_10106_10084_10083_10119_10080_10082_10081_10110_10111_10112_10113_10114_10078_10079_10073_10070_10122_10123_10120_10126_6000000_10124-10119,searchweb201603_3,afswitch_1_afChannel,ppcSwitch_2,single_sort_0_default&btsid=95ce6e22-2276-410e-aa3b-e31e7aa06c15&algo_expid=490d3712-fcab-49f7-b477-65a36b9380a1-3&algo_pvid=490d3712-fcab-49f7-b477-65a36b9380a1The other thought was to add an actual water level sensor. There is a tube at the base of the tub that goes upwards to the existing sensor/switch, you dial up the water level and when that level is reached the switch triggers but I was contemplating adding one of these instead.
MPX5010GP
https://www.aliexpress.com/item/MPX5010GP-MPX5010-INTEGRATED-PRESSURE-SENSOR-100-New-Original/32770095909.html?spm=2114.01010208.3.10.SzOVcb&ws_ab_test=searchweb0_0,searchweb201602_3_10065_10068_433_434_10136_10137_10138_10060_10062_10056_10055_10054_302_10059_10099_10103_10102_10096_10052_10053_10050_10107_10051_10106_10084_10083_10119_10080_10082_10081_10110_10111_10112_10113_10114_10078_10079_10073_10070_10122_10123_10120_10126_6000000_10124,searchweb201603_3,afswitch_1_afChannel,ppcSwitch_2,single_sort_0_default&btsid=4ab2fe85-22d8-4c53-8395-634a306b0075&algo_expid=73d7dae1-8ab8-4988-b25a-1a3c4d99cfe5-1&algo_pvid=73d7dae1-8ab8-4988-b25a-1a3c4d99cfe5Only other thing that would be cool is a sensor to work out just how much washing is in the machine but I cant really see any way to do this at the moment as it cant really be based on weight as clothes have different weights and an optical sensor would not really work as things like sheets when you put them in tend to sit a little higher but then compress more when they are wet.
-
Who let the smoke out
03/11/2017 at 11:30 • 0 commentsThis is the MOV that was across the relay contacts.
Looks like it got a little toasty. -
Mini Pro V Nano
03/11/2017 at 05:32 • 0 commentsStill suffering from a bit of noise or some form of instability, its similar to what I was finding using the Mini Pro to drive a stepper. Checked the PSU and that is nice and stable so when in doubt fall back to what worked to solve the stepper issue I had and that was swap out the Mini Pro for a Nano.
I suspect there is something in the Mini Pro design that makes it a little more susceptible to interference but I guess after a few more cycles we will soon see.
The only other issue it could be is that one of the salvaged caps I used for the R/C circuit has decided to start failing. When i finalise things I may add a few MOV's to the mix -
Testing Testing 123
03/10/2017 at 21:48 • 0 comments6 loads of washing and it is running as expected without any issues, I have even had the guts to leave it plugged in with the power on for 2 days now.
Now its time to pretty things up and start working on some additional features and more advanced code with a few safety features and maybe hook up the lid switch again
Given most of the routines are time based I have decided to make use of probably one of the best librarys i have found. Chrono as it has all the features required and the developers are prety quick to respond to any issues.
LOL: And as luck would have it ,after completing 6 loads of washing and hanging it out to dry it started to rain :( given the urgent need for some clothes I decided to use the dryer and to my dismay that stopped working. I can see another hack coming in the near future but for now the problem was the tensioner for the drum belt had work out at the door clip had broken. Thankfully I have a 3D printer on hand so printing up a new clip and a new tensioner was a simple process. -
More on the Snubber
03/08/2017 at 23:06 • 0 commentsSure enough the snubber seems to sort out most of the issues however the snubber for the spin cycle needed to be connected in parallel across the motor and not across the relay as the actuator seems to use an asynchronous motor and is really low current. Putting the snubber across the relay was causing the R/C circut to feed enough power to run the motor even when it was turned off.
I could adjust the values however did not have the components here to do that.
It seems that the water valve solinoids do not need snubbers in place.
Now to test the machine on a full wash cycle then back to making a more advanced version of the code with a few additional features like gentle wash and an extended spin rinse cycle as firing water in to machine while it is spinning seems to cause the clothes to rinse out a lot better than just fill, agitate and spin. -
Test Code
03/08/2017 at 09:23 • 0 commentsNow for some code, I will add the final version later as there are a pile of additional timer routines but for now I am testing the stability of the system. There seems to still be some RFI issues when the spin cycle ends and the actuator drops the brake but I also ran out of parts to make a snubber for the actuator so this fault should go away once the additional snubber is n place.
Yes i know its full of while loops but I wanted this to be as simple as possible for testing purposes.#include <Bounce2.h> // Constants for Control Pins const int LedPin = 13; // LED Pin // Washingmachine Sensor Pins const int WaterLevelPin = 2; // N/C Switch to sense the water level If it goes open then stop everyting. const int LindSwitchPin = 3; // Goes OPEN circut if the lit is opend. E-STOP const int SpinSensorPin = 12; // When the spin locking pin is in place this is short // IN# are the relay inputs for the Duinotech 8 Channel Board const int CWPin = 4; // IN1 - Clockwise Pin const int CCWPin = 5; // IN2 - Counter Clockwise / FAST SPIN Pin. const int SpinActuatorPin = 6; // IN3 - Pull the locking pin in for the spin cycle const int ColdWaterValve = 7; // IN4 - Cold Water Valve const int HotWaterValve = 8; // IN5 - Cold Water Valve const int WaterPumpPin = 9; // IN6 - Water Pump // Control Pannel Pins const int StartPin = 10; // Restart After and Error const int RestartPin = 11; // Restart After and Error // Control Variables int ledState = LOW; // ledState used to set the LED int CWState = LOW; // Clockwise Relay State int CCWState = LOW; // Counter Clockwise Relay State int SpinState = LOW; // Spint Actuator State int ColdState = LOW; // Cold Water Valve State int HotState = LOW; // Hot Water Valve State int PumpState = LOW; // Water Pump State int incomingByte = 0; int MachineCycle = 0; int WaterLevel = 0; int SpinEnabled = 0; long AgitationCounter = 0; long BallanceCounter = 0; long RinseCounter = 0; long SpinCounter = 0; long EmptyWater = 0; long SoakCounter = 0; // Instantiate a Bounce object Bounce debouncer = Bounce(); void setup() { Serial.begin(9600); // Serial Communications for Debuging pinMode(StartPin,INPUT_PULLUP); // Pin to use for the Start Button debouncer.attach(StartPin); // After setting up the button, setup the Bounce instance : debouncer.interval(40); // interval in ms // set the digital pin as output: pinMode(LedPin, OUTPUT); // Onboard LED on pin 13 pinMode(WaterLevelPin, INPUT_PULLUP); // Enable Pullup for WaterLevel Sensor pinMode(LindSwitchPin, INPUT_PULLUP); // Enable Pullup for Lid Switch pinMode(CWPin, OUTPUT); // Clockwise Motor Control pinMode(CCWPin, OUTPUT); // Counter Closkwise Motor Control pinMode(SpinActuatorPin, OUTPUT); // Spin Actuator Solinoid pinMode(ColdWaterValve, OUTPUT); // Cold Water Valve pinMode(HotWaterValve, OUTPUT); // Hot Water Valve pinMode(WaterPumpPin, OUTPUT); // Water Pump pinMode(StartPin, INPUT_PULLUP); // Start Button pinMode(RestartPin, INPUT_PULLUP); // Restart/Resume after Error pinMode(SpinSensorPin, INPUT_PULLUP); // Enable Pullup for Spin Sensor } void loop() { debouncer.update(); // Update the Bounce instance : int value = debouncer.read(); // Get the updated value : if ( value == LOW ) { Serial.println("Washing Cycle Started"); MachineCycle = 1; // If the button is pushed start the machine } // send data only when you receive data: if (Serial.available() > 0) { incomingByte = Serial.read(); // read the incoming byte: Serial.print("I received: "); // say what you got: Serial.println(incomingByte, DEC); } if(incomingByte == 48){ Serial.println("Stop Machine"); MachineCycle = 0; } // If we receive a 1 run this if(incomingByte == 49){ Serial.println("Start Machiner"); MachineCycle = 1; } if(MachineCycle == 1){ Serial.println("Filling Machine with Cold Water for Wash Cycle"); while(digitalRead(WaterLevelPin) != 1){ //Fill the machine digitalWrite(LedPin, HIGH); //Start Filing digitalWrite(ColdWaterValve, HIGH); //turn on the cold water valve } if(digitalRead(WaterLevelPin) == 1){ digitalWrite(LedPin, LOW); //Start Filing digitalWrite(ColdWaterValve, LOW); //turn on the cold water valve Serial.println("Machine filled with water"); WaterLevel = 1; } //3 minutes = 180000 Serial.println("Agitating Washing"); AgitationCounter = 0; while(AgitationCounter <= 80){ digitalWrite(CWPin, HIGH); digitalWrite(CCWPin, LOW); digitalWrite(LedPin, HIGH); // Serial.println("Agitate CW"); delay(800); digitalWrite(CWPin, LOW); digitalWrite(CCWPin, LOW); digitalWrite(LedPin, LOW); // Serial.println("PAUSE"); delay(800); digitalWrite(CWPin, LOW); digitalWrite(CCWPin, HIGH); digitalWrite(LedPin, HIGH); // Serial.println("Agitate CCW"); delay(800); digitalWrite(CWPin, LOW); digitalWrite(CCWPin, LOW); digitalWrite(LedPin, LOW); // Serial.println("PAUSE"); delay(800); AgitationCounter++; //Serial.println("Agitating Washing"); //Serial.println(AgitationCounter); } Serial.println("Soaking for 1 minute"); SoakCounter = 0; while(SoakCounter != 60){ delay(1000); SoakCounter++; } AgitationCounter = 0; Serial.println("Agitating after soak"); while(AgitationCounter <= 60){ digitalWrite(CWPin, HIGH); digitalWrite(CCWPin, LOW); digitalWrite(LedPin, HIGH); // Serial.println("Agitate CW"); delay(700); digitalWrite(CWPin, LOW); digitalWrite(CCWPin, LOW); digitalWrite(LedPin, LOW); // Serial.println("PAUSE"); delay(700); digitalWrite(CWPin, LOW); digitalWrite(CCWPin, HIGH); digitalWrite(LedPin, HIGH); // Serial.println("Agitate CCW"); delay(700); digitalWrite(CWPin, LOW); digitalWrite(CCWPin, LOW); digitalWrite(LedPin, LOW); // Serial.println("PAUSE"); delay(700); AgitationCounter++; //Serial.println("Agitating Washing"); //Serial.println(AgitationCounter); } Serial.println("Preparing to Spin"); while(digitalRead(SpinSensorPin) != 0){ digitalWrite(SpinActuatorPin, HIGH); // Serial.println(digitalRead(SpinSensorPin)); } //This will deal with the weird bounce issue from the actuator while(digitalRead(SpinSensorPin) != 0){ delay(1000); } if(digitalRead(SpinSensorPin) == 0){ SpinEnabled = 1; digitalWrite(LedPin, HIGH); // Serial.println("Spin Enabled"); } Serial.println("Ballance Load"); BallanceCounter = 0; while(BallanceCounter <= 10){ delay(1000); digitalWrite(CWPin, HIGH); digitalWrite(LedPin, HIGH); delay(1500); digitalWrite(CWPin, LOW); digitalWrite(LedPin, LOW); BallanceCounter++; } // Start emptying the water Serial.println("Ballance Load and Drain"); EmptyWater = 0; while(EmptyWater != 70){ digitalWrite(WaterPumpPin, HIGH); delay(1000); digitalWrite(CWPin, HIGH); digitalWrite(LedPin, HIGH); delay(1000); digitalWrite(CWPin, LOW); digitalWrite(LedPin, LOW); EmptyWater++; } // Start a Full Speed Spin Cycle Serial.println("Spin and Drain"); SpinCounter = 0; while(SpinCounter != 70){ digitalWrite(CWPin, HIGH); digitalWrite(LedPin, HIGH); delay(1000); SpinCounter++; } // Start Spin Rinse Serial.println("Spin and Rinse"); RinseCounter = 0; while(RinseCounter != 40){ digitalWrite(ColdWaterValve, HIGH); delay(1000); digitalWrite(ColdWaterValve, LOW); delay(1000); RinseCounter++; } //Make sure the water is OFF digitalWrite(ColdWaterValve, LOW); // Finish high speed spin SpinCounter = 0; Serial.println("Final Spin"); while(SpinCounter != 70){ digitalWrite(CWPin, HIGH); digitalWrite(LedPin, HIGH); delay(1000); SpinCounter++; } // Spin Down and turn pump off SpinCounter = 0; Serial.println("Slow Down"); while(SpinCounter != 20){ digitalWrite(CWPin, LOW); digitalWrite(LedPin, LOW); digitalWrite(WaterPumpPin, LOW); digitalWrite(ColdWaterValve, LOW); delay(1000); SpinCounter++; } // Release Spin Actuator digitalWrite(SpinActuatorPin, LOW); //Reset the water level WaterLevel = 0; //MachineCycle = 2; Serial.println("Washing Machine Stopped"); Serial.println("Go top the final wash cycle"); Serial.println("Filling Machine with Cold Water for Final Wash Cycle"); while(digitalRead(WaterLevelPin) != 1){ //Fill the machine digitalWrite(LedPin, HIGH); //Start Filing digitalWrite(ColdWaterValve, HIGH); //turn on the cold water valve } if(digitalRead(WaterLevelPin) == 1){ digitalWrite(LedPin, LOW); //Start Filing digitalWrite(ColdWaterValve, LOW); //turn on the cold water valve Serial.println("Machine filled with water"); WaterLevel = 1; } //3 minutes = 180000 Serial.println("Agitating Washing"); AgitationCounter = 0; while(AgitationCounter <= 80){ digitalWrite(CWPin, HIGH); digitalWrite(CCWPin, LOW); digitalWrite(LedPin, HIGH); // Serial.println("Agitate CW"); delay(700); digitalWrite(CWPin, LOW); digitalWrite(CCWPin, LOW); digitalWrite(LedPin, LOW); // Serial.println("PAUSE"); delay(700); digitalWrite(CWPin, LOW); digitalWrite(CCWPin, HIGH); digitalWrite(LedPin, HIGH); // Serial.println("Agitate CCW"); delay(700); digitalWrite(CWPin, LOW); digitalWrite(CCWPin, LOW); digitalWrite(LedPin, LOW); // Serial.println("PAUSE"); delay(700); AgitationCounter++; //Serial.println("Agitating Washing"); //Serial.println(AgitationCounter); } Serial.println("Soaking for 1 minute"); SoakCounter = 0; while(SoakCounter != 12){ delay(1000); SoakCounter++; } AgitationCounter = 0; Serial.println("Agitating after soak"); while(AgitationCounter <= 60){ digitalWrite(CWPin, HIGH); digitalWrite(CCWPin, LOW); digitalWrite(LedPin, HIGH); // Serial.println("Agitate CW"); delay(700); digitalWrite(CWPin, LOW); digitalWrite(CCWPin, LOW); digitalWrite(LedPin, LOW); // Serial.println("PAUSE"); delay(700); digitalWrite(CWPin, LOW); digitalWrite(CCWPin, HIGH); digitalWrite(LedPin, HIGH); // Serial.println("Agitate CCW"); delay(700); digitalWrite(CWPin, LOW); digitalWrite(CCWPin, LOW); digitalWrite(LedPin, LOW); // Serial.println("PAUSE"); delay(700); AgitationCounter++; //Serial.println("Agitating Washing"); //Serial.println(AgitationCounter); } Serial.println("Preparing to Spin"); while(digitalRead(SpinSensorPin) != 0){ digitalWrite(SpinActuatorPin, HIGH); // Serial.println(digitalRead(SpinSensorPin)); } //This will deal with the weird bounce issue from the actuator while(digitalRead(SpinSensorPin) != 0){ delay(1000); } if(digitalRead(SpinSensorPin) == 0){ SpinEnabled = 1; digitalWrite(LedPin, HIGH); // Serial.println("Spin Enabled"); } Serial.println("Ballance Load"); BallanceCounter = 0; while(BallanceCounter <= 10){ delay(1000); digitalWrite(CWPin, HIGH); digitalWrite(LedPin, HIGH); delay(1000); digitalWrite(CWPin, LOW); digitalWrite(LedPin, LOW); BallanceCounter++; } // Start emptying the water Serial.println("Ballance Load and Drain"); EmptyWater = 0; while(EmptyWater != 80){ digitalWrite(WaterPumpPin, HIGH); delay(1000); digitalWrite(CWPin, HIGH); digitalWrite(LedPin, HIGH); delay(1000); digitalWrite(CWPin, LOW); digitalWrite(LedPin, LOW); EmptyWater++; } // Start a Full Speed Spin Cycle Serial.println("Spin and Drain"); SpinCounter = 0; while(SpinCounter != 80){ digitalWrite(CWPin, HIGH); digitalWrite(LedPin, HIGH); delay(1000); SpinCounter++; } // Start Spin Rinse Serial.println("Spin and Rinse"); RinseCounter = 0; while(RinseCounter != 20){ digitalWrite(ColdWaterValve, HIGH); delay(1000); digitalWrite(ColdWaterValve, LOW); delay(1000); RinseCounter++; } //Make sure the water is OFF digitalWrite(ColdWaterValve, LOW); // Finish high speed spin SpinCounter = 0; Serial.println("Final Spin"); while(SpinCounter != 60){ digitalWrite(CWPin, HIGH); digitalWrite(LedPin, HIGH); delay(1000); SpinCounter++; } // Spin Down and turn pump off SpinCounter = 0; Serial.println("Slow Down"); while(SpinCounter != 20){ digitalWrite(CWPin, LOW); digitalWrite(LedPin, LOW); digitalWrite(WaterPumpPin, LOW); digitalWrite(ColdWaterValve, LOW); delay(1000); SpinCounter++; } // Release Spin Actuator digitalWrite(SpinActuatorPin, LOW); //Reset the water level WaterLevel = 0; MachineCycle = 0; Serial.println("Washing Machine Stopped"); }//Machine == 2 }
-
BACK EMF / EMI / RFI
03/08/2017 at 09:16 • 0 commentsAfter writing some code and making the thing work then connecting the motors things were not working as I would have expected. The arduino started to lock up and do some really weird things and the USB would drop out for no reason.
I re-wrote the code several times thinking that it was something I had done then made s really simple for loop that did the same thing.
It turns out that the motors when running on 240V and connected to the relay was creating some RFI that was getting picked up by the arduino's clock causing it to lock up and do some weird things.
So I decided to lineament a snubber circuit made up from a .47UF cap and a 1W 47ohm resistor connected across the relay points. in theory it should be connected in series to the motor but this was not working correctly and made little difference
Why they don't build this on the the duinotech board in the first place is any ones guess as most people using this board would suffer from the same problem. -
Arduino / Relay Pin Assignment
03/08/2017 at 09:05 • 0 commentsArduino Pin Function Relay Connection Washing Machine 2 Water Level Black N/C 3 Lid Switch Not Used Yet 4 Motor CW IN1 A5 - RED 5 Motor CCW IN2 A2 - WHITE 6 Spin Actuator IN3 A4 - YELLOW 7 Cold Water Valve IN4 CV - WHITE 8 Hot Water Valve IN5 HV - BLACK 9 Water Pump IN6 A6 - WHITE - PP 10 11 Run Switch 12 Spin Sensor A7 - Purple
A9 - Purple to GND -
Tracing Wires
03/08/2017 at 08:53 • 0 commentsThe first step was to start tracing all the wires and rip out the old controller.
Essentially the motor in this one is a 3 wire AC motor, this uses a starter cap and a common neutral. One winding causes the motor to rotate CW the other CCW.
There is a kind of actuator that pulls in the a locking pin to engage the spin cycle when the motor is run CW.
Care must be taken with this as unlike most things that have been wired up form some reason the simpson 711 wires are all labled BUT one end of the wire will say one thing then when it enters the connector it will say something else the at the termination point it will be labeled somehting else again.
I decided to base my wiring on the plug labels.
A1 = Blue = Common Neutral wire for Motor, Spin Actuator and Water Pump.A2 = White = Starter Capacitor and CCW Motor
A4 = Yellow = Spin Actuator
A5 = Red = Capacitor and CW Motor
A6 = Black = Water Pump
A7 = Purple = Spin Engaged Switch
A9 = Red = Spin Engaged Switch
White CV wire = Cold Water Valve
Black HV wire = Hot water valve
Purple = COM = Common Water Level SensorBlack = NC = Normally Closed Water Level Sensor
Brown = NO = Normally Open Water Level Sensor
Inside there is also a microswitch for the lid however for the moment I have no bothered connecting this.