STEP 1 / 6ELECTRONICS

Sunset Lamp

Automatic lights that use LDR technology flicker because of the shift in light intensity that occurs between dawn and dusk. Therefore, compact fluorescent lamps, often known as CFLs, shou…

Sunset Lamp - source illustration from page 159
PROJECT#082
TRACKElectronics
PARTS07
STAGES06
STEP 1 / 6 · Overview

Know the mission before touching a wire.

Understand what you are making, prepare the right tools, and make the workbench safe.

01

Project details

Sunset Lamp is a electronics project. Automatic lights that use LDR technology flicker because of the shift in light intensity that occurs between dawn and dusk. Therefore, compact fluorescent lamps, often known as CFLs, shou…

Source pages
159-161
Named parts
7
Build goal
Working, tested prototype
02

Tools you need

  • Digital multimeter
  • Wire stripper and side cutters
  • Soldering iron with a fine tip
  • Current-limited bench supply

Use eye protection, good lighting, and a clean insulated surface throughout the build.

03

Safety precautions

  • Disconnect every power source before changing a connection.
  • Check component polarity, pinout, and supply voltage twice.
  • Use a current limit for the first power-up.
  • This project may involve hazardous voltage. Work only with qualified supervision and proper isolation.
Ready to continue?
STEP 2 / 6 · Parts library

Gather, identify, and understand every part.

Use the standardized inventory, then open What's this? to learn each part's role, advantages, limitations, handling, and specifications.

NAMED PROJECT INVENTORY7 PART LINES
PARTTYPEQTYREADY
MLDRMODULE1
What's this?Image, role, pros, cons, handling & specifications
Light sensor moduleMODULE LEARNING VIEW

LDR

A sensor converts a physical condition into an electrical signal the circuit can measure.

What it does here

It provides project input as an analogue, digital, resistive, frequency, or calibrated signal.

Buy / compare this part

Advantages

  • Adds real-world awareness
  • Can usually be tested independently
  • Often supports calibration

Limitations

  • Readings can drift
  • Placement affects results
  • Some sensors need warm-up or calibration

Handling

  • Protect the sensing surface
  • Observe supply voltage and polarity
  • Keep signal leads away from noisy power wiring

Specifications to verify

  • Use the exact model, value, package, and rating listed for LDR; similar-looking parts are not always interchangeable.
  • Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
PPower supplyPOWER1
What's this?Image, role, pros, cons, handling & specifications
Sunset Lamp - source illustration from page 159POWER LEARNING VIEW

Power supply

A power component supplies, converts, stores, or regulates energy for the project.

What it does here

It must provide the documented voltage, polarity, isolation, and sufficient current safely.

Buy / compare this part

Advantages

  • Stable power improves reliability
  • Current limiting protects first tests
  • Regulation reduces resets and noise

Limitations

  • Wrong polarity can cause immediate damage
  • Underrated parts overheat
  • Mains circuits require qualified supervision

Handling

  • Measure output before connection
  • Use a fuse or current limit
  • Insulate exposed conductors

Specifications to verify

  • Use the exact model, value, package, and rating listed for Power supply; similar-looking parts are not always interchangeable.
  • Confirm input/output voltage, current, polarity, connector, isolation, and thermal rating.
SNE555SEMICONDUCTOR1
What's this?Image, role, pros, cons, handling & specifications
NE555 timerSEMICONDUCTOR LEARNING VIEW

NE555

A semiconductor stage performs switching, amplification, regulation, rectification, or logic.

What it does here

It controls current or signal flow at a defined point in the circuit.

Buy / compare this part

Advantages

  • Fast and efficient
  • Compact
  • Can control larger loads from smaller signals

Limitations

  • Pin order varies
  • Sensitive to overvoltage and reverse polarity
  • May need cooling or bias components

Handling

  • Verify the datasheet pinout
  • Avoid static and soldering heat
  • Check notch, stripe, or flat-face orientation

Specifications to verify

  • Use the exact model, value, package, and rating listed for NE555; similar-looking parts are not always interchangeable.
  • Confirm pinout, maximum voltage/current, dissipation, gain or forward voltage, and package.
PNEUTRALPART1
What's this?Image, role, pros, cons, handling & specifications
Sunset Lamp - source illustration from page 159PART LEARNING VIEW

NEUTRAL

A named project component whose exact role is defined by the source circuit and build guide.

What it does here

