EE-121_Basic_Electronics_Lab_Project
EE-121_Basic_Electronics_Lab_Project
Solution
Problem Statement
Design an add-on device for the workbench power supply that:
1. Sounds a buzzer every hour to remind users of the power-on status of connected devices.
2. Includes an LED that provides light during power failure.
Components Required
- Microcontroller (e.g., Arduino Uno)
- Buzzer
- LED
- Diode (1N4007)
1. **Buzzer Circuit:**
- Connect the buzzer's positive terminal to the collector of the transistor.
- Connect the emitter of the transistor to ground.
- Connect the base of the transistor to a 1kΩ resistor, and the other end of the resistor to a
digital pin (e.g., D9) on the Arduino.
- Place a diode (1N4007) across the buzzer terminals for protection.
2. **LED Circuit:**
- Connect the anode of the LED to a 220Ω resistor.
- Connect the other end of the resistor to the collector of another transistor.
- Connect the emitter of the transistor to ground.
- Connect the base of the transistor to a 1kΩ resistor, and the other end of the resistor to a
digital pin (e.g., D10) on the Arduino.
3. **Power Failure Detection:**
- Use a voltage sensor connected to an analog pin (e.g., A0) on the Arduino.
Arduino Code
```cpp
const int buzzerPin = 9; // Buzzer connected to digital pin 9
const int ledPin = 10; // LED connected to digital pin 10
const int powerSensorPin = A0; // Analog pin to sense power failure
void setup() {
pinMode(buzzerPin, OUTPUT);
pinMode(ledPin, OUTPUT);
pinMode(powerSensorPin, INPUT);
}
void loop() {
// Check for power failure
int powerStatus = analogRead(powerSensorPin);
if (powerStatus < 500) { // Assuming 500 is the threshold for power failure
digitalWrite(ledPin, HIGH); // Turn on LED
} else {
digitalWrite(ledPin, LOW); // Turn off LED
}
Conclusion
This solution meets all the requirements of the assignment. The buzzer reminds users of the
power-on status, and the LED provides light during power failures. The system is designed
using basic electronic components and can be easily implemented with a microcontroller.