Project tutorial
Upcycling Dishwasher

Upcycling Dishwasher © GPL3+

I used an Arduino Nano to fix my dishwasher.

  • 11,207 views
  • 4 comments
  • 18 respects

Components and supplies

Necessary tools and machines

70y8518 40
Drill / Driver, Cordless
09507 01
Soldering iron (generic)

Apps and online services

About this project

I had that all-high-voltage oldie dishwasher that stopped working. Its program switch has burned and I could not find the replacement part. But it is a quite good challenge for an Arduino project. :)

Plan:

  • Connect the switches directly to Arduino like door, water lever switches
  • Replace dumb thermostat by thermistor to allow different temperature operations
  • Manage high voltage stuff by relay board like motor, heater, water valve
  • Add LED output and USB connector to the front panel

Switches

I decided to switch +5V and use pulldown resistors for each.

Thermistor

I have found many good descriptions on the web for that part. See the links. My only job was to build a thermistor into the thermostat housing. The sink has that sized hole, and I only have rubber sealing for it. I just removed the bimetal switch by a screwdriver and used epoxy glue to seal the thermistor.

Relay board

It switches 230V, so I wanted to keep far from other electronics. An old floppy cable was long enough and I also saved some soldering with it.

Pump motor

Fortunately it does not need any electronics, just 2 hot wires manage the way of rotation which manages the wash/flush-to-drain modes by the both turbine chambers. That is connected to a single relay's NO and NC connector. The 3rd neutral wire also connected to an other relay to let me switch it on/off.

Display

I had a TM1637 at home: 4 digit 7 segment. It is recently used for clocks. I decided to use the 1st 2 digits for time and other 2 digits for temperature. I also wanted some alphabetic debug messages here like 'door is open' or 'intake' or 'flushing out', so I needed to modify the library to manage all segments separately. The lib only supports writing hexadecimal characters 0-9, A-F.

Program, how it works

I kept the original power switch to power on/off the relay card and the aurdino - together with its phone charge adapter. I added a potentiometer into the place of the old program switch, so I can use it to set the wash time and temperature - depending on the mode switch. That is when arduino boots with opened door. When door is closed during the boot it will start a pre-defined program which is good for the most washing jobs: 30 minutes at 40 degree Celsius, or 50 minutes on 60 degree - also depending on the state of the mode switch.

Future plan

  • Use PCB
  • Use resistor array to simplify the board
  • Maybe an LED matrix display instead of the LCD
  • It is a small dishwasher with few dishes. Even using the smallest dishwasher tablet sometimes I got some leftover detergent. Maybe one rinse cycle is not enough.

Code

dishwasherC/C++
#include "TM1637.h"
#define SEG_A 1   //      -- A --
#define SEG_B 2   //     |       |
#define SEG_C 4   //     F       B
#define SEG_D 8   //     |       |
#define SEG_E 16  //      -- G --
#define SEG_F 32  //     |       |
#define SEG_G 64  //     E       C
//                       |       |
//                        -- D --
// washing time
int w_time = 40 * 60; // washing time in minutes
int w_temp = 60;      // washing temperature
int r_time = 10 * 60; // rinsing time in minutes

// pins
const int pinPumpDir = 12;    // relay - pump direction : wash/flush
const int pinPumpPow = 11;    // relay - pump power
const int pinHeater  = 10;    // relay - heater
const int pinWatInlet = 9;    // relay - water inlet valve
const int pinDoor  = 8;    // switch on door
const int pinModeSel  = 7;    // switch for mode select: temp/time setting
const int WaterSensorHig = 6; // switch on floater
const int WaterSensorLow = 5; // switch on floater
const int pinLedDio = 4;      // I2C pin for TM1637 LCD
const int pinLedClk = 3;      // I2C pin for TM1637 LCD
// analog pins
int PinThermistor = 6;
int PinPotMeter = 5;

// variables
int temp;
int potMeter;
int WaterLow = 0;
int WaterHig = 0;
int doorState = 0;           // variable for reading the pushbutton status
unsigned long time_curr;    // current timestamp
unsigned long seconds;
unsigned long time_cstart;  // cycle start timestamp

// motor modes
#define mstop 0
#define mwash 1
#define mflush 2

TM1637 tm1637(pinLedClk, pinLedDio);

// washing state
int w_cycle = 0;   // washing cycle varibale walking on below values
#define w_start  0 // just started: wait for door to be closed, flush all remaining water for at least 10 sec
#define w_fill   1 // fill for washing
#define w_wash   2 // wash the dishes + heat to 40 Celsuis
#define w_wflush 3 // flush washing water
#define r_fill   4 // fill for rinsing 
#define r_rinse  5 // rinsing         + heat to 30 Celsuis
#define r_flush  6 // flush rinsing water
#define r_finshed 7 // flush rinsing water