It performs a documented electrical, control, interface, or construction function in this project.

Buy / compare this part

Advantages

  • Selected for this project
  • Can be checked independently
  • Supports modular troubleshooting

Limitations

  • Substitutes may differ
  • Generic names can hide variants
  • Pinouts and ratings vary

Handling

  • Compare the received part with the source
  • Keep it labelled
  • Do not force connectors or adjusters

Specifications to verify

  • Use the exact model, value, package, and rating listed for NEUTRAL; similar-looking parts are not always interchangeable.
  • Confirm dimensions, ratings, connection method, polarity, and environmental limits.
SBT136 - specified partSEMICONDUCTOR1
What's this?Image, role, pros, cons, handling & specifications
BT136-600E mains TRIACSEMICONDUCTOR LEARNING VIEW

BT136 - specified part

A semiconductor stage performs switching, amplification, regulation, rectification, or logic.

What it does here

It controls current or signal flow at a defined point in the circuit.

Buy / compare this part

Advantages

  • Fast and efficient
  • Compact
  • Can control larger loads from smaller signals

Limitations

  • Pin order varies
  • Sensitive to overvoltage and reverse polarity
  • May need cooling or bias components

Handling

  • Verify the datasheet pinout
  • Avoid static and soldering heat
  • Check notch, stripe, or flat-face orientation

Specifications to verify

  • Use the exact model, value, package, and rating listed for BT136 - specified part; similar-looking parts are not always interchangeable.
  • Confirm pinout, maximum voltage/current, dissipation, gain or forward voltage, and package.
PLED1 - indicator LED identified in the circuitPART1
What's this?Image, role, pros, cons, handling & specifications
Sunset Lamp - source illustration from page 159PART LEARNING VIEW

LED1 - indicator LED identified in the circuit

An output component turns an electrical control signal into light, sound, motion, switching, or displayed information.

What it does here

It presents the circuit result or acts on the physical world.

Buy / compare this part

Advantages

  • Makes system state visible
  • Can be tested separately
  • Supports clear troubleshooting

Limitations

  • Loads may exceed controller current
  • Polarity or driver direction can matter
  • Inductive loads create voltage spikes

Handling

  • Use the documented driver stage
  • Check polarity and load current
  • Add flyback protection for inductive loads

Specifications to verify

  • Use the exact model, value, package, and rating listed for LED1 - indicator LED identified in the circuit; similar-looking parts are not always interchangeable.
  • Confirm voltage, current, polarity, interface, driver requirements, and duty cycle.
PVR1 - preset potentiometer identified in the circuitPART1
What's this?Image, role, pros, cons, handling & specifications
10kΩ preset potentiometerPART LEARNING VIEW

VR1 - preset potentiometer identified in the circuit

A named project component whose exact role is defined by the source circuit and build guide.

What it does here

It performs a documented electrical, control, interface, or construction function in this project.

Buy / compare this part

Advantages

  • Selected for this project
  • Can be checked independently
  • Supports modular troubleshooting

Limitations

  • Substitutes may differ
  • Generic names can hide variants
  • Pinouts and ratings vary

Handling

  • Compare the received part with the source
  • Keep it labelled
  • Do not force connectors or adjusters

Specifications to verify

  • Use the exact model, value, package, and rating listed for VR1 - preset potentiometer identified in the circuit; similar-looking parts are not always interchangeable.
  • Confirm dimensions, ratings, connection method, polarity, and environmental limits.
Ready to continue?
STEP 4 / 6 · Source code

Confirm the hardware-only control path.

This project does not include firmware in the source. The circuit itself provides the required behaviour.

01

How to connect

  1. Match every controller label to the circuit view and source pin map.
  2. Join grounds before signal wires when separate low-voltage supplies are used.
  3. Keep motors, relays, pumps, and other loads on a suitable driver and external supply.

Common mistakes

Reversed VCC/GND, board-label versus GPIO-number confusion, missing common ground, and charge-only USB cables.

Troubleshoot

Disconnect loads, continuity-test one path at a time, then test with a current limit.

02

Software preparation

No IDE, board package, library, or firmware upload is required for this project.

If you add a programmable controller as an extension, document its pin map separately.

03

How to upload code

The original design is implemented entirely in hardware, so proceed after verifying the circuit and supply.

Ready to continue?
STEP 5 / 6 · Build

Assemble, deploy, test, and troubleshoot.

Use the complete source notes in build order, then pass the final checks before calling the project finished.

