Coffee Pot Shut Off Timer Project - Page 1
Forum section: electronics / beginners

author: Old Printer
author_rank: Frequent Contributor
timestamp: May 11, 2018, 02:18:28 am
content: My wife recently bought a perc style coffee pot that works really well, but it has no long term timer to shut if off if we forget. Something in the 4-6-8 hour period would probably do nicely. That time frame seems a bit long for an RC circuit. I have thought about having an arduino handle the counting and I have a relay that will handle 12 A @ 125V and it can be triggered with a current of 5-24V at only 1.5mA. Dose anyone have a suggestion on the control circuit aside from what I have already mentioned. I do have some pro mini arduino's in my junk box as well. Thanks, Dave

author: Paul Price
author_rank: Super Contributor
timestamp: May 11, 2018, 02:42:42 am
content: You could do this with a single CD4060 counter chip. It has a built in oscillator and can count the oscillator output to a max of 2 to the 14th power. When the chip is reset and starts counting, 2 to 13th x period of osc seconds later the output could trigger your shutoff relay. You can add a pot to control the oscillation freq if you want to go fancy and have a knob to set the time. 2 to the 13 is 8192, so if the oscillator is set to .1Hz, then it would take 8192 x 10 secs oscillator output or 81920 seconds. That's quite a few hours, do the math. You can set a higher oscillator freq or use a different output pin to shorten the time. The CD4060 doesn't need a regulated voltage but you shouldn't exceed 19 volts or there can be smoke. One chip, a diode, two resistors and a transistor might be needed to activate the relay. Two resistors and a small capacitor will set the oscillator working. Add another resistor and a reset switch and you're in business. Now, the problem remains on how to power your timer. Will you use batteries or a wall wart?Of course any microchip/Arduino can do this, but in some ways this can be more complicated if you are new to programming and setting up the software. Also in this case you might need to use two power supplies voltages and a driver transistor for the relay.

author: Nominal Animal
author_rank: Super Contributor
timestamp: May 11, 2018, 04:36:07 am
content: My suggestion is a DigiSpark (or a clone, or a Pro Mini if you already have those), a 10k linear pot for adjusting the time, an I2C 128x32 OLED display for showing how long (hours and minutes) since the coffee was brewed (started to brew), and optionally a couple of tactile buttons. You'll also need a 5V DC supply, or a 9-12V supply and a transistor with a current-limiting resistor for driving the relay.The microcontroller should only be powered when the coffee machine is turned on. The relay should be normally open, and control the power to the rest of the coffee pot. When turned on, the microcontroller starts counting time, and energizes the relay. (For safety, I'd actually use one tactile button, so that the relay is not energized by default, but only after the button is pressed. This does add a button press to the brewing, but it also means that if you can use a hardware watchdog timer to reset the microcontroller in case it glitches or crashes, it will not automatically energize the coil; and so the pot would default to "off" if a bug occurs.)Normally, the time in hours and minutes elapsed is shown on the display, so it shows how long since the brewing started. If the pot changes by more than some hysteresis value, or the other button is pressed, the maximum on time is displayed (and varied by the pot reading); after a couple of seconds, it'll revert to showing the elapsed time. To turn off the coffee pot, you turn off the coffee pot from its power switch.When the set time has elapsed, the relay is de-energized, and you change the display to show it is on, but the coffee pot is off. I would show how long the pot has been off, so that one can still grab a late cup if they want. I'd probably put the time on the right, as big as I can make the fixed-size font (needing only the ten digits), and an optional OFF / SET label smaller to the left of it. Without the label, the display shows the duration since the brewing started. I'd probably blink the colon between hours and minutes, too: one second on, one second off.(At 16×32 pixels, ten digits require 640 bytes of Flash; at 32×16, the OFF and SET label need 64 bytes each. Total 768 bytes. The DigiSpark ATtiny85 has 6k of flash for user code, so I think it should all fit. You can't use any of the existing SSD1306 libraries for the OLED display, as they're too large, though; you'd need to edit one heavily to get to work on an ATtiny85. No such issues with Arduino Minis, of course.)

author: Nusa
author_rank: Super Contributor
timestamp: May 11, 2018, 05:12:23 am
content: If you just want a solution it's not expensive:https://www.amazon.com/Century-Digital-Countdown-Repeat-Function/dp/B01D3QEK4E/https://www.amazon.com/Century-Mechanical-Countdown-Timer-Grounded/dp/B00MVDTEXS/

