This device was inspired by a mate of mine, Des.
I said to him: “with the Arduino we’ve got loads of solutions, we just need some problems to solve now”.
He said the thing that bugs him most is that he puts toast on every morning and then he invariably gets sidetracked. So he ends up with cold toast most of the time.
Well this device fixes that...
It’ll keep an eye on your toaster (or any other appliance for that matter) and remind you when it’s ready.
You'll never have cold toast again.
The video above shows you what happens...
Step 1: The Development Process
It seems that the best way to do this would be to sense when the toaster (or other appliance) switches off.
For this a Current Sensor would do the job. We can detect when the appliance goes on and again when it switches off.
Now we can start bugging my mate that his toast is getting cold!
For the prototype I did a bit of a tear-down of an old UPS I had lying around. This seemed like the logical place to find some of the components I needed.
I saw something that looked like it was a Current Transformer (pictured above).
The distinction between a Current Transformer (CT) and a Voltage Transformer (VT) is that a CT is connected in Series with the load like you would with an Ammeter whereas a VT is connected in Parallel across the load. A CT will therefore have a much thicker wire in the Primary Coil than a VT, in order to carry the load.
The main function of a Current Transformer is to turn a high current in the Primary Coil into a much lower one in the Secondary Coil where it can be safely measured by an instrument. This can be an accurate measurement because the current in the Secondary Coil is proportional to the higher current in the Primary Coil. This is why CT's are also known as Instrument Transformers.
Step 2: The Prototype
To test the Current Transformer, I built my first prototype, pictured above. I made the PCB by hand-drawing the circuit on the copper with a Permanent Marker and etching it with Ferric Chloride. Pretty basic but it does the trick.
Step 3: Some of the Theory
Because AC is a sine wave alternating between a positive and a negative voltage we need to lift it into a positive range only so that it can be measured by the Arduino and not damage it.
For this we need to add some “DC Bias” using a voltage divider (R1 and R2) so that the output is lifted into a positive range only, ie: 0 to 5V instead of -2.5V to +2.5V. R1 and R2 should be of equal value and not less than 10k ohm.
Current Transformers also require a “Burden Resistor” (R3) to place a load on it. Essentially you are measuring the Voltage Drop across this resistor. Various values are recommended but I found I needed a higher value. You shouldn't operate a Current Transformer without a Burden Resistor across it. In theory this will produce an infinite open circuit voltage in the Secondary Coil. In this case a very low current but still not good for your Arduino.
You also need a Capacitor (C1) that provides a path for the alternating current to bypass the resistor.
I tested this out with an Arduino and it worked like a charm and didn’t blow the Arduino up. I tried toasters and kettles and heaters and could determine exactly when they switched on and off. And the Current Transformer didn't blow up either. Actually it did, once, when I connected it in Parallel across the AC by accident! So I had to scavenge another one :-)
When the appliance is off the voltage on the Arduino Analog pin stays at 2.5V. When the appliance is switched on there is a sine wave around this. The Arduino code just looks for variations around the 2.5V level to determine if the appliance is on or not.
The measured output doesn’t seem to go above 5V. The ATMega chip does have input protection but one needs to be careful as you could still damage it. I added a series resistor on the Analog input but I wondered whether I also needed something like a 5.1V Zener diode (eg: 1N4733A) to protect the Analog pin but so far this doesn’t seem to be necessary. Maybe some Electronics Major can provide some practical advice here :-).
Step 4: How It Works
So in a nutshell then:
This device uses an Arduino and monitors a Current Transformer to determine if the connected appliance has been turned on or off. After the appliance turns off a Piezo Buzzer will sound at regular intervals for a predetermined number of times or until the Cancel button is pressed.
The Arduino code is included in this instructable and is fully customisable to your requirements.
Step 5: What You’ll Need
- An old timer switch or suitable enclosure
- Arduino Pro Mini 5V
- Current Transformer – there are many kinds out there and you could adapt the circuit accordingly. The one I scavenged from the UPS works great! NB: Make sure it is rated to handle more current than you are likely to put through it. Check the specs of your appliances.There are other off the shelf non-invasive types you can use as well. Just adapt the circuit accordingly.
- Piezo buzzer – also scavenged from the UPS.
- NPN Transistor BC547 or 2N2222 or equivalent - to make the Piezo Buzzer a bit louder
- Power supply for the Arduino. I scavenged an old mobile phone charger for this. Try a switching power supply (ie: no heavy transformer) of at least 6V or so. NB: the Arduino Pro Mini cannot take anything more than 12V (regulated). The Pro Mini does have an on-board 5V regulator but keep the input below 12V or you will fry it!
- Capacitors: 1x 10µF electrolytic, 2x 100nF ceramic
- Resistors: 3x 10k+ ohm, 4x 330 ohm, 1x 470 ohm
- LED’s: 1 green, 1 red
- Push button (momentary)
- PC board
- Header Pins for the Arduino: 2x 12 male pins and 2x 12 female headers to go onto the PCB board. I prefer not soldering the Arduino directly to the PCB. Although in this case space is at a premium.
- A USB to Serial programmer if you don't already have one
Step 6: Full Schematic
The full schematic is shown above. On top is the “User Interface”. This includes the LED's, the Buzzer and the Cancel button. The Interface and the actual Operation is described later in this Instructable. I've got a transistor driving the Piezo buzzer to make it louder. It may be better to use a higher value base resistor eg: 1 or 2k ohm but I've had no problems so far.
On the right is the power input and conditioning. The Caps are probably not needed but I always add them. The power comes from an old mobile phone charger mounted into the unit.
At the bottom of the Schematic is the sensor circuit. This shows the voltage divider to move the voltage swing into the positive range. I've put a small resistor in series with the analog input but as mentioned earlier in this instructable the addition of a 5.1V Zener would probably be better to prevent the Analog Input of the Arduino being damaged. I've had no problems thus far.
Arduino Pin Connections:
- Green LED --> Pin 7
- Red LED --> Pin 8
- Piezo Beeper --> Pin 6
- Sensor Pin --> A3
- Cancel Button --> Pin 3 (on Interrupt)
Step 7: Enclosure
I used an old timer switch, and removed the clock mechanism. They’re quite cheap and have sufficient space and all the AC connections you need. I also 3D printed the face place to fit in where the clock face was.
I've included the 3D Print files here, but you could use anything suitable really.
Step 8: Dismantling the Timer Unit
There are screws in the back of the timer. These are likely to be “safety” screws with triangular or star shaped slots. (It’s always handy to have a safety screw kit around for this.) Unscrew them and then along the top edge of the timer there are 2 hidden plastic clips. Press a small screw driver into the groove on the left and the right. You should be able to depress the inner wall of the timer unit and pry the lid off. From here you can remove the timer clock. Take photos during the process in case something useful gets displaced.
The live side of the AC goes to the timer clock unit and you will need to feed these wires via the Current Transformer on our circuit board. You may need to do some adjustments and soldering for this. Leave everything else as is.
Step 9: Construction
The picture above shows the completed wiring. I mounted the PC Boards into the case using hot glue.
Shown in the picture:
- The mobile phone charger at the top - just break it out of the original case. This is connected across the AC power. (Brown and Blue wires).
- Our control board is in the middle with the Current Transformer and the Arduino Pro Mini
- On the middle left is the small neon AC power indicator light which comes on when there is AC power. Leave this bulb in place.
The brown wires on the right go in series via the Current Transformer on the circuit board. Make sure that the copper tracks for the Current Transformer on your PCB and the soldering is quite thick to handle a potentially heavy AC current (10 to 15 amps). The AC wires are connected to the thick wires on the Current Transformer. The other side of the transformer has 3 pins and these are on the low voltage side and interface with Arduino.
For the Arduino power supply you will also need to tap some AC power. Unlike the Current Transformer, this time, you DO connect the power supply wires across the AC. ie: One to the Blue wire and one to the Brown.
Other countries will have different standards so just use your own discretion here.
For the Arduino Pro Mini:
If you're not supplying a regulated 5V then your power supply should be connected to the "RAW" pin of the Arduino and not Vcc.
I prefer mounting male header pins to the Arduino (2 x 12) and then plugging this into female headers on the PCB this makes it removable.
You don't need to add pins to the small side of the Pro Mini for the Serial Programmer. With most programmers you can just hold the programmer in the holes whilst you upload your code.
NB: we are dealing with live AC current here so be careful.
NB: Make sure that you do not connect the Current Transformer across the AC power because you will get an explosion. Only connect the Current Transformer in series with the load as you would with an Ammeter. Ie: the live wire goes in one end of the Current Transformer and it comes out the other end to continue on to the Appliance.
Make sure that the tracks and the soldering on the AC side are very thick. They’ll need to carry a load of at least 10 amps. This Current Transformer looks like it will easily handle 15A.
Step 10: The Front Cover
I 3D printed the front cover plate.
It just clips into the timer unit and has holes for the LED’s, buzzer and Cancel button.
You could do this in other ways too.
The STL file is included, and I’ve included the openSCAD file in case you want to customise it.
I adjusted the holes so that the components could squeeze in without glue being needed.
I did add some hot glue afterwards though, just in case.
You could be creative and add a "smiley" kind of arrangement.
Go wild with your design and let me know how it goes. :-)
Step 11: The Arduino Code
The code is attached here.
It should be self explanatory but if needed I'll add some more information here.
Upload it to the Arduino using a Serial Programmer. You can upload the code to the Arduino whilst it's mounted on the PCB or for the first time round I prefer to upload the code to the Arduino before it's included in the circuit. This is just in case there's some old code running on it that may produce unpredictable results. It's good practice to actually upload a blank sketch before you start.
The code reads the voltage from the Current Transformer on the Arduino Analog port. When the appliance is switched off, this should hover at 2.5V. Remember the DC Bias we added with the voltage divider? This should move the AC voltage swing from -2.5 to 2.5 to between 0 and 5V.
If we see a significant variation around the 2.5V level then we know the appliance is on. You can fine tune this to your requirements. ie: to get the right trigger points depending on how much current your appliance draws when it's switched on versus how much current it draws whilst in "standby" mode or off.
Step 12: User Interface & Operation
- If you’re using an old timer switch that comes with a neon AC indicator bulb then this should glow when the unit is plugged in and the AC is on. (middle left).
- Near the top of the black fascia panel are the LEDs. The Red one on the left will light up when the appliance has been switched on. The Green one (on the right) will come on when the appliance is turned off. The Green indicates that the unit is in “reminder beep” mode. This green LED will go out when either the Green cancel button (lower right) is pressed or the reminder beeps have finished.
- If the appliance is switched on again in the middle of the "reminder" phase. The unit will resume normal operation. ie: It will wait until the next "off" event and then start the reminders all over again. Unless you've cancelled them with the Green button.
- On the lower left of the black panel is a small hole. This is the Piezo buzzer.
- Reminder beeps can be cancelled at the outset if you press the Green button after turning the appliance on. You should hear a small beep, when pressing the button, as a confirmation. In this mode, when the appliance switches off, the buzzer will not sound. This is in case you want to do a piece of toast VERY early in the morning and you don't want to get into trouble by making a noise!
- When the unit itself is first powered up it will do a quick system check by flashing both LED’s and sounding the buzzer. If this doesn’t happen then something is amiss.
Step 13: Some Notes on the PCB
I don't have nifty PCB tools and generally do them by hand. I've done some basic designs above as a guide but I haven't tested these at all. Maybe someone out there can provide some good PCB files for this?
The black and white image could be used with the Laser Printer Toner Transfer method. There are plenty of How To videos out there.
Your Current Transformer may have different Pin placements so check these out first.
Remember to keep the tracks on the Primary Coil side and the soldering thick to carry maximum current.