ASSEMBLY

Build in functional stages

  • Power and regulation
  • Controller or processing stage
  • Inputs and sensors
  • Outputs and loads
  • Enclosure and strain relief
TEST

Power up safely

  • Inspect unpowered continuity first
  • Apply the lowest safe current limit
  • Measure supply rails before signals
  • Add one load at a time
  • Record expected and actual results
TROUBLESHOOT

Work from simple to complex

  • Confirm power, ground, polarity, and orientation
  • Compare each pin with the source
  • Test inputs separately from outputs
  • Replace only one variable at a time
  • Power off before every correction
PROJECT-SPECIFIC BUILD NOTES

Follow the documented instructions.

These notes come from this project's source and remain in their original order.

01

Project overview

Project build note

Automatic lights that use LDR technology flicker because of the shift in light intensity that occurs between dawn and dusk. Therefore, compact fluorescent lamps, often known as CFLs, should not be used in such circuits since the flickering light could potentially damage the electronic circuits included within the lamps. The sunset lamp circuit that is described in this article has the ability to solve the problem and promptly turn on the lamp when the light intensity drops below a predetermined threshold. Sunset Lamp circuit description The bistable action is provided by a popular timer IC called NE555 (IC1), which is used in this sunset lamp circuit as a Schmitt trigger. In order to achieve the immediate action, the set and reset operations of the comparators contained within the NE555 are utilized. The upper threshold comparator of IC1 trips when Vcc is 2/3 of its full value, whereas the lower trigger comparator trips when Vcc is 1/3 of its full value. The inputs of the threshold comparator and the trigger comparator of the NE555 are coupled together, and they are connected to the voltage divider that is produced by the LDR1

and the VR1 components. The voltage that is measured across LDR1 is influenced by the amount of light that is present. When the sun is shining, LDR1 has a low resistance, which causes the input voltage to the threshold comparator to rise above 2/3Vcc. As a result, the threshold comparators output drops to zero, which in turn resets the flip-flop that is included within IC1. However, the input to the trigger comparator is still greater than 1/3Vcc, which maintains the low state of the output pin 3 of IC1. Because there is not enough current for it to be fired, the triac BT136 that is connected to the output pin 3 of IC1 stays in its quiescent state. As a result, lamp L1 is in the "off" position during the day. Circuit operation When the sun goes down, the resistance of LDR1 goes up, and the voltage at the input of the threshold comparator drops to less than 2/3Vcc. Meanwhile, the voltage at the input of the trigger comparator drops to less than 1/3Vcc. As a direct consequence of this, the outputs of both the threshold and trigger comparators will become high, which will cause the flip-flop to become set. This causes the output pin 3 of IC1 to transition from being low to being high. Triac1 is able to conduct electricity after receiving the required gate current from resistor R2. As a result, it finishes off the power supply to the bulb by way of the Triac1. When IC1 is in a state of high output, LED1 will light up to show this. The power supply for the circuit is drawn directly from the mains through capacitor C4, which connects to the circuit. This capacitor is responsible for supplying the circuit with current. The alternating current (AC) that is supplied by capacitor C4 is rectified by diodes D1 and D2, while capacitor C3 provides the necessary smoothing. Zener diode ZD1 supplies the circuit with 15V DC that has been rectified. When the plug is removed from the circuit, the bleeder resistor R4 discharges the capacitor, releasing the voltage it had held. Construct the circuit on any type of multipurpose printed circuit board and encase it in a plug-in adaptor style box. Establish a connection between the adaptor box's pins and the live and neutral terminals. Make sure the box has holes measuring 5 millimeters for the LDR1 and the LED1. Install the plug for the device in a location where there is

sufficient daylight to prevent the circuit from functioning during the day. During the night, the light from the lamp must not shine upon LDR1. Caution is advised because this circuit has 230V AC running through it, and the majority of its points are at mains fatal potential. Therefore, do not touch any point in the circuit while it is powered, and only use a screwdriver made of plastic or insulation to make adjustments to the preset.

Ready to continue?
PROJECT ACHIEVED

You built Sunset Lamp.

You followed the full workflow from understanding the mission to testing the finished project. That is a real engineering achievement - well done.

Electronic Dice project thumbnail featuring NE555
NEXT ELECTRONICS ADVENTURE

Electronic Dice

Ready to reuse what you learned in another project from the same track?

Start this project
Browse all 500 projects