author: Old Printer
author_rank: Frequent Contributor
timestamp: May 11, 2018, 01:48:27 pm
content: Thank you all for the replies. I will digest the info provided. The Arduino version is attractive because I think I have all the necessary components on hand. I don't have the skills to write the code off-hand, but I have done a bit and there is so much out there that could be adapted. On the other hand the CD4060 would be something new and that is always a plus. My wife would urge me to go with the "Amazon" solution as she does not even trust UL, but that's no funThis is a few years old hobby for me and I enjoy every opportunity to put into practice the things I have learned. Thanks!

author: NivagSwerdna
author_rank: Super Contributor
timestamp: May 11, 2018, 03:08:45 pm
content: A bit long for a 555... there is a CSS555 which is a strange thing with a counter as well as a 555.But a uC would work nicely.Use a cheap ESP32 from China... because you know you want to be notified via MQTT when the pot turns on and off.

author: Paul Moir
author_rank: Frequent Contributor
timestamp: May 12, 2018, 05:11:35 am
content: uC I think is the way to go. Years ago I did some bathroom fans using 555s and some 4013s to switch between modes which had a pushbutton and LED interface. Push once for timed, push again for always on, push a third time to turn back off. It ended up stupidly complicated and fiddly.With a uC features can be added easily. And there's always features to add.

author: mariush
author_rank: Super Contributor
timestamp: May 12, 2018, 08:20:30 am
content: Or you could just buy one of these for $10:https://www.amazon.com/Century-Plug-Mechanical-Timer-Grounded/dp/B00MVFF59S/ref=zg_bs_495340_1?_encoding=UTF8&psc=1&refRID=3AH1GZG5NGB36YTXE8YTif you want to go diy, a micro, 5v adapter/capacitive dropper psu, a relay, seven segment digits or lcd display a bunch of buttons (enable/disable, instant on/off, + and - 5-10min, maybe presets 1,2,3 (like hold preset n button for 5s to store current time as preset, press 2 s to set, short press to check preset stored value)if you want super precise, a 32768hz oscillator for timing or clock/date/calendar ic.

author: Eka
author_rank: Regular Contributor
timestamp: May 12, 2018, 08:21:54 am
content: Quote from: Paul Moir on May 12, 2018, 05:11:35 amLike listening to the house automation system and shutting down the coffee pot when you go to sleep, or everybody leaves.

author: pepona
author_rank: Contributor
timestamp: May 12, 2018, 01:39:06 pm
content: Hi, my name is Marcos and I have read this forum since its creation.I have never participated because the difference of language and the great capacity and knowledge of its members "scares me" and I do not want to disrespect anyone with a misunderstanding.But well ... now I think I can share a small project that I did a few years ago and that works very well.Please be gentle.Best regards.Marcos.

author: viperidae
author_rank: Frequent Contributor
timestamp: May 12, 2018, 10:08:23 pm
content: There's an RFC standard for thishttps://tools.ietf.org/html/rfc2324

author: Old Printer
author_rank: Frequent Contributor
timestamp: May 13, 2018, 12:27:58 am
content: I have spent some time today working on the Arduino approach. I find it the most interesting, even if not the most direct. I am assuming the pot uses a ceramic resistive element, and am wondering if it has any inductive properties that need to be dealt with.

author: Eka
author_rank: Regular Contributor
timestamp: May 13, 2018, 03:06:46 am
content: I'd make the circuit that turns on and off the AC to the coffee pot generic so it could handle both inductive and non-inductive loads. This pot may use a non-inductive heating element, but who knows about its eventual replacement.

author: Nominal Animal
author_rank: Super Contributor
timestamp: May 13, 2018, 08:52:28 am
content: Quote from: pepona on May 12, 2018, 01:39:06 pmNot all of us have Eagle, so just for discussion's sake, you could consider taking for example a screenshot of the board (if two-layer, perhaps of both top and bottom?), and attaching those as images as well.

author: pepona
author_rank: Contributor
timestamp: May 13, 2018, 01:59:01 pm
content: Hi, I send you the schematic and the pcb in pdf format. I hope this helps you.Regards.

