I have recently set out to work on my next project; this time it is based on the popular Arduino Uno microcontroller. The life of my son, who is 3 years old, revolves around fire trucks, sirens and flashing lights. So, I figured that I'd build the ultimate light-and-siren assembly.
My vision is to build a box that has a bunch of colored LEDs to emulate the light bar of an emergency vehicle, and a little speaker in the box that can be used as a siren. The heart of the assembly will be an Atmel ATMega 328p microcontroller.
As far as control goes, I'm looking for a few switches and push buttons:
1. A master on/off switch to cut power to the microcontroller
2. A toggle switch to determine if the LEDs are on
3. A momentary push switch to operate an "air horn"
4. A momentary push switch to operate the siren
5. A momentary push switch to change the pattern in which the LEDs flash
6. A momentary push switch to change the pattern of the siren
I also want to have a parental control that I can use to turn the siren assembly completely on or off, regardless of what buttons are pushed. Most likely, that's going to be done via pushing a secret combination of buttons at start-up. Note that I'm using the momentary push button to turn the siren on, rather than a toggle switch.
Once the box has been prototyped, I'll move to a more permanent board; although the Uno's are cheap enough, I'd rather spend $3 on a replacement microcontroller than $20 to replace the Arduino. That will require a few extra components, but nothing fancy. The final project will be powered by a 9V block battery.
The first order of business will be to bread-board the hardware components. It should be fairly straightforward: each LED will have a resistor to limit the current to 20mA (the 328 is rated at 35 mA, so 20mA seems fair); the siren is going to be a 0.25 W speaker with an impedance of 25 Ohm that was salvaged from an old speaker phone. The push buttons will have a 10k resistor to pull them to ground when open.
The second order of business will be the software; I would like this thing to be extensible and usable by others, so decent code is going to be a requirement.
No comments:
Post a Comment