Paradox
©
Fisana

Jump to content


Photo
- - - - -

Glasshopper explains L.E.D.s and 555 timers


  • Please log in to reply
22 replies to this topic

#1 BuckarooBanzai

BuckarooBanzai

    The Abe Vigoda of Mycotopia

  • Moderator
  • 8,968 posts

Awards Bar:

Posted 23 September 2006 - 08:58 AM

Originally posted by Glasshopper:

Help hooking up L.E.D.s (LED 101a-2)

<HR style="COLOR: #121111" SIZE=1><!-- / icon and title --><!-- message --><HR style="COLOR: rgb(18,17,17)" SIZE=1><!-- / icon and title --><!-- message -->You first need to know the voltage and current your leds run on.
The voltage drop and needed current is different depending on the color.
(this is typical not absolute, your mileage may vary, check the info supplied with your LEDs):

http://mycotopia.net...79&d=1158804751

RED:
1.7 volts @ 30 mA for non-high-brightness
2.0 volts @ 20 mA for high-brightness, high-efficiency and low-current

ORANGE or YELLOW:
2.1 volts @ 30 mA

GREEN:
2.1 volts @ 25 mA for the normal
3.4 volts @ 20 mA for bright non-yellowish green

WHITE:
3.6 [email protected] 25 mA for bright white

BLUE:
3.4 [email protected] 30 mA for typical
4.6 volts @ 25 mA for 430 nM bright blue types such as Everbright and Radio Shack Superbright

Meet or exceed the maximum rated current of the LED only under favorable conditions of lack of heat buildup.
If heat can not excape, I would recomend a bit less current like 5 mA less than stated.

Ok, now lets look at the word L.E.D., it is an anacronm for Light Emitting Diode. The important part is the word diode, which is a ONE WAY valve for electricity.This means that if you hook up an led backwards, it will not work.

http://mycotopia.net...78&d=1158804751

So how do you know how to hook it up?
There are 3 different ways:

http://mycotopia.net...80&d=1158804751

1. one lead (wire) is longer, this is the anode (positive +)
2. There is a flat spot on the plastic "case", this is closest to the cathode (negative -)
3. inside the case is the actual die with a tiny wire comming off the top, the die is connected to the cathode the tiny wire is the anode.

An LED usualy must have a resistor connected in series to limit the current through it, otherwise the LED will burn out quickly.

This is known as a (suprise!) current limiting resistor.
The resistor does consume some power, but is usually needed since an 'ideal' X.X volt source is rarely available.

Use Ohms law (Resistance® = Voltage(E for Electromotive force) / Current(I for intensity of the current))

To calculate the value of the resistor needed: (R=E/I)
The resistor value, R is calculated:
R = (Vs - VL) / I
where:
Vs = supply voltage
VL = LED voltage
I = LED current, this must be less than the maximum permitted

If the calculated value is not available choose the nearest standard resistor value which is greater, so that the current will be a little less than you chose.

In fact you may wish to choose a greater resistor value to reduce the current (to increase battery life for example) but this will make the LED less bright.

What if I want to light more than one LED?
1. Simply hook them up in series then, add the voltage drop from all the LEDs.
2. use the same formula.
3. Current is the same through all the led in series.

http://mycotopia.net...83&d=1158804751

Ok, so what if I want to light more than a few LEDs?
You would use a series-parallel hookup, just make sure to provide enough current for all the series circuts:

http://mycotopia.net...82&d=1158804751

Total current is doubbled in the above circut (50 mA).

Lets show an example (we will use white LEDs):
Each white LED gives a voltage drop of 3.6 volts. As an example, for a 12 volt power supply, you can run a maximum of 3 white LEDs in series at full power.
(3.6 x 3 = 10.8 volts drop).

Subtract this from your supply voltage of 12 volts to get the additional voltage that must be dropped
(12 - 10.8 = 1.2 volts)

Plug in our Ohms law (R=E/I):
1.2 volts of additional drop / .025 amps (25 ma) = 48 ohms.
48 dosen't exist so use a 50.