author: Nominal Animal
author_rank: Super Contributor
timestamp: May 13, 2018, 02:39:33 pm
content: Thanks, but I meant that you could attach the board and the schematic asimages, not as a compressed archive, for it to be easier for others to comment on. For example, thus:Pepona's multitimer board:Pepona's multitimer schematic:Note that I converted the images to 16-color PNG, and the image files are only 35076 and 27141 bytes, respectively, even though they are very large and crisp.I've shown my own much cruder attempshereandhere, and the response has been very positive and useful. I too was apprehensive about being harshly criticized, especially because electronics is not my field, and am very much just a hobbyist.

author: pepona
author_rank: Contributor
timestamp: May 13, 2018, 03:01:06 pm
content: Well, now I understand. Sorry but the difference in language does not make it so easy for me.Then the images that you uploaded are enough?

author: Nominal Animal
author_rank: Super Contributor
timestamp: May 13, 2018, 03:07:15 pm
content: Quote from: pepona on May 13, 2018, 03:01:06 pmYes.The zip archive containing the original files is useful, but not as useful as the images. The images make it easy for the advanced members here to take a quick look and comment right away.

author: pepona
author_rank: Contributor
timestamp: May 13, 2018, 03:10:13 pm
content: Ok, ok...thanks for the patience.

author: Old Printer
author_rank: Frequent Contributor
timestamp: May 13, 2018, 04:20:13 pm
content: Yes, thanks as well but I am very reluctant to download a compressed file.

author: Paul Price
author_rank: Super Contributor
timestamp: May 13, 2018, 05:05:36 pm
content: Old Printer: Don't be afraid of the .zip file. It can't bite you! I downloaded it and I am 100% sure it doesn't contain any malware/virus.There are two types of zip files, the first is simply a .zip compressed collection of files to bag together to be sent as a single package.This is the type you have been offered. It can't possibly do any harm because it doesn't do anything on your computer. Instead, your computer's unzip utility works on it to extract the files and the two files extracted have already been confirmed by me as safe.The second type of zip file is an zip.exe file which automatically unzips the contents of the files zipped-up when you click on it. This type of file could be possibly dangerous, because it does run the pkunzip program on your PC, but this is not the case here.It's good to be a little paranoid, and you probably have in any case an antivirus program on your PC to protect you from threats. The kind people trying to help you on this forum are 9999.99% of the time too busy to play any tricks like you might imagine.