// ========================================================================================================================
void showLed(uint8_t BitAddr, int8_t DispData)
{
  tm1637.start();          //start signal sent to TM1637 from MCU
  tm1637.writeByte(ADDR_FIXED);//
  tm1637.stop();           //
  tm1637.start();          //
  tm1637.writeByte(BitAddr | 0xc0); //
  tm1637.writeByte(DispData);//
  tm1637.stop();            //
}

// the setup function runs once when you press reset or power the board ===================================================
void setup() {
  Serial.begin(9600);
  Serial.println();
  Serial.println("start=============");

  pinMode(pinPumpPow, OUTPUT);
  pinMode(pinPumpDir, OUTPUT);
  pinMode(pinWatInlet, OUTPUT);
  pinMode(pinHeater, OUTPUT);

  pinMode(WaterSensorLow, INPUT);  // init water low sensor
  pinMode(WaterSensorHig, INPUT);  // init water high sensor
  pinMode(pinDoor, INPUT);      // init door sensor

  tm1637.init();                  // init lcd
  tm1637.set(6);                  // set brightness
  tm1637.display(0, 8);           // show 'booted'
  tm1637.display(1, 8);
  tm1637.display(2, 8);
  tm1637.display(3, 8);
  /*
    for(int i=0;i<=8;i++)
    {
    showLed(0x02,1|2);delay(1000);
    showLed(0x02,2|64);delay(1000);
    showLed(0x02,64|32);delay(1000);
    showLed(0x02,32|1);delay(1000);
    }
  */
  digitalWrite(pinPumpPow, HIGH); // stop flush
  digitalWrite(pinPumpDir, HIGH); // stop pump
  digitalWrite(pinWatInlet, HIGH); // stop water valve
  digitalWrite(pinHeater, HIGH); // stop heater
}
// ========================================================================================================================
void setTemp(int level) {
  if (getTemp() < level)  {
    digitalWrite(pinHeater, LOW); Serial.print(", pinHeater:LOW");
  } else {
    digitalWrite(pinHeater, HIGH); Serial.print(", pinHeater:HIGH");
  }
}
// ========================================================================================================================
int getTemp() {
  int Vo;
  float R1 = 10000;
  float logR2, R2, T, Tc;
  float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07;

  Vo = analogRead(PinThermistor);
  R2 = R1 * (1023.0 / (float)Vo - 1.0);
  logR2 = log(R2);
  T = (1.0 / (c1 + c2 * logR2 + c3 * logR2 * logR2 * logR2));
  Tc = T - 273.15;
  return (int)Tc;
}
// ========================================================================================================================
void manage()
{
  while (WaterHig == 1) {
    tm1637.display(0, 10);  // A
    pump(mflush);
    delay(100);
    WaterHig = digitalRead(WaterSensorHig);
  }
  while (doorState == 0) {
    tm1637.display(0, 11);  // B
    pump(mstop);
    delay(100);
    doorState = digitalRead(pinDoor);
  }
}
// ========================================================================================================================
void readInput() {
  temp = getTemp();
  WaterLow = digitalRead(WaterSensorLow);
  WaterHig = digitalRead(WaterSensorHig);
  doorState = digitalRead(pinDoor);
}

#define w_out     0 // 
#define w_normal  1 // 