You must also be sure the resistor can handle enough current. For this we use annother part of Ohms law.
(Watts (P for Power) = Volts (E) x Amps (I))
(P=ExI)

So in this case, 12 volts x .025 amps = 0.3 watts.
So, A 1/4 watt resistor would be close enough.

If you run a second string of 3 LEDs in parallel, each string would need its own 50 ohm, 1/4 watt resistor.

It's important that each string has its own resistor....putting them in parallel with a single resistor is bad practice because the actual values can vary and cause too much current to flow through one string and not enough in the other resulting in (at best) one string too dim and (at worst) one string burning out.


This is a bad idea...
http://mycotopia.net...77&d=1158804751

If you are using a wall wart to supply power, I would use a voltage regulator (like a 7812 (fot 12 volt)) to provide the right power because the wart's voltage is always a few volts higher than stated.

If you want to run them on a battery I would use a chip called a 555 to vary the duty cycle to about 70-80% so as to save power but I'll save this is for another post.
Good Luck.
<!-- / message --><!-- attachments -->

#2 BuckarooBanzai

BuckarooBanzai

    The Abe Vigoda of Mycotopia

  • Moderator
  • 8,968 posts

Awards Bar:

Posted 23 September 2006 - 08:59 AM

Originally posted by Glasshopper:

555 tutorial
<HR style="COLOR: #121111" SIZE=1><!-- / icon and title --><!-- message -->One of my favorite chips as a child was the NE555. It is cheap, stable, simple to use, and extreemly versitale,
requiring just 2 resistors and a capacitor to run.

It is now somewhat obslete now with the advent of the PIC12C508A but
sometimes you don't have the desire or resources to program a pic.
Plus, I still like using them (if only for the sake of nostalga).


You may be asking yourself "what is this 555 thingey and why should I care?"

The 555 timer IC was invented by Hans R. Camenzind in 1970 and first introduced in 1971 by the Signetics Corporation as the SE555/NE555. (thank you wiki for that tidbit o' info!)

It was the very first and only commercial timer IC available at the time.
It consists of two voltage comparators, a bi-stable flip flop, a discharge transistor, and a resistor divider network.

The 555 timer is one of the most popular and versatile integrated circuits ever produced. Over thirty five years later it is still being made (although not by Signetics anymore) and has been used in litteraly millions of circut designs.
It's output produces a square wave

This chip can be VERY handy to make DC timers to help automate lights, fans and more.
It can also switch a relay or a triac to controll an AC device.

It has a few different flavors that it comes in:
555 Available in both a "T" package (round metal can) and the more familar 8 pin dip (Dual Inline Package)
556 Is two 555s in a 14 pin dip
558 Is four 555s (slightly modified) also in a 14 pin dip
Also available are ultra-low power versions of the 555 such as the 7555, the TLC555 and the MC1455.
These are CMOS (Complementary Metal Oxide Semiconductor) equavilents and use a lot less power than your standard chips,
I recomend you use CMOS (or LS) chips for any battery powered semiconductor project.

Any 555 can operate in three different modes:
1.) Monostable mode: in this mode, the 555 functions as a "one-shot".
Applications include timers, missing pulse detection, bouncefree switches, touch switches, etc.
2.) Astable mode: the 555 can operate as an oscillator.
Uses include LED and lamp flashers, pulse generation, logic clocks, tone generation, security alarms, Pulse Width Modulation (PWM) etc.
3.) Bistable mode: the 555 can operate as a flip-flop,
if the DIS pin is not connected and no capacitor is used. Uses include bouncefree latched switches, etc.

In this tutorial we will be hooking one up in astable mode and using it to controll an LED so we can run it longer on a battery.
This is done by using a square wave, so lets take a look at a square wave...

What is a square wave?

