Quick Navigation All projects Hardware Links Top projects Alan numitron clock Clapclap 2313/1386 SNES Pi Webserver USB Volume/USB toys Smokey amp Laser cutter WordClock ardReveil v3 SNES Arcade cabinet Game boy projects cameleon Home Presence Detector GitHub AlanFromJapan Contact me Who's Alan? Akizukidenshi Elec-lab Rand Nerd Tut EEVblog SpritesMods AvrFreaks Gameboy Dev FLOZz' blog Switch-science Sparkfun Suzusho Datasheet Lib Reddit Elec Ermicro Carnet du maker (fr) |
KitchenTimerLast update: Tue Nov 28 13:28:49 2023
GoalGoal is to replace this Ikea super cheap timer that works ... well, as good as something manual that you paied less than 200 JPY (less than 2 euro). Not precise, sometimes doesn't ring, or ring just the blink of an eye, so easy to miss... The new timer will:
Hall of fame:
FeaturesPlateform and boardFollowing the saying of "eat your own cuisine", I'll use my Rapide328 board since it's sufficient for what we want to do here (throwing in a 16Mhz crystal, it's an arduino clone minus USB). I'll be using the Arduino libs, meaning compile with Arduino IDE and then upload the produced .hex to the board via a programmer. Therefore the code is 100% compliant with an Arduino and you could reuse it with the Arduino effort with 0 development.Great (temporary) deception however: the Rapide328 works very fine but once the graphic LCD plugged on, since it uses the MOSI wire, I can't upload via the ISP anymore!! I have to move the uC between an Arduino and the board to test ... Solution : change the default wiring and reposition wires where it's more convenient! Just change the ks0108_Arduino.h file and move that wire to some other pin! Auto on-offTwo ways were possible, I picked the easy :
Links
Graphical LCDUse that big graphic LCD bought the other day and sitting alone and forgotten.Use that library that works just fine (great job and many thanks to the author) http://www.arduino.cc/playground/Code/GLCDks0108 My concern is now that I have 7 pins left ... quite short. Rewriting part of the above library to use a SIPO is not something I dream of neither so I'll go with that constraint since I can live with it. For the record, I just amended a bit the suggested wiring : my C1/C2 pin are inverted (my mistake I think, I never had the will to check, just inverted the pins in the .h file) and I moved the pin that was going to the Atmega MOSI pin somewhere else (I'm using ISP programmer, it didn't work with that pin used by the GLCD). Light every minute tick, shows remaining time. SoundWhat I wanted to doUse a YMZ294 'cause I have some of them left. Will require a SIPO chip since I won't have enough I/O pins available with the LCD and the YMZ294 and the on-off and the bling bling ...Music would be nintendo classics or classical music ? Did that in the past, should be able to make it work again. Speaker must be small, so maybe reuse that cell-phone scavenged speaker? Or that flat profile speaker bought the other day? What I will doI don't have many pins left, so instead of sound and poor led I'll with poor sound (buzzer/uC Driver speaker ?) and led. But in fact I found in the pile of stuffs I have one of those key chains playing supermario sounds that you buy in distributor machine for 200 JPY. This one was of no great value to me but was quite loud : I opened it, soldered 2 wires on the button pad, added an optocoupler between that and the arduino, et voila !
InputWell you have to say how long you want it to wait, haven't you? I imagine now the following inputs:
I used the All buttons on one pin technique that I've not yet used. Looks good since I still have one Analog pin left and I don't see other usage for that pin.
Bling blingIn addition to sound, added 2 transistor driving each one 2 leds to blink with the music.PowerMust : have sufficient power (duh!), match the usage (used not often but when used it's continuously for 30 avg?), keep small volume and keep it light. My choice is a square 9v battery (smaller) and a LM7805. Maybe not the best choice, but it works. Other option could have been those cheap 5v USB charger that work with 2 AA battery : costs 100 jpy, but is it better?
CodeThe sourceAs usual, everything is on Google code : http://code.google.com/p/alanarduinotools/source/browse/#svn%2Ftrunk%2FKitchenTimerSet the fusesWe're using a atmega328 in same config as an arduino, sot set the fuses to use the 16 MHz crystal.For the record: the glcd worked also with the internal 8MHz oscillator (with default division of 8) meaning 1 MHz although compiled for a 16MHz pace. It was just slower. 16x times slower. But worked. avrdude -v -v -p m328p -c avrispv2 -P COM1 -U lfuse:w:0xf7:m -U hfuse:w:0xd9:m -U efuse:w:0xff:m
Upload the binaryI use the pololu programmer so I type something like this :avrdude -c avrispv2 -p m328p -P COM1 -U flash:w:C:\Users\Alan\AppData\Local\Temp\build66073673223083421.tmp\KitchenTimer.cpp.hex:i
Point of interrest
Pictures
|
||||
All content on this site is shared under the MIT licence (do what u want, don't sue me, hat tip appreciated) electrogeek.tokyo ~ Formerly known as Kalshagar.wikispaces.com and electrogeek.cc (AlanFromJapan [2009 - 2024]) |