Wednesday, May 15, 2013

Arduino Controlled Water Boiler and Warmer / Thermo Pot








I have an electric water boiler and warmer AKA thermo pot which was struck by lightning. The circuit board was heavily damaged beyond repair.



But the good news is all other parts such as heating elements, DC motor pump and temperature sensor still OK. So this is how the project started.


Before this project started, I did talk to my brother about Arduino. Sounds like fun. So I give them a try. I choose Arduino Uno for this project since it is highly recommended for a beginner.


Typical electric water boiler and warmer has 2 heating elements, boiler and warmer.
  • Boiler : 3A : 80Ω : 720W
  • Warmer : 0.6A : 390Ω : 144W
The DC motor pump working voltage is DC 9V.

I'm not sure what type of temperature sensor used by this boiler but from my study, it measures;
  • Around 100kΩ when 33°C (room temp)
  • Around 10kΩ when 100°C (boiled)
The question now is how to translate this value 100kΩ<=>10kΩ to  33°C<=>100°C? I start with a simple voltage divider, 5V DC, smoothing E capacitor and link them to Arduino pin A0 (AnalogInput)...

  • R5 = 10kΩ
  • C1 = 1µF
...wrote a simple program as below to get the AnalogInput value during both room temperature and boiled temperature.
int sensorPin = A0;

void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println(analogRead(sensorPin));
  delay(1000);             
}
From this test it reads...
  • Analog Value 116 while 33°C (room temp)
  • Analog Value 594 while 100°C (boiled)
So a simple linear equation (y = mx + c) in a function like below could be used to read the analog input and translate them to °C
float getTemp(int sensorValue){
  float y1 = 100;
  float x1 = 594;
  float y2 = 33;
  float x2 = 116;
  float m = (y1 - y2) / (x1 - x2);
  float c = y1 - (m * x1);
  return (m * sensorValue) + c;
}
From there I continue with other features;

