element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Project Videos
  • Challenges & Projects
  • element14 presents
  • Project Videos
  • More
  • Cancel
Project Videos
Documents DIY AC Dimmer Circuit: Control Your Lights with a Raspberry Pi Pico -- Episode 602
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Project Videos to participate - click to join for free!
Related
Recommended
Engagement
  • Author Author: tariq.ahmad
  • Date Created: 3 May 2023 6:50 PM Date Created
  • Last Updated Last Updated: 12 May 2023 7:24 AM
  • Views 27829 views
  • Likes 9 likes
  • Comments 11 comments

DIY AC Dimmer Circuit: Control Your Lights with a Raspberry Pi Pico -- Episode 602

Dimmer circuits consisting of Phase Angle Control are used to efficiently adjust the AC power delivered to the AC loads by controlling the conduction angle. In this episode, Surbhika developed such a circuit to enable dimming of commonly used AC lights bulbs at home. This was an interesting DIY project as it meant realizing one of the fundamental concepts in power electronics and control theory to generally usable hardware.

Watch the Video:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Bonus Content:

  • Download Code!
image image

Bill of Materials

Product Name Manufacturer Quantity Buy Kit
RASPBERRY-PI Raspberry Pi Pico Board, RP2040, 32 bit, ARM Cortex-M0+ RASPBERRY-PI 2 Buy Now
MULTICOMP PRO TERMINAL BLOCK EUROSTYLE, 2 POSITION, 26-16AWG MULTICOMP PRO 5 Buy Now
ONSEMI Optocoupler, Triac Output, DIP, 6 Pins, 5.3 kV, Non Zero Crossing, 400 V ONSEMI 1 Buy Now
VISHAY Optocoupler, Transistor Output, 1 Channel, DIP, 4 Pins, 50 mA, 5.3 kV, 160 % VISHAY 1 Buy Now
WEEN SEMICONDUCTORS Triac, 800 V, 16 A, TO-220AB, 1.5 V, 170 A, 45 mA WEEN SEMICONDUCTORS 1 Buy Now
BOURNS LINEAR POTENTIOMETER, 10KOHM, 20%, 50mW BOURNS 1 Buy Now
PHILIPS LIGHTING LED Light Bulb, Reflector, GU10, Warm White, 3000 K, Dimmable, 36° PHILIPS LIGHTING 1 Buy Now
ETERNA GU10 Lampholder with Flying Leads ETERNA 1 Buy Now
LEDVANCE LED Light Bulb, Reflector, GU10, Daylight White, 6500 K, Not Dimmable, 36° LEDVANCE 1 Buy Now
 

image

element14 presents  |  About Surbhika |  Project Videos

  • AC power control
  • ac dimmer
  • home automation
  • raspberry pi pico
  • Dimmer switch
  • power control
  • triac
  • optocoupler
  • Light dimming
  • raspberry pi
  • circuit design
  • Phase angle control
  • electrical engineering
  • energy efficiency
  • e14p_SR
  • diy electronics
  • friday_release
  • pi pico
  • Share
  • History
  • More
  • Cancel
Actions
  • Share
  • More
  • Cancel
  • Sign in to reply

Top Comments

  • michaelkellett
    michaelkellett over 2 years ago +3
    The subject is interesting (although some discussion of EMC issues would be helpful) but the bench practice is life threateningly dangerous. Main voltages should never be applied to a breadboard operated…
  • surbhika
    surbhika over 2 years ago in reply to Workshopshed +1
    No the optocoupler IC does the isolation. I see the confusion arises due to the improper symbol of SFH628A. Thanks for pointing that out! It should be like this (as given in the datasheet):
  • CharlieDelta
    CharlieDelta 7 months ago

    May be a good solution would be to use a 12 volt lamp run from a mains transformer as the load. In this case there would be no issues with electrical safety. As an alternative may be you should use an opto-triac (eg CT3021) to trigger the main triac. This would then provide the requisite electrical isolation   when using a mains driven light bulbs. I believe that there are a number of assembled boards on the market (eg  RobotDyn) but be AWARE that some of them do not have the required mains isolation between pcb traces.
    Perhaps an interesting extension would be to use the Pico PIO circuits to control the triac firing so that the Pico could get on with other things (like measuring the local temperature or light levels) and working remotely over WiFi using (say) one of the new ESP8285 modules (or even the Pico W) .
    Just some ideas. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Anthocyanina
    Anthocyanina over 1 year ago in reply to beacon_dave

    thank you!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • beacon_dave
    beacon_dave over 1 year ago in reply to Anthocyanina

    The code is still there but the link is incorrect. Try this:

    /challenges-projects/element14-presents/m/files/147587

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Anthocyanina
    Anthocyanina over 1 year ago

    I just came across this, and a while ago i was trying something like this. i ended having to use an arduino because i was having trouble with the interrupts on the pi pico. I see the code is no longer available, could you upload it again please? I want to see how you did it, and if you used interrupts or some other way. thank you!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • michaelkellett
    michaelkellett over 2 years ago

    The subject is interesting (although some discussion of EMC issues would be helpful) but the bench practice is life threateningly dangerous. Main voltages should never be applied to a breadboard operated on an open bench. No ifs, no buts, never.

    If you must use breadboard it should be enclosed in a protective enclosure, ideally with a mechanically linked mains ciruit breaker.

    A USB cable should never be connected directly to mains powered devices (live or neutral, doesn't matter). You have an opto-coupler but plugged into breadboard it gives no safety protection at all so in effect the USB cable is directly connected to mains.

    It is very important to set a good example in videos of this type because they are watched by a great many very inexperienced people.

    The warning at the beginning is no use if it is then ignored in the rest of the video.

    I think you should re-work this video to demonstrate safe practice.

    The obvious way to that would be to put the mains voltage parts on a separate board with adequate clearances and enclose that.

    if you need to probe the live circuit it gets harder.

    For bench work you should use a mains isolating transformer or, at the very least, an RCB (Residual Current Breaker) and suitable scope probes.

    An MCB won't save you - it has to pass the load operating current which will be more than enough to kill you.

    MK

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • surbhika
    surbhika over 2 years ago in reply to Jaganhalo

    We have all been there when MCB saved the day. Yeah now that you have said it, I 'm realizing I should have mentioned this. But there were not many components in the circuit and i was doing all the measurements with respect to neutral terminal only. So it didn't make any difference even if I used differential probe.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jaganhalo
    Jaganhalo over 2 years ago

    Once I probed an AC test point with Oscilloscope and let's just the MCB saved the day, I see you are using some tool. Is it a differential Probe?
    It would be nice if you highlighted this, not a lot of people know that the Oscilloscope Neutral and earth are shorted internally.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 2 years ago

    Nice overview of PWM and its uses.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • surbhika
    surbhika over 2 years ago in reply to Workshopshed

    No the optocoupler IC does the isolation.

    I see the confusion arises due to the improper symbol of SFH628A. Thanks for pointing that out! It should be like this (as given in the datasheet): image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Workshopshed
    Workshopshed over 2 years ago

    The circuit diagram for the zero crossing looks like you have the AC supply connected to the microcontroller. Is that actually the case as it looked different on the breadboard?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube