Ovencontroller with wifi.

This controller sends the temperature of your kiln every minute to a PC, where you can read out your data with a browser on a PC or on a smartphone. Also, the temperature data are stored in the static RAM of the controller and may be read out after the controller is connected to the USB port of a PC (see below: Reading the data by USB. The controller works together with a dedicated directory ("map" or working directory) in the http-tree of your computer. Obviously this computer should function as a webserver, i.e. it should have Apache and PHP enabled. See Install and setup.

  Version 3.0.
  connect wifi
  wifi connected
  192.168.178.49

If everything is installed correctly and the temperature sensor is connected, then you can connect the controller to a suitable power supply (12V). First some version information is shown for a few seconds. Then the lcd screen clears and offers three possibilities:

  0 No wifi
  1 Log by wifi
  2 Read remote
  enter number + A 

A choice is confirmed by pressing A

. (0) and (1) are obvious. If you select (0) logging is done only internally and you will have to read the data afterwards by connecting the controller to an USB port on your computer.
Option (1) causes the controller to log by Wifi to your computer and you can check your progress in real time on http://your_computer/path/lees.php. Depending on your operating system, you may even receive automated emails when the program stops. Selecting either (0) or (1) lets you proceed to the setup menu where you can manually enter your control parameters. See below: Entering control parameters by hand.
Option (2) refers to the possibility to read the control parameters from the PC, using the file 'control'. If this file does not exist, the controller keeps trying until a control file is created (with control.php) or a until a 'D' is entered. This will reset the controller and then return you to the three options mentioned above.
To create the control file, use http://your_computer/path/control.php.


Entering control parameters by hand.

After pressing (1) or (2) in the first menu, you will see the word "setup" on the second line of the LCD screen. Now you can enter a series of maximum 15 time periods and temperatures on the first line. Every step consists of the stepnumber, the number of minutes and the target temperature.

If the number of minutes is zero (0), the oven will go as fast as possible to the target temperature.

If the number of minutes is non-zero and the target temperature is different from the target in the last step, the target will be reached in equal increments over the number of minutes. Example: if the temperature at the beginning of the step was 50, and the target temperature 100, and if the duration is five minutes, the temperature will climb in 10 degrees per minute.

If the number of minutes is non-zero and the target temperature is equal to the last step, the temperature will be maintained on that level for the specifed number of minutes.

Example:
1 0 50 # go to 50 degrees as fast as the oven can heat
2 5 100 # go to 100 degrees in steps of 10 degrees in a minute
3 5 100 # hold on 100 degrees for five minutes
4 0 50 # switch off oven until cooled down to 50 degrees
5 5 50 # hold 50 degrees for 5 minutes



Setup menu


  setup  
  S:      M:       T:    
  S:7     H:12
  wifi connected

-----------------------------
Entering the steps:

On start or reset, the cursor wil blink at the minutes-position (M:). Enter the time for the first step and press 'A'. The same for the T: position (temperature). This process is repeated until the 'T:' is entered as just 'A'. The stepnumbers are automatically incremented.

After the first step is entered, the text 'Wifi (not) Connected' is replaced by "D step back, C copy". Pressing a 'D' cycles back through the steps already entered. You can cycle forward again by pressing 'C' (copy) for the M: and T: positions. During this activity the lower row will show the current step (S:) and highest step entered(H:). In the above example that would be step 7 of 12 steps already entered. Uce C to copy a previous value.

When the program is accepted, the message 'start' will be displayed for 5 seconds and will then send the steps to the logfile (1..2.. etc.).

You can 'hardwire' 15 time periods and temperatures in the program itself, if you wish to do so (programming knowledge and arduino IDE needed). This hard-wired program is always available.

Special keys in setup:

    * in setup - use hardwired program.
    # resume program from last run from step x (default 1) you will be prompted by "resume from: "
    D cycle back throug steps
    C copy previous value.
-----------------------------

During operation the display will show on its first line the stepnumber, the minutes completed in that step, the 'delta' (d) and the heating factor (w).

On the second line, the target temperature is displayed and another code (sps). The last line holds number of completed minutes for that step and two 'look-alive' characters. If they does not change for more than ten seconds, the program hangs.

Don't worry about the d, w and sps codes. -----------------------------
Display while running:

   S:3   M:33  D:4   W:3 
   Tg:110   sps:0.4
   Left in step: 10   *!

  3      step.
  M:33   minutes in this step.
  D:4    delta.
  W:3    warming factor.
  *      look-alive.

TG:110 target temperature. sps:0.4 sps.

Time left in step: 20

-----------------------------
If you want to see the details of a step while a program is running, press *. A running program can be interrupted by D. The choice 'reset' or 'continue' is given.

The program can also be interrupted remotely by using the program http://your_computer/path/control.php.

When the program finishes, the word 'End' is displayed, along with an error code (hopefully '0', but see below: error codes). At that moment the 'B' followed by 'A' will reset the program and start again.

-----------------------------
Special keys in setup:

    * use hardwired program.
    # resume program from last run from step x (default 1)
    D soft reset (restart)
    C copy value

-----------------------------
While running

    * display current step as programmed
    D soft reset (restart)
-----------------------------
look-alive codes
The look-alive signal displays a symbol on the last position of the lcd display.

*,@ 5 second cyclus in controlled heating
@ 5 seconds cyclus in doorstomen
! Kiln is active.

-----------------------------
Special keys in End:

    D soft reset (restart)

Controlling the controller remotely

The http://yourcomputer/path/control.php page will allow you to enter values for the control file. A table is presented where you can enter up to 15 steps for your temperature control.
If a control file already existed, the table will be filled with the values from that file. If not, it will be filled with the value -1. Please note that empty fields are not allowed. Selecting the checkbox 'save' will write the new or altered control file to the PC.
Of course you may have several controlfiles under different names, which you then can copy to 'control' and use them.

It is also possible to stop and restart the controller remotely. This is done by checking one of the radio buttons in the control.php interface. When the control file is saved, and one of the resume-options is checked, the controller stops and if one of the steps 1-15 is checked, start again. In the latter case, it will read the control file again and use a new control sequence with the checked number as the first step.

Nota Bene: it may be a minute or so before the controller reacts to these resume commands!


Reading the data by USB

Connect the controller to a PC running Linux and the Arduino environment. In the linux environment, use the command "lees" as follows:
$ ./lees
You see the text "sluit de controller aan, wacht op setup en druk op 'D'" Connect the controller to an USB port, wait till you see the word 'setup' anywhere on the LCD-screen of the controller and press the 'D' key on the controller.

The temperatures and program of the last run will be saved in a file "log_yyyy-mm-dd_hh_mm", e.g. "log_2016_01_01-12:00". Use the program 'showlog'

$ ./showlog log_yyyy-mm-dd_hh_mm
to display a graph.


Problems

The controller may "hang", i.e. the normal menu is displayed, but the look-alive characters do not change after five seconds. If Wifi is enabled, the central computer will signal a problem and send an email. If you log in to the website (lees.php), you will see a message to that effect.
Nota Bene: If Wifi contact with the central computer is interrupted, this will be reported as a "hang" in the website and on email. Therefore always check the controller for the look-alive signs before disconnecting the controller.

The controller may reset. The program is stopped and, if Wifi is enabled, an email is sent. This may occur after a power interrupt. On the controller display you will see the start menu.

errorcodes. If the program ends regularly, it displays a message "End. Err: x S:y", where y is the step where the program exited and y is:

0 - no error
1 - max temperature not reached.
2 - Thermocouple failure after five retries.
3 - more than 1900 eprom_writes (non-fatal).


Install and setup

As we have said before, your host computer should have Apache and PHP installed, and preferably run Linux. For normal day-to-day operation of the controller only a browser is needed.

Create a dedicated directory under your document tree and copy the first four files mentioned in this list. Please note that this directory should be write/execute enabled for your http daemon (e.g.: www-data).

  • lees.php
  • wifilees.php
  • control.php
  • check.sh
  • manual.html
  • (eventually) control
  • (eventually) one or more logfiles.
lees.php and control.php can be started from your browser, e.g.: http://your_computer/path/lees.php. wifilees.php is the schript that communicates with the controller and the file control, if present, contains a list of control parameters. This last file can be created and changed by control.php.


Hardware

I assume kilns that are governed by a single large relay in the kiln itself. This relay has three contacts for the three phases of the current that heats the oven and two for the primary coil.

The old controller generally is connected to the kiln by two small wires of the thermocouple and three 220V leads: one phase, one neutral and a return lead that controls the solenoid.

========================

Materiaal ongeveer 50 Euro

Arduino Mega 2560 17 E
Thermometerboard https://www.adafruit.com/products/269 11 E
2x16 LCD scherm 4 E
I2C piggyback voor LCD scherm LCDTOI2C 3 E
30A relais 4 E
4x4 keypad 2 E
Real time clock met 4K geheugen DS1307RTC 4 E
esp8266 on piggyback board 5 E
Snubber (if necessary) 2 E
Wallwart 12 V, 1-2 A kringloop 2 E
pinheaders, male and female. stekkers. Stuff. 5 E
A 9 Volt, 1 Amp wallwart or similar

General: I try to mount all components on pinheaders with corresponding female headers on a circuitboard, so they can easily be removed and replaced. Apart from that it is important to keep all leads as short as possible and then somewhat shorter.

The combination of the LCD screen and the piggyback controller enables the LCD screen to be controlled by just two wires apart from the two power leads. NOTE: the I2C pins vary with the particular Arduino board: on the Uno they are A5 and A4. On the Leonardo D0 and D1.

The RTC clock is a nice addition, not so much for keeping time, but also because you can store a record of the real temperatures and read them back afterwards. It also runs off the I2C bus.

The actuation of the large relais in the kiln causes a surge in the circuit (EMF), especially when switching off. This will may annoy the Arduino to the point of crashing. It will be prevented by the snubber, which essentially is a large condensator, over the outgoing or secondary contacts of the small relais in our controller.