It is (for this tutorial) simply a pulsing waveform that is turning on and off.
By doing this very rapidly we take advantage of this off time to save the battery but because it happens so fast we dont notice it (due to persistance of vision) and I doubt our mushie friends can tell either (or they just don't care). If the frequency of the wave is low enough, it will appear to eyes as if the light is dimmer but this is not really the case, it is fully bright it's just not on the whole time so it seems dimmer. If the frequency is very low, the light will blink on and off.

http://mycotopia.net...28&d=1159015454

Having a square wave we can also vary the duty cycle (Pulse Width Modulation) to adjust the apparant brightness. Duty cycle is the ratio of on time to off time.

http://mycotopia.net...17&d=1159011768

A waveform's time period (T) can be used to calculate frequency (F (in hertz)) with this simple formula:
F = 1 / T

Ok, now lets take a look at the 555...

http://mycotopia.net...12&d=1159011768
Pin Name Purpose
1 GND Ground, low level
2 TR A short pulse high->low on the trigger starts the timer
3 Q During a timing interval, the output stays at +VCC
4 R A timing interval can be interrupted by applying a reset pulse to low (0V)
5 CV Control voltage allows access to the internal voltage divider (2/3 VCC)
6 THR The threshold at which the interval ends (it ends if U.thr > 2/3 VCC)
7 DIS Connected to a capacitor whose discharge time will influence the timing interval
8 VCC The positive supply voltage which must be between 5 and 15 V.

This is the equivalent circut using descreet components... (image snagged from the web)

http://mycotopia.net...18&d=1159011768

As you can see one chip relpaces 23 transistors, 16 resistors, and 2 diodes. all in a single easy to use chip.

This is a block diagram of the internal 555 circut..

http://mycotopia.net...13&d=1159011768

The 555 is a hearty chip than can run on a wide range of voltages, here are the specs.
(These specifications apply to the NE555. Other 555 timers can have better specifications depending on the grade)

Supply voltage (VCC) 4.5 to 15 V
Supply current (VCC = +5 V) 3 to 6 mA
Supply current (VCC = +15 V) 10 to 15 mA
Output current (maximum) 200 mA
Power dissipation 600 mW
Operating temperature 0 to 70° C

Now lets look at how to hook it up to light(s) in astable mode:

http://mycotopia.net...21&d=1159012107

How to calculate frequency and duty cycle:

The frequency of the wave is given by:
F = 1.49 / (R1 + 2 x R2) x C1

the high time from each pulse is given by:
Ton = 0.7 x (R1 + R2) x C1

and the low time from each pulse is given by:
Toff = 0.7 x R2 x C1

Using a bit of algebraic magic to re-arange the formulas, we then calculate the values of the components:

1.) Firstly, decide the time Toff that you require. This can be very small (milliseconds) or large (minutes), but it must be expressed in seconds.

2.) Next, guess a value for the capacitor C1, expressed in Farads. For starters, try 10F.

3.) Put the values of Toff and C1 into the equation below and calculator resistor R2...
R2 = Toff / 0.7 x C1

4.) Finally, decide on the time Ton that you require
R1 = Ton / 0.7 x C1 - R2

where R1 and R2 are the values of the resistor in ohms and C1 is the value of the capacitor in farads.
You should now have the component values required to build the astable circuit

However, if any of the resistor values calculated are smaller than 1k or larger than 1M, you should re-do the calculations with a different value for capacitor C1 until you get resistor values within the acceptable range.
Note that you cannot get Ton and Toff to be exactly equal (i.e. a 50% duty cycle), but you can get them approximately equal. Ensure that R2 is at least 10k in step 3, and then omit step 4 and make R1 much smaller than R2 - for example, the minimum value of 1k.
Don't sweat the formulas as I will provide freeware (with distrubition rights for non commercial purposes) to do the calculations for you.

Thats all you need to know about the 555 for this project just remember that the faster (higher frequency) you run the chip and larger duty cycle (longer on time) you use, the faster it will drain the batteries.

