Shop OBEX P1 Docs P2 Docs Learn Events
Question PWM and circut in stamp app notes 1 — Parallax Forums

Question PWM and circut in stamp app notes 1

ArchiverArchiver Posts: 46,084
edited 2002-04-06 06:46 in General Discussion
I've got an application where I need to drive 20 LED's wired in
serial off of one pin wich using pwm to output a voltage between 0
and 5V. The software is doing alot of other stuff, so I won't be able
to issue the PWM command very often to update the voltage on the pin.
I'm thinking of using a circut like is described in the basic stamp
application notes 1
http://www.google.ca/search?
q=cache:2G7CE655Hc8C:www.pond.ie/ftp/stamp1_apps/pwm.pdf+pwm+basic+sta
mp&hl=en (HTML version, no graphics)
http://www.pond.ie/ftp/stamp1_apps/pwm.pdf (PDF version with graphics)
It's the one using the ca5160 op amp to keep a constant voltage, and
I would hook the output up to some kind of transistor that could
handle the larger current load.

Problem is, that op-amp is hard to find, especially here in Canada.
Can anyone suggest a similar circut, made of easily found parts?
(i've searched the archives here & couldn't find anything)
Again, the goal is to be able to set the voltage on the circut using
one pwm command, and be able to 'forget' about it for a while
(probably up to .5 or 1 sec) but have the output stay at the voltage
it was set to.
Any help would be greatly appreciated.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-04-06 01:03
    >I've got an application where I need to drive 20 LED's wired in
    >serial off of one pin wich using pwm to output a voltage between 0
    >and 5V. The software is doing alot of other stuff, so I won't be able
    >to issue the PWM command very often to update the voltage on the pin.
    >...


    Hi, Here's a circuit that uses a common single supply op amp to
    buffer the PWM signal. A transistor is hooked up as an emitter
    follower in the feedback loop to supply the necessary led drive
    current. The PWM has to get up above the 1.5 volt threshold before
    the LEDs will start to light up.


    +6 to +9v
    |
    o
    ;
    BS2 100k 3|\|8 |
    p0 --/\/\--o
    |+\ 1 |/
    |+ | >
    | 2n2222
    0.1uf === ;--|-/|4 |\e
    | | 2|/ | |
    | | | | 510 led
    | `
    /\/\---o---/\/\-->|--;
    | | 10k |----/\/\-->|--|
    | | | x20 |
    | | `---/\/\-->|--|
    | | |
    o
    o
    o--Vss


    op-amp=1/2 LM358
    or other single-supply amp
    good for ~5ma per led x 20
    use a TO220 transistor for higher current

    -- best regards
    Tracy Allen
    electronically monitored ecosystems
    http://www.emesystems.com
    mailto:tracy@e...
  • ArchiverArchiver Posts: 46,084
    edited 2002-04-06 01:14
    Just had a thought while reading that email:

    Why not use a Sample and Hold circuit?

    You'd need two wires. "Sample", and "PWM in".

    Using a low leakage capacitor, and a CA3140 OpAmp, you would not lose the
    voltage for a VERY long time (I'm talking minutes here).

    An example circuit to use, would be the Sample and Hold circuit I use in my
    NiCad battery charger. Just remove the 555 timer, and control the 4066
    switch from the stamp. Add current driving circuitry to the output of the S
    and H cct to drive your load.

    Using S and H, you can then let the Stamp do other things, and not worry
    about refreshing the output voltage.

    Ben, Wellington, NZ.
    --
    http://www.lennard.net.nz/
    Ben Lennard, NCEE, Dip EE

    Web Hosting and Electronics R&D
    Club Coordinator, Victoria University of Wellington Hockey Club

    Hm: +64 4 972 7567
    Mb: +64 21 536 627
    87 Spencer Street
    Crofton Downs
    Wellington
    New Zealand

    "To the optimist, the glass is half full. To the pessimist, the glass is
    half empty. To the engineer, the glass is twice as big as it needs to be."

    No animals were harmed in the transmission of this email, although the
    Dog next door is living on borrowed time, let me tell you! Those of you
    with an overwhelming fear of the unknown will be gratified to learn that
    there is no hidden message revealed by reading this warning backwards.




    >From: "dholowiski" <dholowiski@y...>
    >To: basicstamps@yahoogroups.com
    >Subject: [noparse][[/noparse]basicstamps] Question PWM and circut in stamp app notes 1
    >Date: Sat, 6 Apr 2002 11:08 AM
    >

    > I've got an application where I need to drive 20 LED's wired in
    > serial off of one pin wich using pwm to output a voltage between 0
    > and 5V. The software is doing alot of other stuff, so I won't be able
    > to issue the PWM command very often to update the voltage on the pin.
    > I'm thinking of using a circut like is described in the basic stamp
    > application notes 1
    > http://www.google.ca/search?
    > q=cache:2G7CE655Hc8C:www.pond.ie/ftp/stamp1_apps/pwm.pdf+pwm+basic+sta
    > mp&hl=en (HTML version, no graphics)
    > http://www.pond.ie/ftp/stamp1_apps/pwm.pdf (PDF version with graphics)
    > It's the one using the ca5160 op amp to keep a constant voltage, and
    > I would hook the output up to some kind of transistor that could
    > handle the larger current load.
    >
    > Problem is, that op-amp is hard to find, especially here in Canada.
    > Can anyone suggest a similar circut, made of easily found parts?
    > (i've searched the archives here & couldn't find anything)
    > Again, the goal is to be able to set the voltage on the circut using
    > one pwm command, and be able to 'forget' about it for a while
    > (probably up to .5 or 1 sec) but have the output stay at the voltage
    > it was set to.
    > Any help would be greatly appreciated.
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    > Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-04-06 02:19
    Thanks, this sounds like exactly what i want. (Thanks as well Ben,
    but your circut looks a little complicated, I have to do this part 3X
    over)
    I was about to reply and say I can't understand the schematic you
    typed out, but it turns out it just got messed up on my screen. When
    I hit the reply button it changed the formatting & makes perfect
    sense now.
    I'm probably (hopefully) going to build it tomorrow, i'll let you
    know how it works out.
    Again, thanks very much.
    --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > >I've got an application where I need to drive 20 LED's wired in
    > >serial off of one pin wich using pwm to output a voltage between 0
    > >and 5V. The software is doing alot of other stuff, so I won't be
    able
    > >to issue the PWM command very often to update the voltage on the
    pin.
    > >...
    >
    >
    > Hi, Here's a circuit that uses a common single supply op amp to
    > buffer the PWM signal. A transistor is hooked up as an emitter
    > follower in the feedback loop to supply the necessary led drive
    > current. The PWM has to get up above the 1.5 volt threshold before
    > the LEDs will start to light up.
    >
    >
    > +6 to +9v
    > |
    > o
    ;
    > BS2 100k 3|\|8 |
    > p0 --/\/\--o
    |+\ 1 |/
    > |+ | >
    | 2n2222
    > 0.1uf === ;--|-/|4 |\e
    > | | 2|/ | |
    > | | | | 510 led
    > | `
    /\/\---o---/\/\-->|--;
    > | | 10k |----/\/\-->|--|
    > | | | x20 |
    > | | `---/\/\-->|--|
    > | | |
    >
    o
    o
    o--Vss
    >
    >
    > op-amp=1/2 LM358
    > or other single-supply amp
    > good for ~5ma per led x 20
    > use a TO220 transistor for higher current
    >
    > -- best regards
    > Tracy Allen
    > electronically monitored ecosystems
    > http://www.emesystems.com
    > mailto:tracy@e...
  • ArchiverArchiver Posts: 46,084
    edited 2002-04-06 02:35
    Ok, one last question, and I think I know the answer already. I can
    just take the 2n2222 and replace it directly with the TO220 (of
    course making sure pins/polarity is right) without making any changes
    to the circut, right? My orange LED's need 20ma each X 20 LED's.

    --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > >I've got an application where I need to drive 20 LED's wired in
    > >serial off of one pin wich using pwm to output a voltage between 0
    > >and 5V. The software is doing alot of other stuff, so I won't be
    able
    > >to issue the PWM command very often to update the voltage on the
    pin.
    > >...
    >
    >
    > Hi, Here's a circuit that uses a common single supply op amp to
    > buffer the PWM signal. A transistor is hooked up as an emitter
    > follower in the feedback loop to supply the necessary led drive
    > current. The PWM has to get up above the 1.5 volt threshold before
    > the LEDs will start to light up.
    >
    >
    > +6 to +9v
    > |
    > o
    ;
    > BS2 100k 3|\|8 |
    > p0 --/\/\--o
    |+\ 1 |/
    > |+ | >
    | 2n2222
    > 0.1uf === ;--|-/|4 |\e
    > | | 2|/ | |
    > | | | | 510 led
    > | `
    /\/\---o---/\/\-->|--;
    > | | 10k |----/\/\-->|--|
    > | | | x20 |
    > | | `---/\/\-->|--|
    > | | |
    >
    o
    o
    o--Vss
    >
    >
    > op-amp=1/2 LM358
    > or other single-supply amp
    > good for ~5ma per led x 20
    > use a TO220 transistor for higher current
    >
    > -- best regards
    > Tracy Allen
    > electronically monitored ecosystems
    > http://www.emesystems.com
    > mailto:tracy@e...
  • ArchiverArchiver Posts: 46,084
    edited 2002-04-06 03:49
    Consider a PAK-V. You get 8 channels of PWM that you can easily control
    from the Stamp. They all run all the time. User SEROUT to control them.
    http://www.al-williams.com/awce/pak5.htm

    Al Williams
    AWC
    * Floating point math for the Stamp, PIC, SX, or any microcontroller
    http://www.al-williams.com/awce/pak1.htm



    >
    Original Message
    > From: dholowiski [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=3ZeyOD4J6IWQEsOxxapHJsJUL2IFrfrYBuXo0N3fiIdluSwtkqsrxNXK-NnP-ZttEBtJScQ-bGFiGmtxAA]dholowiski@y...[/url
    > Sent: Friday, April 05, 2002 7:20 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] Re: Question PWM and circut in stamp
    > app notes 1
    >
    >
    > Thanks, this sounds like exactly what i want. (Thanks as well Ben,
    > but your circut looks a little complicated, I have to do this part 3X
    > over)
    > I was about to reply and say I can't understand the schematic you
    > typed out, but it turns out it just got messed up on my screen. When
    > I hit the reply button it changed the formatting & makes perfect
    > sense now.
    > I'm probably (hopefully) going to build it tomorrow, i'll let you
    > know how it works out.
    > Again, thanks very much.
    > --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > > >I've got an application where I need to drive 20 LED's wired in
    > > >serial off of one pin wich using pwm to output a voltage between 0
    > > >and 5V. The software is doing alot of other stuff, so I won't be
    > able
    > > >to issue the PWM command very often to update the voltage on the
    > pin.
    > > >...
    > >
    > >
    > > Hi, Here's a circuit that uses a common single supply op amp to
    > > buffer the PWM signal. A transistor is hooked up as an emitter
    > > follower in the feedback loop to supply the necessary led drive
    > > current. The PWM has to get up above the 1.5 volt threshold before
    > > the LEDs will start to light up.
    > >
    > >
    > > +6 to +9v
    > > |
    > > o
    ;
    > > BS2 100k 3|\|8 |
    > > p0 --/\/\--o
    |+\ 1 |/
    > > |+ | >
    | 2n2222
    > > 0.1uf === ;--|-/|4 |\e
    > > | | 2|/ | |
    > > | | | | 510 led
    > > | `
    /\/\---o---/\/\-->|--;
    > > | | 10k |----/\/\-->|--|
    > > | | | x20 |
    > > | | `---/\/\-->|--|
    > > | | |
    > >
    o
    o
    o--Vss
    > >
    > >
    > > op-amp=1/2 LM358
    > > or other single-supply amp
    > > good for ~5ma per led x 20
    > > use a TO220 transistor for higher current
    > >
    > > -- best regards
    > > Tracy Allen
    > > electronically monitored ecosystems
    > > http://www.emesystems.com
    > > mailto:tracy@e...
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the
    > Subject and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2002-04-06 06:46
    >Ok, one last question, and I think I know the answer already. I can
    >just take the 2n2222 and replace it directly with the TO220 (of
    >course making sure pins/polarity is right) without making any changes
    >to the circut, right? My orange LED's need 20ma each X 20 LED's.

    That's 400 ma of total current. Zetex makes superb high gain, high
    transistors (e.g. ZTX1051, from digikey), and even one of their TO92
    superbeta transistors would run circles around the 2n2222. If you
    use a TO220, find one with high (>100) gain, or even an NPN
    darlington transistor. You can also use an N-channel mosfet as a
    source follower in that same circuit, but it should be one with a Vgs
    threshold of 3 volts or less. Feel free to ask if you have further
    questions about the options, or about a specific part you have at
    hand.

    -- Tracy



    >
    >--- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > > >I've got an application where I need to drive 20 LED's wired in
    > > >serial off of one pin wich using pwm to output a voltage between 0
    > > >and 5V. The software is doing alot of other stuff, so I won't be
    >able
    > > >to issue the PWM command very often to update the voltage on the
    >pin.
    > > >...
    > >
    > >
    > > Hi, Here's a circuit that uses a common single supply op amp to
    > > buffer the PWM signal. A transistor is hooked up as an emitter
    > > follower in the feedback loop to supply the necessary led drive
    > > current. The PWM has to get up above the 1.5 volt threshold before
    > > the LEDs will start to light up.
    > >
    > >
    > > +6 to +9v
    > > |
    > > o
    ;
    > > BS2 100k 3|\|8 |
    > > p0 --/\/\--o
    |+\ 1 |/
    > > |+ | >
    | 2n2222
    > > 0.1uf === ;--|-/|4 |\e
    > > | | 2|/ | |
    > > | | | | 510 led
    > > | `
    /\/\---o---/\/\-->|--;
    > > | | 10k |----/\/\-->|--|
    > > | | | x20 |
    > > | | `---/\/\-->|--|
    > > | | |
    > >
    o
    o
    o--Vss
    > >
    > >
    > > op-amp=1/2 LM358
    > > or other single-supply amp
    > > good for ~5ma per led x 20
    > > use a TO220 transistor for higher current
    > >
    > > -- best regards
    > > Tracy Allen
    > > electronically monitored ecosystems
    > > http://www.emesystems.com
    > > mailto:tracy@e...
    >
    >
    >To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    >from the same email address that you subscribed. Text in the
    >Subject and Body of the message will be ignored.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Sign In or Register to comment.