Skip to content

Description of LED / timer solution

A while ago I created a solution for my home to activate a LED light on the outside. The light will turn off when no movement has been detected during 2 minutes.

As I made this before the FabAcademy started I have asked chatGPT to summarize our conversations sofar.

โœ… What You Built

You now have:

  • Manual start lighting system
  • Motion-extended runtime
  • Minimum on-time protection
  • Electrical isolation between sensor and microcontroller
  • Proper relay coil protection
  • Fused low-voltage side
  • DIN-rail professional mounting

๐Ÿงพ Bill of Materials (BOM)

1๏ธโƒฃ Control & Logic

Qty Component Notes
1 Arduino Nano (5V version) Main controller
1 PC817 optocoupler (DIP-4) Isolates PIR26 from Arduino
1 BC547 transistor Drives Finder relay coil
1 1 kฮฉ resistor Base resistor for BC547
1 1 kฮฉ resistor Current limiting resistor for PC817 LED side
1 1N4007 diode Flyback diode over Finder relay coil
1 (optional) 10 kฮฉ resistor Base pull-down for BC547 (recommended)

2๏ธโƒฃ Power Supply Section

Qty Component Notes
1 ORNO DIN-rail 230V โ†’ 12V DC power supply Main low-voltage supply
1 GYVRM DC-DC converter 12V โ†’ 5V Powers Arduino
1 T1A 250V slow-blow fuse 12V line protection
1 (optional) T2A 250V slow-blow fuse 230V lamp protection

3๏ธโƒฃ Switching Section (Mains Side)

Qty Component Notes
1 Finder 46.61.9.012.0040 relay 12V DC coil, 230V contact
1 Finder DIN-rail relay socket (97.xx series) Mounting base for 46.61
โ€” 230V LED outdoor lamp Existing or new
โ€” Terminal blocks (DIN rail) For L/N/PE distribution

4๏ธโƒฃ Sensors & Inputs

Qty Component Notes
1 STBTech PIR26 motion sensor 12V powered, LED switching output
2 Momentary push buttons (NO) Indoor & outdoor
โ€” Low-voltage wiring For buttons and PIR

5๏ธโƒฃ Mechanical & Mounting

Qty Component Notes
1 IP65 enclosure (Stegen) Main control box
1 DIN rail (35 mm) Inside enclosure
1 Small perfboard (prototype board) For PC817 + BC547 circuit
1 DIN rail PCB mounting clip Mount perfboard neatly
Several WAGO connectors / terminal blocks Wiring distribution
Several Cable glands (IP68)** Cable entry

6๏ธโƒฃ Wiring

Use Type
230V internal wiring 1.5 mmยฒ solid or stranded
12V wiring 0.75 mmยฒ
Signal wiring 0.25โ€“0.5 mmยฒ
Earth wiring Green/yellow

๐Ÿ”Œ System Architecture Summary

230V Side

  • 230V โ†’ ORNO PSU
  • 230V โ†’ Finder relay COM โ†’ NO โ†’ Lamp

12V Side

  • ORNO 12V โ†’ fuse โ†’ Finder coil + GYVRM + PIR26

5V Side

  • GYVRM โ†’ Arduino 5V

Signal Isolation

  • PIR26 LED output โ†’ 1k resistor โ†’ PC817
  • PC817 transistor โ†’ Arduino D4

Relay Drive

  • Arduino D8 โ†’ 1k โ†’ BC547 โ†’ Finder coil

โšก Electrical Ratings Summary

Section Voltage
Mains side 230V AC
Relay coil 12V DC
Arduino 5V DC
PIR26 12V DC

Absolutely โ€” here is a clean, structured schematic diagram of your complete system.

Iโ€™ve separated it into logical blocks so it is readable and suitable for documentation.


๐Ÿ“ COMPLETE SCHEMATIC DIAGRAM


๐Ÿ”ด 1) 230V MAINS SECTION

              230V AC INPUT
              โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

   L (Brown) โ”€โ”€ Fuse T2A โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ORNO L
                                        โ”‚
                                        โ”‚
                                   Finder Relay
                                   COM โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                             โ”‚
                                   NO  โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€ Lamp L

   N (Blue) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ORNO N
                                              โ”‚
                                              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Lamp N

   PE (Earth) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Lamp PE