If you want to use a wall wart to power a 555 timer, I would add a couple of capacitors. One as a decoupling capicitor (of about 20 to 100 uf) to clean the very "dirty" power the wall wart provides and one as a debounce capicitor (of about 0.01 (10nF) to 0.1 uf) to keep slight fluxuations of the power from resetting the chip.

http://mycotopia.net...22&d=1159012107

But wait we are not done yet...

Notice the ouput current (Supply current) is only 10 to 15 mA (at 15 V), this is barely enough to run one LED at less than full capicity.
So how are we going to run a whole array of lights off this one chip?
Simple, we use the majic of transistors, or more specificaly a special type of transistor called a MOSFET.

I will describe how to use one to light an array of LEDs running off a 555 in my next post.

One more thing here is a simulator for the 555 in astable mode so you can visualize what it does.
(I found it on the web, It has a few errors but you get the jist.)

http://mycotopia.net...16&d=1159011768

Or here is a java applet simulator of a 555 on the web.

One more thing here is the ic_555.zip software I promised and the 555 datasheet.pdf.

One more thing (I love that jackie chan cartoon) here is a great tutorial on the 555 I found on the web to provide more info and a bunch of nifty circuts for the chip.

I hope this tutorial is usefull to you and that you had as much fun reading it as I had writing it.
(Bwaaa Ha Ha, Ha Ha Ha!).

#3 BuckarooBanzai

BuckarooBanzai

    The Abe Vigoda of Mycotopia

  • Moderator
  • 8,968 posts

Awards Bar:

Posted 23 September 2006 - 09:01 AM

This deserves it's own thread.

It also deserves: ARCHIVE MATERIAL to Lights & Lighting

#4 Hippie3

Hippie3

    DUNG DEALER

  • Founders
  • 40,642 posts

Posted 23 September 2006 - 09:09 AM

yep,
already reached that conclusion too
but you beat me to it.
well done,
both of you.
:bow:

#5 Guest_Glasshopper_*

Guest_Glasshopper_*
  • Guest

Posted 23 September 2006 - 09:35 AM

It also deserves: ARCHIVE MATERIAL to Lights & Lighting


WooHoo! I made it into the archives. I feel like Steve Martin in The Jerk when the new phone book arrived.

Stay tuned, I'll get that mosfet post done soon (and more).

#6 BuckarooBanzai

BuckarooBanzai

    The Abe Vigoda of Mycotopia

  • Moderator
  • 8,968 posts

Awards Bar:

Posted 23 September 2006 - 09:59 AM

Navin R. Johnson: The new phone book's here! The new phone book's here!
Harry Hartounian: Boy, I wish I could get that excited about nothing.
Navin R. Johnson: Nothing? Are you kidding? Page 73 - Johnson, Navin R.! I'm somebody now! Millions of people look at this book everyday! This is the kind of spontaneous publicity - your name in print - that makes people. I'm in print! Things are going to start happening to me now.

I freakin' love that movie. Steve Martin is a genius at flat out goofy comedy.

#7 tbonus

tbonus

    Mycotopiate

  • Expired Member
  • 1,405 posts

Posted 23 September 2006 - 01:27 PM

I feel like I went to shop class and the movies today:lol:

#8 reefer

reefer

    Mod of the Ocean

  • Expired Member
  • 1,050 posts

Posted 23 September 2006 - 04:34 PM

Very nice write up. Its explained so clearly even I can understand it. (almost :lol:)

#9 apokalypse

apokalypse

    Dr. Durgs

  • Expired Member
  • 1,454 posts

Posted 23 September 2006 - 05:27 PM

Feels like electronics class all over again.. great writeup!

#10 spacecake

spacecake

    Mycotopiate

  • Expired Member
  • 4,563 posts

Awards Bar:

Posted 23 September 2006 - 06:10 PM

Lovely ,electronics is a hobby of mine...
I can watch blinking leds for hours and don't get bored.. :)

Great tread !!!

#11 Guest_Glasshopper_*

Guest_Glasshopper_*
  • Guest

Posted 25 September 2006 - 08:47 PM