// ========================================================================================================================
void setWaterLevel(int level)
{
  switch (level) {
    case w_out:
      digitalWrite(pinWatInlet, HIGH);    // close water inlet valve
      while (digitalRead(WaterSensorLow) == 0) {
        if (digitalRead(pinDoor) == 0)
          pump(mstop);
        else
          pump(mflush);
        showLed(0, SEG_C | SEG_D | SEG_E | SEG_G);
        showLed(1, SEG_C | SEG_D | SEG_E);
        showLed(2, SEG_D | SEG_E | SEG_F | SEG_G);
        showLed(3, 0);
        delay(100);
      }
      delay(10000);
      pump(mstop);
      break;

    case w_normal:
      while (digitalRead(WaterSensorLow) == 1) {
        if (digitalRead(pinDoor) == 0)
          pump(mstop);
        digitalWrite(pinWatInlet, LOW);     // open water inlet valve
        showLed(0, SEG_C);
        showLed(1, SEG_E | SEG_G | SEG_C);
        showLed(2, 0);
        showLed(3, 0);
        delay(100);
      }
      digitalWrite(pinWatInlet, HIGH);    // close water inlet valve
      break;
  }
}
// ========================================================================================================================
void witeLCD()
{
  // Show the state of pushbutton on serial monitor
  Serial.print(", WaterLow:");
  Serial.print(WaterLow);
  Serial.print(", WaterHig:");
  Serial.print(WaterHig);
  Serial.print(", doorState:");
  Serial.print(doorState);

  Serial.print(", w_cycle:");
  Serial.print(w_cycle);
  witeLCDTemp(temp);
}
void witeLCDTime(int data)
{
  Serial.print("LCDTime:");
  Serial.print(data / 60);
  Serial.print(":");
  Serial.println(data % 60);
  if (data > 60) {
    tm1637.display(0, data / 60 / 10);
    tm1637.display(1, data / 60 % 10);
  }
  else {
    tm1637.display(0, data / 10);
    tm1637.display(1, data % 10);
  }
}
void witeLCDTemp(int data)
{
  Serial.print("LCDTemp:");
  Serial.println(data);
  tm1637.display(2, data / 10);
  tm1637.display(3, data % 10);
}
// the loop function runs over and over again forever =====================================================================
void loop() {
  while (digitalRead(WaterSensorHig) == 1) {
    tm1637.display(0, 10);  // A
    pump(mflush);
    delay(100);
  }

  readInput();
  witeLCD();

  switch (w_cycle) {
    case w_start:                   // 0 - start
      setTemp(0);                   // stop heater
      // started with door opened - let user change the washing parameters: time/temperature
      if (digitalRead(pinDoor) == 0) {
        while (digitalRead(pinDoor) == 0) {
          potMeter = analogRead(PinPotMeter) / 10 - 33;   //545 - 1020
          if (digitalRead(pinModeSel)) {
            w_temp = potMeter;                // 24..69 celsius
            witeLCDTemp(w_temp);
          }
          else {
            w_time = (potMeter * 90) - 1600;  // 6..76 minutes
            witeLCDTime(w_time);
          }
          delay(100);
        }
      } else {
        if (digitalRead(pinModeSel)) {
          w_temp = 60;                // 24..69 celsius
          w_time = 50 * 60;           // 6..76 minutes
        }
        else {
          w_temp = 40;                // 24..69 celsius
          w_time = 30 * 60;           // 6..76 minutes
        }
        witeLCDTemp(w_temp);
        witeLCDTime(w_time);
        delay(5000);
      }
      Serial.print("temp:");
      Serial.print(w_temp);
      Serial.print(", time:");
      Serial.println(w_time);
      setWaterLevel(w_out);         // flush all remaning water
      w_cycle++;
      time_cstart = millis();
      break;

    case r_fill:                    // 4 - fill for rinsing
    case w_fill:                    // 1 - fill for washing
      setWaterLevel(w_normal);
      time_cstart = millis();
      w_cycle++;
      break;

    case w_wash:                   // 2 - wash
      setTemp(w_temp);
      pump(mwash);
      setWaterLevel(w_normal);     // check again water level
      seconds = (millis() - time_cstart) / 1000;
      witeLCDTime(w_time - seconds);
      if (seconds >= w_time)
        w_cycle++;
      break;

    case r_rinse:                 // 5 - rinsing
      setTemp(30);
      pump(mwash);
      setWaterLevel(w_normal);
      seconds = (millis() - time_cstart) / 1000;
      witeLCDTime(r_time - seconds);
      if (seconds >= r_time)
        w_cycle++;
      break;

    case w_wflush:                // 3 - flush washing water
    case r_flush:                 // 6 - flush rinsing water
      setTemp(0);                   // stop the heater
      pump(mstop);                  // stop the pump
      delay(1000);                  // wait for pump to stop
      setWaterLevel(w_out);
      w_cycle++;
      break;
  }
  Serial.println();
  delay(1000);                       // wait for a second
}

void pump(int mode)
{
  if (doorState == 0) {             // door is open
    Serial.println("pump:door");
    digitalWrite(pinPumpPow, HIGH);    // stop pump
  }  else {
    switch (mode) {
      case 0:
        digitalWrite(pinPumpPow, HIGH); // stop pump
        break;
      case 1:                       // wash
        digitalWrite(pinPumpDir, LOW);   // set rotation to wash the dishes
        digitalWrite(pinPumpPow, LOW);   // start pump
        break;
      case 2:                       // flush to drain
        digitalWrite(pinPumpDir, HIGH);   // set rotation to flush into drain
        digitalWrite(pinPumpPow, LOW);    // start pump
        break;
    }
  }
}

Schematics

connection chart
Mosogep ij98s26mj6

Comments

Similar projects you might like

Scorbot ER-V+ Controller & Simulator Design

Project tutorial by Amit Nandi (BigWiz)

  • 2,901 views
  • 3 comments
  • 7 respects

Cayenne and SparkFun IoT 433 Mhz Sockets

Project tutorial by Giovanni Gentile

  • 3,446 views
  • 0 comments
  • 13 respects

RFID Desk Lamp with RGB Color Scheme Lock

Project tutorial by Kutluhan Aktar and JLCPCB

  • 2,559 views
  • 1 comment
  • 5 respects

IoT Using ESP8266-01 and Arduino

Project tutorial by Ahmed Ibrahim Ahmed

  • 48,696 views
  • 24 comments
  • 67 respects

Probability | Autonomous Rover

Project in progress by Cole Purtzer

  • 30,568 views
  • 22 comments
  • 111 respects

RTC Bird Feeder

Project tutorial by Kutluhan Aktar

  • 7,724 views
  • 4 comments
  • 14 respects
Add projectSign up / Login