author: pepona
author_rank: Contributor
timestamp: May 13, 2018, 05:44:42 pm
content: Hi OldPrinter, here is de code. It's written in melabs PicBasic3. I think in melabs website must be an online compiler.Code:'****************************************************************'* Name : MultiTimer2.BAS *'* Author : pepona *'* Notice : Copyright (c) 2014 *'* : All Rights Reserved *'* Date : 18/08/2014 *'* Version : 2.0 *'* Notes : PIC12F629 / PIC12F675 *'* : OK-Final *'****************************************************************#CONFIG__CONFIG _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN_ON & _CP_ON & _CPD_OFF#ENDCONFIGDATA @0, "MultiTimer v2.0 - (c) 2014 pepona"' Datos en eeprom al grabar el micro ( 1 Minuto )DATA @$70, 1 ' Bandera: 0 = Horas, 1 = MinutosDATA @$71, 0 ' Minutos programados (HighByte)DATA @$72, 1 ' Minutos programados (LowByte)' Calibracion del reloj interno - 4MhzDEFINE OSCCAL_1K 1' Defino retardo para antirrebote = 50msDEFINE BUTTON_PAUSE 50' Defino rutina para el servicio de interrupcionDEFINE INTHAND Int_TMR1' Defino variables y constanteswsave VAR BYTE $20 system ' las variables deben estar en el banco 0 si sonssave VAR BYTE bank0 system ' usadas en la rutina de interrupcionpsave VAR BYTE bank0 systemTick VAR BYTE bank0Bandera_Hor_Min VAR BYTE ' Bandera Horas ó MinutosHoras CON 0 ' 0 = Horas,Minutos CON 1 ' 1 = minutosRetardo_Prog VAR WORD ' Valor del retardo programado (en minutos)Retardo VAR WORD ' Valor del retardo a temporizarConta_Seg VAR BYTE ' Contador de segundosConta_Min VAR WORD ' Contador de minutosX VAR WORD ' Variable de uso generalButVar VAR BYTE ' Contador para antirrebotes de BUTTON' Defino puetosLibre VAR GPIO.0 ' piezzoSalida VARGPIO.1PulsadorVARGPIO.2Led_Verde VARGPIO.4Led_RojoVARGPIO.5GOTO Inicializar ' Salto la RSI' Rutina para el servicio de interrupcion en assembler' El Timer1 genera una interrupcion cada 500ms' Prescaler 1:8 - Precarga 3036 - Clock 4Mhz.AsmInt_TMR1movwf wsave ; Save Wswapf STATUS,W; Swap STATUS to W (swap avoids changing STATUS)clrf STATUS; Clear STATUSmovwf ssave ; Save swapped STATUSmovf PCLATH,W; Move PCLATH to Wmovwf psave; Save PCLATHmovlw d'11'; Precargo el Timer 1 con 3036movwf TMR1H; para mantener la interrupcion cada 500msmovlw d'220' ; (TMR1-highbyte = 11 y TMR1-lowbyte = 220)movwf TMR1L ;incf _Tick,F; Incremento el contadorbcf PIR1,0; Limpio bandera de interrupcionmovf psave,W; restore the state of everythingmovwf PCLATHswapf ssave,Wmovwf STATUSswapf wsave,Fswapf wsave,Wretfie; Return from interruptEndAsm' -------------------' --- Inicializar ---' -------------------Inicializar:' Inicializo puertos y registrosGPIO = 0TRISIO = %00001100 ' GPIO2 y 3 = entradas. el resto salidas#IF __PROCESSOR__ = "12F675"ANSEL = %00110000 ' Seteo GPIO todo digital. Solo PIC12F675#ENDIFCMCON = 7 ' Apago el comparador analogicoPAUSE 500 ' Espero que todo se estabiliceIF Pulsador = 0 THEN ' Si al encender, el pulsador esta presionadoSOUND GPIO.0,[123,80] ' Genero un "sonidito"GOTO Programar ' y voy a programar tiemposENDIFREAD $70, bandera_hor_min ' Recupero de la eeprom el indicador de horas / minutos programadosREAD $71, Retardo_Prog.highbyte ' Recupero el valor del retardo programado (HighByte) en minutosRead $72, Retardo_Prog.lowbyte ' Recupero el valor del retardo programado (LowByte) en minutos' -----------------------' --- Bucle principal ---' -----------------------Apagar:Salida = 0 ' Apago la salidaLed_Verde = 0Led_Rojo = 0Retardo = 0INTCON = $80 ' Apago las interrupcionesSOUND GPIO.0,[123,15,0,35,123,40] ' Hago un "sonidito"Flash_Led:IF Bandera_Hor_Min = Horas THEN ' Si se programaron horas -> Flash led rojoTOGGLE Led_RojoELSETOGGLE Led_Verde ' Si se programaron minutos -> Flash led verdeENDIFFOR X = 0 TO 9 ' Pruebo el pulsadorBUTTON Pulsador,0,255,0,ButVar,1,Encender ' cada 100msPAUSE 100 ' El led destella cada 1000msNEXT X ' 10 loops de 100ms c/uGOTO Flash_LedGOTO Apagar ' Nunca deberia llegar hasta acá !Encender:Salida = 1 ' Activo la salidaIF Bandera_Hor_Min = Horas THEN ' Si se programaron horasLed_Rojo = 1 ' prendo led rojoLed_Verde = 0 ' y multiplico el retardo programado * 60Retardo = Retardo_Prog * 60 ' para convertirlo en horasELSELed_Verde = 1 ' Si se programaron minutosLed_Rojo = 0 ' prendo led verdeRetardo = Retardo_Prog ' y cargo el valor a temporizarENDIFSOUND GPIO.0,[123,5] ' Genero un "sonidito"T1CON = %00110001 ' Enciendo el Timer1, prescaler = 1:8INTCON = %11000000 ' Habilito todas las interrupciones, y las por perifericosPIE1 = %00000001 ' Habilita interrupcion por desborde del Timer1TMR1 = 3036 ' Precargo el Timer1Tick = 0 ' Limpio contadoresConta_Seg = 0 'Conta_Min = 0 'Comparar:IF Conta_Min = Retardo THEN Apagar ' Comparo tiempos. Un Tick es generado cada 500ms por Timer1IF Tick = 2 THEN ' Si los tiempos coinciden apago la salidaTick = 0 ' Dos Tick = 1 segundo (obvio)Conta_Seg = Conta_Seg + 1 ' Incremento contadorIF Conta_Seg = 60 THEN ' Cada 60 segundos incrementoconta_Seg = 0 ' el contador de minutosConta_Min = Conta_Min + 1ENDIFENDIFBUTTON Pulsador,0,255,0,ButVar,1,ApagarGOTO Comparar' ---------------------------' --- Fin Bucle principal ---' ---------------------------' -------------------------' --- Programar tiempos ---' -------------------------Programar:INTCON = $80 ' No permito interrupcionesLed_Rojo = 1 : Led_Verde = 1 ' Enciendo led (ambar) = ProgramacionIF Pulsador = 0 THEN Programar ' Espero hasta que se libere el pulsadorPAUSE 500Led_Rojo = 0 : Led_Verde = 0 ' Apago led (ambar)PAUSE 1000Retardo_Prog = 0 ' Limpio contadorProg_Hor_Min:Led_Verde = 1 : Led_Rojo = 0FOR X = 0 TO 9BUTTON Pulsador,0,255,0,ButVar,1,Prog_minutosPAUSE 100NEXT XLed_Rojo = 1 : Led_vERDE = 0FOR X = 0 TO 9BUTTON Pulsador,0,255,0,ButVar,1,Prog_HorasPAUSE 100NEXT XGOTO Prog_Hor_MinProg_Minutos:FOR X = 0 TO 6TOGGLE Led_VerdePAUSE 100NEXT XProg_Min:Led_Verde = 1BUTTON Pulsador,0,255,0,ButVar,0,Prog_min ' Si presiono el pulsadorLed_Verde = 0 ' apago ledSOUND GPIO.0,[123,5] ' Genero un "sonidito"Retardo_Prog = Retardo_Prog + 1 ' incremento el contadorWRITE $70, Minutos ' marco bandera minutosWRITE $71, Retardo_Prog.highbyte ' y guardo el valor en la eepromWRITE $72, Retardo_prog.lowbyte ' (16 bit)PAUSE 300 ' Espero para que se libere el pulsadorGOTO Prog_Min ' loopProg_Horas:FOR X = 0 TO 6TOGGLE Led_RojoPause 100NEXT XProg_Hor:Led_Rojo = 1BUTTON Pulsador,0,255,0,ButVar,0,Prog_Hor ' Si presiono el pulsadorLed_Rojo = 0 ' apago ledSOUND GPIO.0,[123,5] ' Genero un "sonidito"Retardo_Prog = Retardo_Prog + 1 ' incremento contadorWRITE $70, Horas ' Marco bandera horasWRITE $71, Retardo_Prog.highbyte ' y guardo el valor en la eepromWRITE $72, Retardo_prog.lowbyte ' (16 bit)PAUSE 300GOTO Prog_HorEND