Ok, so far we learned how to hook up miltiple LEDs. Then we learned how to run a 555 in astable mode, now it's time to put the both lessons together.

As I stated in the 555 post it's output current is too low to light more than one LED. So how are we going to light our array with one?
Simple really we will use a transistor which is simply a device used to have a smaller current control a larger current. Actualy we are going to use a special kind of transistor...

A MOSFET, this stands for Metal Oxide Silicone Field Effect Transistor, and we are going to use it because it's gate operates on voltage not on current like the base operation of a normal transistor (yes this is english)
Without getting into the intricacies and construction of a MOSFET, this simply this means that it consumes far less power to operate than a normal transistor to run.
This equates to a longer battery life as well as total control over the LEDs.

A MOSFET looks just like a normal transistor and comes in all the standard TO-1, TO-2, TO-3 cases etc.(Transistor Outline)...

http://mycotopia.net...17&d=1159234105

This is the schematic symbol for a MOSFET...

http://mycotopia.net...18&d=1159234105

This is how you would use a MOSFET by itself to control the brightness of a LED...

http://mycotopia.net...20&d=1159234105

By turning the 1M potentiometer (pot) we bias the gate voltage more towards positive voltage or ground.
This varies the power allowed through the transistor, adjusting the voltage on the LED. And yes you could just use a similar resistor setup directly without the MOSFET but because more current would flow through the resistors a lot more power would be turned to heat (wasted).

And this is how we will be hooking our circut up..

http://mycotopia.net...16&d=1159234105

The pot here changes the frequency AND the duty cycle of the 555 timer witch in turn controls the MOSFET

Because of this the gate current of the mosfet if so low (a few millliamps) you can of course hook up dozens of them in parallel...

http://mycotopia.net...19&d=1159234105

if you want more strings than a few dozen you will need to buffer the 555's output using a transistor or MOSFET.


Now go get yourself a breadboard and start playing with those 555s.
When you get the circuit like you want buy yourself a prefboard that is wired just like your breadboard (Radio shack has them) and start soldering!!

in my next post we will look at the 555 in monostable mode and describe how you can use it to turn on a fan or other device for a pre determined time at regular intervals.
Stay tuned kiddies!

#12 dial8

dial8

    3 Fungi Mod

  • Honorary Former Staff
  • 5,672 posts

Donator


Awards Bar:

Posted 26 September 2006 - 07:56 AM

Holy shit...lol...what did I just see? Man I am more low tech than I want to admit.

#13 sandman

sandman

    Mansplainer

  • Honorary Former Staff
  • 3,692 posts

Awards Bar:

Posted 26 September 2006 - 12:50 PM

rude remark deleted

#14 Lazlo

Lazlo

    old hand

  • Honorary Former Staff
  • 7,620 posts

Posted 26 September 2006 - 01:10 PM

----------

#15 spacecake

spacecake

    Mycotopiate

  • Expired Member
  • 4,563 posts

Awards Bar:

Posted 26 September 2006 - 01:15 PM

----------

#16 sandman

sandman

    Mansplainer

  • Honorary Former Staff
  • 3,692 posts

Awards Bar:

Posted 26 September 2006 - 06:45 PM

--------

#17 Guest_Glasshopper_*

Guest_Glasshopper_*
  • Guest

Posted 26 September 2006 - 06:57 PM

Alot,..don't you use a timer for your ventilator(s) (you didn't read it all right ?!)
I use two myself and find it much more fun to make one by your own !


Not only is it more fun to make one but have you priced timers for DC? Not only are they way too pricey, they are not well suited for this hobby (limited number of events and limited cycle times).

This thread grew out of Eternalfrost's request for assistance for a stealth setup to be run on batteries, and was specificaly written to assist the mycologist.

As stated in the posts this can be used for controling lights, ventalation, and even humidifiers by the do it yourself-er to build an inexpensive semi automated setup.

This chip can be VERY handy to make DC timers to help automate lights, fans and more.
It can also switch a relay or a triac to controll an AC device.



