Arduino Power Outage Alarm

Job ID: 40022806

Budget: $30 – $250 CAD

I need a complete design for a small, Arduino-Uno–based power-outage alarm that fits the following brief:

– The system runs from a 12 V DC wall supply during normal operation.
– An LED must stay lit to show power is present; it goes dark the instant the 12 V disappears.
– Loss of power starts a countdown governed by a two-position, manual toggle switch:
• Position 1 → alarm beeps after 1 hour
• Position 2 → alarm beeps after 2 hours
– When the timer expires, the alarm sounds with a clear, pulsing beeping pattern for 30 seconds, running from an alkaline backup pack (roughly six C-cells).
– If mains power returns at any moment, the countdown and any active alarm stop immediately and the unit resets.

I am looking for:

1. An Arduino sketch that handles power-loss detection, timing, beeping pattern, switch reading, reset logic, and low-battery lockout (if practical).
2. A clean wiring diagram or schematic showing the Uno, LED indicator, manual delay switch, battery pack hookup (with safe reverse-polarity protection/diode isolation), piezo driver or small speaker circuit, and the 12 V input.
3. A concise bill of materials with part numbers that are easy to source online.
4. Assembly notes good enough for someone with basic soldering skills to follow—no PCB is mandatory, but if you can suggest a simple strip-board layout that’s a plus.

Please keep the code well-commented and avoid exotic libraries; standard Arduino IDE core functions are preferred. Once delivered, I’ll flash the sketch, build the circuit, and confirm the behaviour matches the above timing and reset requirements.