An AC Dimmer Lamp Module is an electronic device designed to adjust the brightness of an incandescent lamp. It works by varying the voltage supplied to the lamp, which in turn dims or brightens the light output. This module is commonly used in residential and commercial lighting systems to create ambient lighting and reduce energy consumption.
Pin Number | Description | Notes |
---|---|---|
1 | AC Input (Live) | Connect to live wire of AC mains |
2 | AC Input (Neutral) | Connect to neutral wire of AC mains |
3 | Control Input | Connect to PWM output from microcontroller |
4 | Ground (for Control Input) | Connect to microcontroller ground |
// Example code to control an AC Dimmer Lamp Module with an Arduino UNO
#include <TimerOne.h> // Include TimerOne library for precise timing
// Define the control pin
const int dimmerPin = 9; // Connect to the control input of the dimmer module
// Define the brightness level (0-100%)
int brightness = 50; // Set initial brightness to 50%
// Interrupt service routine to set the dimming level
void setDimming() {
int dimtime = (75 * brightness); // Calculate dim time based on brightness
delayMicroseconds(dimtime); // Wait for the appropriate dim time
digitalWrite(dimmerPin, HIGH); // Turn on the lamp
delayMicroseconds(10); // Short delay to ensure the TRIAC latches
digitalWrite(dimmerPin, LOW); // Turn off the lamp
}
void setup() {
pinMode(dimmerPin, OUTPUT); // Set the dimmer pin as an output
Timer1.initialize(10000); // Initialize Timer1 to run every 10ms
Timer1.attachInterrupt(setDimming); // Attach the interrupt service routine
}
void loop() {
// The main loop can be used to change the brightness over time or in response to sensors or inputs
}
Q: Can I use the AC Dimmer Lamp Module with LED bulbs? A: Most AC dimmer modules are designed for incandescent lamps and may not work correctly with LEDs unless they are specifically labeled as dimmable LEDs.
Q: Is it safe to handle the AC Dimmer Lamp Module while powered? A: No, always turn off the mains power before handling the module to avoid the risk of electric shock.
Q: How can I increase the dimming resolution? A: Use a microcontroller with a higher PWM resolution or implement a zero-crossing detection circuit for finer control over the dimming level.