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
DC to Daylight
  • Challenges & Projects
  • element14 presents
  • DC to Daylight
  • More
  • Cancel
DC to Daylight
Documents Driving LEDs to Create a Flux Capacitor -- DC to Daylight 08
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join DC to Daylight to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Engagement
  • Author Author: tariq.ahmad
  • Date Created: 10 Mar 2022 3:57 PM Date Created
  • Last Updated Last Updated: 16 Mar 2022 8:24 AM
  • Views 35650 views
  • Likes 6 likes
  • Comments 6 comments
Related
Recommended

Driving LEDs to Create a Flux Capacitor -- DC to Daylight 08

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

In this episode we make a PWM LED driver using transistors and an Arduino Nano, which provide dimming and sequencing functionality for a Flux Capacitor. While not an exact replica, it does make a good demonstration of pulse width modulation and how to drive LEDs with a current sink/source

Supplemental Content:

  • Resources

element14 presents

element14 presents  | About Derek  |  DC to Daylight

  • LED driver
  • arduino nano
  • back to the future
  • derek
  • arduino pwm
  • current source
  • flux capacitor
  • pulse width modulation
  • pwm led
  • light emitting diode driver
  • current sink
  • arduino
  • bttf
  • Share
  • History
  • More
  • Cancel
  • Sign in to reply
Parents
  • Derek (DCtoDaylight)
    Derek (DCtoDaylight) over 3 years ago

    Hello all! If you have suggestions on how to improve this project, especially related to software let me know here. One of the things I'd like to do is to "power up" three LEDs at the same time so the pulsing looks more natural... meaning three of the LEDs are actively ramping through the PWM values out of phase. I think this would require three nested loops and maybe a state machine. Ideas?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 3 years ago in reply to Derek (DCtoDaylight)

    One loop should do:

    Let's say as example that when LED A is 0, then B is 85, 3 = 130 (each 1/3 offset of each other).

    #define A_OFFSET 0
    #define B_OFFSET 85

    #define C_OFFSET 130

    uint8_t counter = 0;



    // helper method

    void setLed(uint8_t pin, uint8_t value, uint8_t offset {

      uint8_t intensity = ((uint32_t)(value + offset)) > 255 ? 255 : (value + offset);

      analogWrite(pin, intensity);

    }




    // where you want to make them glow:

    for (counter = 0; counter <= 255; counter++) {

      setLed(A, counter, A_OFFSET);

      setLed(B, counter, B_OFFSET);

      setLed(C, counter, C_OFFSET);

    }
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 3 years ago in reply to Jan Cumps

    ... but that will make led 2 and 3 flip directly to their offset value, and that's not what you want he?

    Changing the helper function should fix that. Thinking ...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • Jan Cumps
    Jan Cumps over 3 years ago in reply to Jan Cumps

    ... but that will make led 2 and 3 flip directly to their offset value, and that's not what you want he?

    Changing the helper function should fix that. Thinking ...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • Jan Cumps
    Jan Cumps over 3 years ago in reply to Jan Cumps
    #define A_OFFSET 0
    #define B_OFFSET 85
    #define C_OFFSET 130
    #define MAX_OFFSET C_OFFSET

    // helper method

    void setLed(uint8_t pin, uint32_t value, uint8_t offset) {
    uint8_t intensity = 0;
    if (value > offset) {
    intensity = (value - offset) > 255 ? 255 : (value - offset);
    }
      analogWrite(pin, intensity);
    }

    // ...
    for (uint32_t counter = 0; counter <= 255 + MAX_OFFSET; counter++) {
    setLed(A, counter, A_OFFSET);
      setLed(B, counter, B_OFFSET);
      setLed(C, counter, C_OFFSET);
    }

    • 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