I dont use any electronics

Not everyone is a myco-luddite :lol: some of us like to automate (and/or over complicate) things.

#18 zook

zook

    Former Member

  • Banned Member
  • 51 posts

Posted 26 September 2006 - 08:55 PM

the 12c508 is what i used to mod the original playstations ;) but they did manufacture some bad batches (id'd by the lot number on the chip) so i just switch to the 12c509. Anyway great articles! I came across another diy writeup on leds (technical) for a bike taillite at http://maushammer.com/ and it was very informative as well, possibly some other useful stuff there too.

I do have a question if you dont mind. Ive been thinking about making a few stealth setups for friends with little or no experience so I want to make them as automated as possible but im not sure a timer will cut it. I want a system that uses multiple switches so when the temp, the humidity, and the co2, gets too high (or too low) the setup would switch on/off the specific ac outlet of my choosing.. so it would have to be very flexible and totally programmable.. is what im asking for called a 'microcontroller'? or would it be 'programmable logic controllers or units' could ya point me in the right direction.. im just an amateur but i do ok with a solder gun..

and again let me compliment you... your use of the flashing schematics /html etc.. very VERY nice... so much better than looking at the pages of a text book.. it definitely adds to the level of comprehension. nice work(i saved this one) -the Zook

#19 Hippie3

Hippie3

    DUNG DEALER

  • Founders
  • 40,642 posts

Posted 10 October 2006 - 10:33 AM

Ok, so far we learned how to hook up miltiple LEDs. Then we learned how to run a 555 in astable mode, now it's time to put the both lessons together.

As I stated in the 555 post it's output current is too low to light more than one LED. So how are we going to light our array with one?
Simple really we will use a transistor which is simply a device used to have a smaller current control a larger current. Actualy we are going to use a special kind of transistor...

A MOSFET, this stands for Metal Oxide Silicone Field Effect Transistor, and we are going to use it because it's gate operates on voltage not on current like the base operation of a normal transistor (yes this is english)
Without getting into the intricacies and construction of a MOSFET, this simply this means that it consumes far less power to operate than a normal transistor to run.
This equates to a longer battery life as well as total control over the LEDs.

A MOSFET looks just like a normal transistor and comes in all the standard TO-1, TO-2, TO-3 cases etc.(Transistor Outline)...

http://mycotopia.net...17&d=1159234105

This is the schematic symbol for a MOSFET...

http://mycotopia.net...18&d=1159234105

This is how you would use a MOSFET by itself to control the brightness of a LED...

http://mycotopia.net...20&d=1159234105

By turning the 1M potentiometer (pot) we bias the gate voltage more towards positive voltage or ground.
This varies the power allowed through the transistor, adjusting the voltage on the LED. And yes you could just use a similar resistor setup directly without the MOSFET but because more current would flow through the resistors a lot more power would be turned to heat (wasted).

And this is how we will be hooking our circut up..

http://mycotopia.net...16&d=1159234105

The pot here changes the frequency AND the duty cycle of the 555 timer witch in turn controls the MOSFET

Because of this the gate current of the mosfet if so low (a few millliamps) you can of course hook up dozens of them in parallel...

http://mycotopia.net...19&d=1159234105

if you want more strings than a few dozen you will need to buffer the 555's output using a transistor or MOSFET.


Now go get yourself a breadboard and start playing with those 555s.
When you get the circuit like you want buy yourself a prefboard that is wired just like your breadboard (Radio shack has them) and start soldering!!

in my next post we will look at the 555 in monostable mode and describe how you can use it to turn on a fan or other device for a pre determined time at regular intervals.
Stay tuned kiddies!



what happened to the pix ??

#20 Guest_Glasshopper_*

Guest_Glasshopper_*
  • Guest

Posted 18 October 2006 - 04:58 AM

I swear this time hippy that it wasn't me.
How can we fix it? should I re post?




Like Mycotopia? Become a member today!