16X2 LCD to show status and temperature. (pin D8 - D13). Notice that I ignore the contrast control pin? This because this LCD display is an old display that is having problem. :-( so I leave the pin open.



Unlock button, using Interrupt (pin D2) that will enable the pump and light up the LCD back-light for a period of time. I'm too lazy to built the Debounce module for this button so I use a capacitor :-)





Outputs (pin D5 and D6) to turn on boiler and warmer thru transistors and relays.



Buzzer (pin D4) for overheat alert, 1kHz tone.



Complete schematic diagram


Flow chart below would explain the system flow.

Complete Arduino sketch

#include <LiquidCrystal.h>

LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
int sensorPin = A0;            //temp sensor analog in pin
int samplingRate = 500;        //sampling/pulse rate
int unlockInt = 0;             //interrupt value not pin
int unlockTimer = 10000;       //unlocked timer in msec
int unlockTimerCount = 0;
int lcdBackLightPin =  7;      //lcd backlight signal pin
int lcdBackLightState = LOW;   //lcd initial state
int warmerPin = 5;             //warmer signal pin
int boilerPin = 6;             //boiler signal pin
boolean boiling = false;
int boiledTimer = 10000;       //in msec
int boiledTimerCount = 0;
int warmLowLimit = 80;
int warmHiLimit = 85;
int reboilTemp = 65;
int boiledTemp = 95;
int emcyTemp = 105;
int buzzerPin = 4;
int buzzerFreq = 500;

void setup() {
  //Serial.begin(9600);
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  lcd.setCursor(0, 0);
  lcd.print("Temp =");

  //set up unlock int pin
  attachInterrupt(unlockInt, unlock, RISING);

  //set lcd backlight signal pin
  pinMode(lcdBackLightPin, OUTPUT);

  //set warmer & boiler pin
  pinMode(warmerPin, OUTPUT);
  pinMode(boilerPin, OUTPUT);
  pinMode(buzzerPin, OUTPUT);
}

void loop() {
  float temp = getTemp(analogRead(sensorPin));
  //Serial.println(temp);
  printTemp(temp);
  checkUnlock();
  heatingFunc(temp);
  checkOverHeat(temp);
  delay(samplingRate);
}

void checkOverHeat(float localTemp){
  if(localTemp >= emcyTemp){
    int buzzerPinState = LOW;
    digitalWrite(boilerPin, LOW);
    digitalWrite(warmerPin, LOW);
    lcdClearLine(1);
    lcd.setCursor(0, 1);
    lcd.print("Overheat!!!");
    while(true){
      digitalWrite(buzzerPin, buzzerPinState);
      delayMicroseconds(buzzerFreq);
      buzzerPinState = !buzzerPinState;
    }
  }
}

void heatingFunc(float localTemp){
  if(!boiling){
    if(localTemp < reboilTemp){
      boiling = true;
      boiledTimerCount = boiledTimer;
      digitalWrite(boilerPin, HIGH);
      digitalWrite(warmerPin, LOW);
      lcdClearLine(1);
      lcd.setCursor(0, 1);
      lcd.print("Boiler ON");
    }else if(localTemp < warmLowLimit){
      digitalWrite(warmerPin, HIGH);
      lcdClearLine(1);
      lcd.setCursor(0, 1);
      lcd.print("Warmer ON");
    }else if(localTemp > warmHiLimit){
      digitalWrite(warmerPin, LOW);
      lcdClearLine(1);
      lcd.setCursor(0, 1);
      lcd.print("Warmer OFF");
    }
  }else{
    if(localTemp > boiledTemp){
      boiledTimerCount = boiledTimerCount - samplingRate;
      lcdClearLine(1);
      lcd.setCursor(0, 1);
      lcd.print("95");
      lcd.print((char)223);
      lcd.print("C hitted");
    }
    if(boiledTimerCount <= 0){
      digitalWrite(boilerPin, LOW);
      boiling = false;
      lcdClearLine(1);
      lcd.setCursor(0, 1);
      lcd.print("Boiler OFF");
    }
  }
}

void lcdClearLine(int lineNo){
  lcd.setCursor(0, lineNo);
  lcd.print("                ");
}

void checkUnlock(){
  if(lcdBackLightState == HIGH){
    unlockTimerCount = unlockTimerCount - samplingRate;
    if(unlockTimerCount <= 0){
      lcdBackLightState = LOW;
      digitalWrite(lcdBackLightPin, lcdBackLightState);
    }
  }
}

void unlock(){
  lcdBackLightState = HIGH;
  unlockTimerCount = unlockTimer;
  digitalWrite(lcdBackLightPin, lcdBackLightState);
}

float getTemp(int sensorValue){
  float y1 = 100;
  float x1 = 594;
  float y2 = 33;
  float x2 = 116;
  float m = (y1 - y2) / (x1 - x2);
  float c = y1 - (m * x1);
  return (m * sensorValue) + c;
}

void printTemp(float localTemp){
  //clear last 10 char
  lcd.setCursor(6, 0);
  lcd.print("          ");
  if(localTemp>99){
    lcd.setCursor(8, 0);
  }
  else if(localTemp>9){
    lcd.setCursor(9, 0);
  }
  else{
    lcd.setCursor(10, 0);
  }
  lcd.print(localTemp);
  lcd.print((char)223);
  lcd.print("C");
}

The flow is quite similar to the original design and other model/brand. Reboil at 65°C, stop boiling several minutes after 95°C, cut off at 105°C. I did salvage an old circuit board from a different model of boiler and found 3 thermostats 65°C, 95°C and 105°C. So I guess all boilers are using the similar flow.

The final test...







Next is to built a proper circuit board and put it back together in one piece.

Wednesday, July 11, 2012

Adding Extra VGA connector to Dell 3400MP Projector

Since M1-DA to VGA cable is quite expensive, we have decided to add extra connector to our Dell 3400MP Projector so we could just use common male to male VGA cable.

M1-DA to VGA CableM1-DA to VGA Cable

1st thing to do is to know the connector pin-out. For VGA connector we have 15-pin connector.
Cable = MALE and Projector = FEMALE.

D15 Female VGAD15 Male VGA

Next, the M1-A connector (AKA M1-P&D Plug) A lot of pin. :-)
Cable = MALE and Projector = FEMALE.