Only the phase (L) is switched by the Finder relay.


๐ŸŸก 2) 12V POWER DISTRIBUTION

                ORNO 12V OUTPUT
                โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

         +12V โ”€โ”€ Fuse T1A โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€ Finder Coil A1
                                          โ”‚
                                          โ”œโ”€โ”€โ”€โ”€ GYVRM IN+
                                          โ”‚
                                          โ””โ”€โ”€โ”€โ”€ PIR26 Vin+

         0V  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€ GYVRM IN-
                                          โ”œโ”€โ”€โ”€โ”€ PIR26 Vin-
                                          โ””โ”€โ”€โ”€โ”€ System GND (common)

All low-voltage grounds are common.


๐ŸŸข 3) 12V โ†’ 5V CONVERSION

                 GYVRM
            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
   IN+  โ—„โ”€โ”€โ”€โ”ค +12V           โ”‚
   IN-  โ—„โ”€โ”€โ”€โ”ค 0V             โ”‚
            โ”‚                โ”‚
   OUT+ โ”€โ”€โ”€โ–บโ”ค 5V  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€ Arduino 5V
   OUT- โ”€โ”€โ”€โ–บโ”ค GND โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€ Arduino GND
            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Arduino is powered directly from regulated 5V.


๐Ÿ”ต 4) RELAY COIL DRIVE (BC547)

                     Finder Relay Coil
                     โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

          +12V (after fuse) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ A1
                                           |
                                           |
                                           A2 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                                      |
                                                 Collector (C)
                                                BC547 Transistor
                                                      |
Arduino D8 โ”€โ”€ 1kฮฉ โ”€โ”€โ–บ Base (B)                        |
                                                      |
                                           Emitter (E)
                                                      |
                                                     GND

Flyback Diode (1N4007)

Diode across A1โ€“A2:

   Cathode (stripe) โ†’ A1 (+12V)
   Anode           โ†’ A2

๐ŸŸฃ 5) PIR26 โ†’ PC817 ISOLATION

PIR26 Side (12V)

PIR26 LED+ โ”€โ”€ 1kฮฉ โ”€โ”€โ”€โ–บ PC817 Pin 1 (Anode)
PIR26 LED- โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ PC817 Pin 2 (Cathode)

Arduino Side (5V, isolated)

PC817 Pin 3 (Emitter) โ”€โ”€โ”€โ”€โ”€โ”€โ”€ GND

PC817 Pin 4 (Collector) โ”€โ”€โ”€โ”€โ”€ Arduino D4
                                โ”‚
                                โ””โ”€โ”€ INPUT_PULLUP enabled

When PIR triggers:

  • PC817 conducts
  • Arduino D4 reads LOW

๐ŸŸค 6) PUSH BUTTONS

Inside Button:
Arduino D2 โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ””โ”€โ”€ Button โ”€โ”€โ”€ GND

Outside Button:
Arduino D3 โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ””โ”€โ”€ Button โ”€โ”€โ”€ GND

Both configured as:

pinMode(pin, INPUT_PULLUP);

Pressed = LOW


๐Ÿ”ท SYSTEM BLOCK OVERVIEW

  230V โ”€โ”€ Finder Contact โ”€โ”€ Lamp
        โ”‚
        โ””โ”€โ”€ ORNO 12V โ”€โ”€ Fuse โ”€โ”€โ”ฌโ”€โ”€ Finder Coil (via BC547)
                                 โ”œโ”€โ”€ GYVRM 5V โ”€โ”€ Arduino
                                 โ””โ”€โ”€ PIR26 โ”€โ”€ PC817 โ”€โ”€ Arduino D4

โšก Electrical Separation Summary

Section Voltage Isolation
Mains 230V AC Isolated by relay
Control Power 12V DC Fused
Logic 5V DC From GYVRM
PIR Signal 12V Isolated by PC817

โœ… What This Diagram Guarantees

  • No 12V ever reaches Arduino directly
  • No 230V reaches low voltage section
  • Relay coil protected
  • Low voltage fused
  • PIR fully isolated
  • Fail-safe: relay off at reset