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
Cool LED Display
  • Challenges & Projects
  • Project14
  • Cool LED Display
  • More
  • Cancel
Cool LED Display
Blog Cool LED Displays: Boost That LED!
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Cool LED Display to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: jc2048
  • Date Created: 22 Nov 2017 11:24 PM Date Created
  • Views 3418 views
  • Likes 18 likes
  • Comments 16 comments
  • arduino_projects
  • leddisplaych
  • arduino_classic
  • arduino uno project
  • arduino projects
Related
Recommended

Cool LED Displays: Boost That LED!

jc2048
jc2048
22 Nov 2017

Cool LED displays. I don't have a lot of time at the moment, but wanted to do something [I did vote for it, after all] so I've

thrown together this - a simple bit of experimenting with an Arduino.

 

Rather than just light an LED, I thought I'd make it a little bit of a challenge and see if I could light a series string

of seven LEDs. The red LEDs I'm using have a forward voltage of around 2V, so that means I need something like 13V or 14V

to get them illuminated. I could have just used a bench supply to provide the LED voltage but that's not much fun and

wouldn't have made a very interesting blog so I'm going to generate the voltage from the Arduino's 5V with a very simple

and crude boost converter.

 

Here it is working (warning: world's worst video)

 

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

 

and here it is drawn as a circuit diagram

 

image

 

you can see how I just lashed the components together, without a breadbord or pcb, in this next photograph

 

image

 

How does it work? The MOSFET is switched by the Arduino. Let's consider a time where the output has been low for a while

and is just about to switch high - the gate voltage (relative to the source) is very low and the MOSFET is off. When the

Arduino pin goes high, the gate rises to something close to 5V and the MOSFET turns on. That happens fairly quickly. When

the MOSFET is on it behaves much as a small value resistor would (in this case, a few ohms), so at that point we have 5V

across the coil. The current through the coil can't change instantaneously, instead it starts to ramp up with the rate of

change dependent on the inductance - I chose the 10mH value so that it would ramp to about 20mA in a few tens of

microseconds, a time period which we could control quite accurately with the processor on the board. If you look at the

waveforms below, you can see the ramp up of the current [yellow trace is the output pin, blue trace is the coil current].

 

image

 

As it ramps, energy is being stored in the form of a magnetic field around the coil. After 60uS, the Arduino turns off

the MOSFET, and then the interesting bit happens; the magnetic field storing the energy can't remain there indefinitely,

so the coil needs to be rid of it. If it needs to, and in this case it does, it will do that by increasing the voltage at

the MOSFET end so as to maintain the current that was flowing at the time the switch turned off [as the energy stored is

used up, the current will fall until we are back to zero again]. Initially, the coil can charge the intrinsic capacitance

at the drain of the MOSFET and the capacitance of the LEDs, but those capacitances aren't all that large and it will

quickly attain a voltage where the LEDs turn on and then most of the energy will go to running the LEDs for a short

period. Repeating the process gives the illusion that the LEDs are on continuously. The next set of waveforms show the

voltage at the coil/MOSFET/LED node and the current that flows through the LEDs. As the current declines, the voltage

falls because the forward voltage of the LEDs depends on the current. When the energy stored by the coil is almost used

up, it no longer runs the LEDs but instead what's left of the energy moves back and forth from the coil to the

capacitance at that node [which of course includes the capacitance of the scope probe tip]. The ringing looks a bit

alarming but there's little energy there and it's not doing any real harm.

 

image

 

Sorry the current waveforms are a bit of a mess. The probe is a bit noisy and isn't that good with small currents.

 

A couple of points if you want to replicate this. Firstly, check the waveform timing produced by the Arduino before connecting the

circuit - there's no protection if the timing is wrong. Secondly, if the LED string is disconnected for any reason, the voltage

will increase until the current does flow, even if that means the coil has to avalanch the MOSFET to do it - so make sure

the LEDs are the right way round and connect properly - if you're a bit nervous, a 24V zener across the LED string would

provide an alternative path in the event of a fault.

 

Finally, here's the sketch I used.

 

int outPin = 9;   // output pin to use  
// the setup routine runs once when you press reset:
void setup() {
  // set output pin:
  pinMode(outPin, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
word onPeriod = 0;
  // LED on 
  for(onPeriod=0;onPeriod<5000;onPeriod++) {    // repeat for about half a second
    noInterrupts();
    digitalWrite(outPin, HIGH);   // pin is high
    delayMicroseconds(60);        // ...for 60 microseconds
    digitalWrite(outPin, LOW);    // then low
    interrupts();
    delayMicroseconds(60);        // ...for 60 microseconds
    }
  // LED off
  delay(500);   // off for half a second
}

 

If you want to try fading the LEDs, keep the high time constant and lengthen the low time.

  • Sign in to reply

Top Comments

  • jc2048
    jc2048 over 7 years ago +8
    players.brightcove.net/.../index.html Another one. This time it's twenty LEDs and a better shape - a star. I've increased the on time so that the current is higher to compensate for the increased number…
  • jc2048
    jc2048 over 7 years ago +7
    players.brightcove.net/.../index.html I couldn't resist doing a bit more with this, so I added two more strings of LEDs (with the LEDs all interleaved) and used MOSFETs to switch one string at a time into…
  • jw0752
    jw0752 over 7 years ago +7
    Hi Jon, I love the way you let us look at the technical beauty that lies behind the scenes. Just about anyone can make an LED flash but making one flash in a new way is pretty neat. John
  • jw0752
    jw0752 over 7 years ago

    Hi Jon,

    I love the way you let us look at the technical beauty that lies behind the scenes. Just about anyone can make an LED flash but making one flash in a new way is pretty neat.

     

    John

    • Cancel
    • Vote Up +7 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jc2048
    jc2048 over 7 years ago

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

     

    Another one. This time it's twenty LEDs and a better shape - a star. I've increased the on time so that the current is higher to compensate for the increased number. You can see from the waveforms that the initial current through the LEDs is now 50mA and the voltage at the top of the string lifts to 40V to get the current to flow. (Although the LEDs will have a DC maximum rating of something like 30mA, they don't mind being pulsed like this - the average current is quite low, just a few milliamps.)

     

    image

     

    The ringing is quite entertaining - the first half cycle tries to go below ground but is stopped by the MOSFET body diode conducting and the subsequent cycles continue with the negative peak just above ground.

     

    And I can report that the MOSFET didn't mind at all being avalanched and is still happily working (whoops!). Probably not too surprising - with the coil limiting the current and the duration quite short it's only doing what any small zener would be able to do.

    • Cancel
    • Vote Up +8 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 7 years ago in reply to jc2048

    That's awesome! : )

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jc2048
    jc2048 over 7 years ago

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

     

    I couldn't resist doing a bit more with this, so I added two more strings of LEDs (with the LEDs all interleaved) and used MOSFETs to switch one string at a time into circuit giving a travelling pixel effect. The LEDs aren't very even and I needed a small piece of cardboard halfway round to stop them shorting, but it sort of works, if a bit slapdash.

    • Cancel
    • Vote Up +7 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jc2048
    jc2048 over 7 years ago

    Whilst I had this set up, I thought I'd do a follow-up. I'm going to look at the ringing and then try using it to measure something (more on that in a moment).

     

    The oscillation at the end, when the LEDs stop illuminating because the coil can't power them any more, seems to appear from nowhere and is all a bit mysterious as there doesn't seem to be anything in the circuit to cause it. It's a nice sinewave, the frequency is fairly constant, and it diminishes gradually. It's also exactly the same on each and every cycle of the converter. Those details give us the clue that we're probably looking at resonance of a tuned circuit. A tuned circuit that is kicking back and forth the final dollop of energy left in the coil. The inductance is obvious, it's the 10mH coil (it actually measured 10.3mH), but where is the capacitance? Well, the capacitance is hidden in the other elements of the circuit. The MOSFET has some internal intrinsic capacitance at the output. For a small MOSFET like this that will be quite small, a few tens of pF (with a power MOSFET it can be quite considerable). The LEDs also have some capacitance when they're reverse biased, though having seven in series helps us here because the capacitance that the coil sees will be a seventh of what it would be for a single LED. There will also be a very small contribution from the coil itself  - there's capacitance from turn to turn, but it's not very much and, as with the LEDs, the overall value from end to end is much less. Finally there's the capacitance we tend to overlook and that's the probe tip capacitance of the 'scope probe.

     

    What I'm going to try and measure is the capacitance at the probe tip. I'll then use that to calculate what the actual frequency of oscillation is (ie without any probes attached) and we'll see by how much that differs from the reading that the scope gives.

    Here's the waveform with two scope probes attached. Why two probes? You'll see in a moment.

     

    image

     

    The frequency is 210.4kHz. Using the formula for resonant frequency of a tuned LC circuit and plugging in the values for frequency and inductance I get a value of 55.5pF for the capacitance.

     

    If I now remove one of the probes and do the same thing again

     

    image

     

    the frequency is now 234.4kHz. That gives a capacitance of 44.8pF.

     

    The probe capacitance is in parallel with the circuit capacitance, so it adds to what is there. The capacitance for one probe is then simply the difference between the two figures, ie 55.5pF - 44.8pF = 10.7pF. That's a reasonably good figure for a passive probe (you'd expect a modern x10 probe to be in the range 10pF-20pF, though an old one might be anything up to 30pF) - there's a natural limit to how low it can go because of the screened cable to the oscilloscope.

     

    So what would be the frequency with no probes at all attached. If I take the 44.8pF figure and subtract 10.7pF for the single probe I get 34.1pF. Plugging that into the formula gives me a frequency of 268.5kHz. So that means that when I probe the circuit, the frequency drops by about 13%.

     

    It's easy to forget the effect that a small amount of capacitance can have on a circuit, particularly when you spend a lot of time looking at logic where the impedances are low and an output can happily throw 50pF of capacitance around with rise times of only a few nanoseconds. Even a x10 probe like the one I was using here, where the tip capacitance is much less than a x1 probe, doesn't necessarily save you from problems when you're looking at more sensitive analogue stuff.

    • Cancel
    • Vote Up +5 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