M1 maleM1 female

Internet research tell me that only 7 connections are needed in order to make this work as below



>

VGA pin# M1 pin#
Red 1 C1
Green 2 C2
Blue 3 C4
RGB
Ground
6,7,8 (join) C5
Horizontal
Sync
13 5
Vertical
Sync
14 6
Sync
Ground
10 4

Now the hard work begin.... disassembling...

Top cover removed

Soldering...

Temporary testing setupSoldering job, not so neat :-(

Testing...

Testing setupTesting setupTesting setup

Finally, the connector cut-out through the Dell 3400MP magnesium alloy chassis.

Magnesium alloy connector cut-out

Final test.

Final test




Sunday, July 31, 2011

Troubleshooting Remote Controlled Ceiling Fan

Last week, I came across 2 different model same brand dead ceiling fan. Both models are remote controlled model. Symptom quite similar.



The first model comes with 7 speed but I can only see only 5 TRIACs on the board. Not sure how it works.



Meanwhile the second model comes with 3 speed and 3 TRIACs available on the board. I assume 1 TRIAC for 1 speed.



While troubleshooting they look like their µC don't have enough power to start. The buzzer give something like repeating click sound. I did measure the µC Vdd/Vss and found out that the voltage is less than 5V.

After a quick search at Google, lead me to aztronics . Similar symptom. So I give them a try.

Desolder the capacitor and measure. Binggo! All caps (regulator part) value is less than they should be.



Replace them all and test with a smaller vent fan.



Done and pass them back to their owner to test with the their ceiling fan motor.


22nd Mar 2013, another board coming in. Same thing. µC powering problem.



Replace both caps solve the issue. It looks most of the ceiling fan across diff brand are having similar issue.

Tuesday, December 29, 2009

HP TX1000 Entertainment Tablet PC GPU Fix

A friend of mine ask for a favor to take a look at his HP TX1000 Entertainment Tablet PC blackout LCD problem. I have no idea on how to fix this until I found below video.


Instead of using bulb, I used a heat blower to re-flow the chip.



From my observation, there is a the gap between the GPU and the heat sink was join by a burned thermal conductive silicone sponge.



I replace this with an aluminum foil folded a couple of times to get just the right thickness.



After reassemble it back together and now, the moment of truth, Hey! it works! :-)

Thanks a lot jasonshay2. You really save my day.

Monday, December 07, 2009

P16PRO40 programmer strip board layout

What is P16PRO40? It is a programming tool for several types of PIC micro controller. I'm not sure the origin of it, but I found it here at http://www.winpicprog.co.uk/ while browsing. The schematic can be found here at http://www.lpilsley.co.uk/pdf/p16pro40.pdf.

Since I saw a several request for P16PRO40 strip board layout, so I decided to share it here.

My PIC programming tool is a strip board based (AKA Veroboard). It is not as compact & neat as the commercial programmer but guess what, It took only 2 hours for me to built it from my electronic junkyard, except the 74LS05 and of course the strip board it self. Use normal IC socket if you don't have a ZIF socket.

I have made some modification to the circuit to match what I can find on my electronic junkyard. I replaced BC557 with A1015 (PNP), note that both transistor don't share the same pin layout. Just be careful if you want to use the alternative transistor.

On the power supply circuit, I've remove 7808 regulator since I already have 13V power supply. I only use 7805 to produce the 5V Vcc and the 13V Vpp comes directly from the main power supply.

I've also remove Vpp40 on/off from my PIC programmer. I've no plan to use them in the near future.

The programmer has been tested to work with 16F84A & 16F628A.

The recommended software for this programmer is WinPicProg 1.91 from http://www.winpicprog.co.uk/. It is simple but reliable software for PIC programming.

If you are using 74LS05 or 74LS06, set your 'hardware' setting as below. They are both HEX Inverter Open Collector output ICs but 74LS06 has extra features = with Buffer/Driver and 30V output.

Below is my test circuit, just a simple blinking program to test it out.

Additional images ...

Recent Articles

Distributed By My Blogger Themes | Created By BloggerTheme9 | © 2014 DIY Electronics
TOP