author: Old Printer
author_rank: Frequent Contributor
timestamp: May 13, 2018, 09:21:24 pm
content: Paul, Thanks for the assurance, and the electronic advice as well, and Pepona, I meant no disrespect, but when someone with one post to their credit attaches a file, I am not going to open it. I am actually kind of surprised that the forum software even allows a low count member to post an attachment, many forums do not. Now, back to the coffee potI will also say I am disappointed in the design of this unit. This is a $70 Farberware percolator, and it does not even have a pilot light to show that it is on, much less a circuit that prevents it from being left on indefinitely.

author: pepona
author_rank: Contributor
timestamp: May 13, 2018, 09:52:24 pm
content: I understand your fears ... but with respect to the timer I did it when my daughters left the TV, fan, etc. connected while they were in school and this was the best solution I found.I assembled it inside a cabinet with several power outlets, a two-color led and a pushbutton are necessary to turn it on, turn it off and program it.To program it, just keep pressing the button and connect to the AC power supply.Then release the button and the led alternates between red and green.If you want to program "minutes" you must press the button once when the LED is green, with the red LED "hours" are programmed.The LED remains lit in the selected color (minutes / hours) and now you must press the button as many times as you want, in units.That's it, now you unplug it.You reconnect it and the led is flashing in the programmed color.To activate the output you just have to press the button once (the led is on).You can deactivate it when you want by pressing the button again.On pin 7 (GPIO0) of the PIC a piezo buzzer can be connected to have a sound indication of the start and end of operation.That's all ... good luckExcuse me for my bad EnglishRegards...Marcos.Thanks Nominal Animal , I believe that now I uploaded the images correctly.

author: Old Printer
author_rank: Frequent Contributor
timestamp: May 14, 2018, 12:52:30 am
content: Pepona, thank you for the circuit, I will have a good look at it. I am still approaching this from the uC method as I think I will get to work with some things I have been wanting to learn more about. No worries about your English, far better than my Spanish.