3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Arduino Kitchen Timer

Step 3Code It! (Or use mine)

Code It! (Or use mine)
To run the Kitchen Timer you will need to feed your Arduino some nice tasty code. I have written a rather simple (but scary looking) code that can drive it all, and for those who are happy enough making it work but not understanding it you can download it now. If I remember correctly Instructables does something weird with .PDE files, so you can also download it from somewhere if you feel so inclined.

Explaining it gets a little complicated, so I will give you a brief overview, and the rest is pretty self explanatory:
First we initialise all of the pins and features that we are going to use, to make sure that our Arduino is going to be working with them. We use the const int to indicate that the Pin that we have initialised is constant and will not change. Variables can also be initialised, but are generally not constant as they are set throughout the script. We then check to see if the button (connected to Pin 2) has been depressed or not, and if it is it lights up the next segment and adds one to out 'tastyTimeVariable'. This means that we can then use an 'if' function to state the length of the required timing depending on the value of our tastyTimeVariable. You will see that we delay for "300L * 1000L" which equates to about 5 mins, as 300,000 milliseconds = 300 seconds, and 300/60 = 5, so quite accurately 5 mins. We then tell the Arduino that if the tastyTimeVariable is equal to anything other than 0 (in other words the button was pressed, and something has been timed) to play a graphical display, and buzz the buzzer. We can vary the length of the alarm by changing the for command.

I hope this has made some sense, I have also written comments into the script to help those trying to understand how it works, and modify it for their needs.

-------------------------------- UPDATE ------------------------------

Hello, I quote a message sent to me by arduino-mega.

arduino-mega says:
I have had a go at rewriting the code for the kitchen timer as it was very long. The code i have written does the same thing but is just a fraction of the size of the original. Hope you don't mind. Here is a link to it.



This is a fantastic piece of code with some extra bits added on, so please give it a go, the installation process is the same.
Thank you very much to arduino-mega for this brilliant contribution!
« Previous StepDownload PDFView All StepsNext Step »
2 comments
Nov 3, 2011. 1:53 PMpkasavan says:
Hi anonymouse197,

Thanks for your instructable. Unfortunately, I can't seem to download the Arduino sketch. It says Kitchen_Timer.pde on here, but when I download it, it is converted to .tmp with a garbage filename. Do you know of a way to convert back to .pde or do you have an alternate way which I could download the sketch? Mediafire is saying that the file is no longer available.

Thanks!
Nov 3, 2011. 3:59 PMpkasavan says:
Thanks for your response!

I tried your method for changing the file type, and unfortunately it didn't work. That method has worked in other instances, though, so I never know when it will work and when it won't.

What I ended up doing was opening the .tmp file in Microsoft Word. The formatting looked a little strange, but when I copied it into the Arduino app, everything was in order.

The sketch seems to work pretty well! My only complaint is that sometimes a light other than the first one will light up when setting the timer, leaving the first few off. This restricts the full amount of time which can be set, because it will only add time until the last light is lit. A simple reset fixes this, though.

Thanks again!
Nov 5, 2011. 2:35 PMpkasavan says:
Thanks for going to all that trouble!

The download worked fine, but I still found that the first light to go on was not always the first light in the display. I made some modifications to your code here, and they seem to work. Feel free to post the modified version on here if you like the changes I've made. Anything of yours that I changed, I simply commented out, and I also made comments explaining what I had done. Let me know if you have any questions about my changes.

Also, I changed the time increment to 3 seconds rather than 5 minutes for testing purposes. I hope this isn't too much of an inconvenience!

Thanks for giving me a good place to start with your code!

- pkasavan

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
1
Followers
3
Author:anonymouse197
Arduino, Literature, Music, and most of all The Outdoors!