Oven light detector

By Bevan Weir, 1 January, 2025

It is the holidays so I have time to muck around doing unimportant things.

An annoyance is when you want to use the oven to heat up some food quickly, it obviously takes time for the oven to get up to temperature. I can't do a lot about the time it takes to heat, that's just physics, but it is annoying that the oven does not tell you that it has reached temperature. You have to go to the oven often and check if the little red neon light has turned off. I thought that ovens should have a buzzer to tell you when it is ready, so I decided to build one!

A while ago I got an Arduino starter kit which has the 'Arduino UNO' microcontroller board and a bunch of electrical components. I knew this kit had a light sensor (photo-transistor) and a buzzer (piezo) so i thought I could come up with a device that could let me know when the oven temperature indicator light turns off.

The circuit diagram I designed is below. The phototransistor sits over the oven temperature indicator light and measures if the light is on or off. If the light is on (the oven is still heating) the circuit turns on the red LED to mirror the oven light indicator (since this is covered by the phototransistor). When the oven light turns off the red LED also turns off and the buzzer (piezo) sounds letting you know that the oven is up to temperature.

circuit diagram
Circuit diagram

And this is what it looks like in real life:

Arduino board wired up as per tje circuit diagram above
Arduino board wired up as per the circuit diagram, the photoresistor is at the far right

The circuit is only part of the solution. it also needs a programme to perform the logic of detecting the light signal and turning the light and buzzer on and off. The programming language for the Arduino is essentially C++ (with some minor differences). The relevant part of the code that turns the LED on/off and sounds the buzzer is below. Using simple values of minimum and maximum light values did not work well, so I considered the light to be 'off' when is was 80% or less of the maximum brightness.

void loop() {
  //read the input from A0 and store it in a variable
  sensorValue = analogRead(A0);

  if (sensorValue > sensorLow) {
    // turn on the LED on pin 4
    digitalWrite(4, HIGH);
  }

  if (sensorValue < 0.8 * sensorHigh) {
    // play the tone for 20 ms on pin 8
    tone(8, pitch, 20);
    // turn off the red LED
    digitalWrite(4, LOW);
  }

  // wait for a moment
  delay(10);

The full code is on my GitHub here: https://github.com/onco-p53/Arduino/blob/main/oven_light/oven_light.ino including the initial calibration code that I took from project 6 of the Arduino starter kit.

This was just a small project that took a few hours one afternoon, but a nice challenge since I have not drawn a circuit diagram since 7th form physics class, and never used the C++ language before.

 

Tags

Comments

The content of this field is kept private and will not be shown publicly.

comments

  • Allowed HTML tags: <em> <strong> <i> <p> <b>
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.