Drive 10 LED's with PICAXE-08M

I am looking to drive 10 LED's with a PICAXE-08M. What would be the best way of going at this? Seems I can use a standard 4XXX series CMOS IC like this puppy here 74HC4017.
Any suggestions all knowing and wise board ;)
 

gengis

New Member
Your link is to a moving target - probably changed since you used it - I can't see it.

Anyhow- how do you want the data (turn on or off) to come out?

A single 08 can control a hell of a lot of binary bits if you want (can tolerate) serial data out.

You toggle the data into the decoder (your 74 54 4X part) and the "serial in parallel out" works your leds. Most serial in, parallel out, rely on a "clock and data" you load the register(s) (they can be daisy chained) with serial bits based on the "data" line. When the clock changes state (usually down or up going transient) the data that has been loaded transfers to the next register (flip flop) - when the whole shebang is loaded, you freeze that and tell your leds to come on.

Usually the decoder part wants to see "data" (high or low) AND "clock" move the data (zero's or one's) to the next output register AND an "enable" (which freezes the output until the output data is "true." (so you don't see the counting and data loading in the output). That's how it is with TTL mos - 74/54/4000 etc..

When it comes to lighting leds (changing "flags," controlling the world ) this method can greatly exceed the output pins of an 08 with only two or three pins used.

If you need high speed (under 10 ms or so) there's some other guys that know way more than I do about that.
 

chipset

Senior Member
thats a decade counter and yes itll work if thats what you want it to do. In its basic form it will step up or down one pin at a time. With creativity you can get them to do a lot of cool things
 
thats a decade counter and yes itll work if thats what you want it to do. In its basic form it will step up or down one pin at a time. With creativity you can get them to do a lot of cool things
Seems like a fairly easy way to get things done. They are fairly cheap and my remedial level of knowledge can probably pull it off ;)
 

chipset

Senior Member
go to National Semiconductor and search LM4017. There youll figure out how they work. You can also link them on and on and drive 40 leds if you want to .

More or less every time the 4017 gets a pulse it steps up or down. They work quite well for controlling circuits that need to be activated in order. I learned how to use them in one of my first electronics projects and yes they are very simple to use. They are also very forgiving to different voltages unlike pics that have a very tight tolerance for acceptable voltage levels.
 

westaust55

Moderator
Drive 10 or more LED's with PICAXE-08M

or . . .

Consider cascading two 74HC595's.
They will allow up to 8 LED's each and data can be rippled through then latched.
Requires 3 outputs irrespective of number of 74HC595's used.
 

hippy

Ex-Staff (retired)
@ Miramax281 : The solution depends on how you want to control your 10 LED's - Will only one be on at a time or do you want more than one on at a time, will the PICAXE have to do anything else other than control LED's ?
 
@ Miramax281 : The solution depends on how you want to control your 10 LED's - Will only one be on at a time or do you want more than one on at a time, will the PICAXE have to do anything else other than control LED's ?
Well, I need to read a potentiometer and PWM out to a single MOSFET along with driving the 10 LED's.
The LED's will be used to indicate what the duty cycle is out of the PICAXE.
Seems with some multiplexing trickery this can be done with the single 08M, but I'm not 100% sure on how to pull it off... the decade counter seems to be the easiest, but the fewer the components the better :cool:
 

BCJKiwi

Senior Member
PWM and READADC will use two of the 08M's outputs and will only leave two outputs to drive the LEDs.

An LM3914 dot/bar graph driver chip and a 10 led bar display like ftp://61.222.159.252/display/CML/CML-1000200-W.pdf
may be the answer. The dot/bar driver could run off the FET output (through a divider if required depending on voltage of the load) as this chip can be set up to light dots or a bargraph in response to a voltage level.
 
PWM and READADC will use two of the 08M's outputs and will only leave two outputs to drive the LEDs.

An LM3914 dot/bar graph driver chip and a 10 led bar display like ftp://61.222.159.252/display/CML/CML-1000200-W.pdf
may be the answer. The dot/bar driver could run off the FET output (through a divider if required depending on voltage of the load) as this chip can be set up to light dots or a bargraph in response to a voltage level.

I've seen these before but was under the impression they had to be driven with analog voltage? 0%-100% PWM is not going to work with it?
Oh and I was planing on using one of those 10 segment LED bar graphs :)
 
A diode and RC smoother could feed the the analog V from the FET input (or output) to the LM3914.
I thought about that, but my lack of knowledge on RC filters kinda holds that plan up ;)

If I do go this route, what values would I need for the capacitor and resistor?
 

moxhamj

New Member
Try 10k and 0.1uF with a LM3914. And you shouldn't need a diode - just the R and the C. That will smooth the PWM and turn it into an analog voltage. If the leds flicker too much you could try 10k and 1uF.
 
Last edited:

BCJKiwi

Senior Member
@ the Dr

As we don't know what else is in the circuit, was suggesting the Diode to 'separate' the LM3914 sensor from the load or FET control circuit. An RC on the MOSFET control could cause heating in the mosfet.

If Miramax posts his code & circuit when ready, we could offer more specific advice.
 

moxhamj

New Member
Good point - I missed the bit about the mosfet as well. You can't put an analog input into a mosfet. Even a 5V gate drive on the mosfet and a 5V supply with a diode drop to 4.4V might cause some heating too.

That might change the RC network slightly - eg a standard RC network would have the signal going into the resistor and the cap to ground. With a diode you could put the R and C in parallel and feed that with the diode. There may need to be a voltage divider in there too, and regulation would be an issue. Hmm - I wish I had an electronic breadboard to explain all that better...

So yes, the schematic would be most helpful.
 
Last edited:

BCJKiwi

Senior Member
Yes, the assumption was that there would be a bleed resistor to 0V on the gate to ensure fast turn off.

Then in parallel with that bleed resistor, place a schottky low volt drop diode feeding an RC to smooth it to Analog to 0V. Since the LM3914 is looking for a 0 - 5 sense voltage that should work. The LM3914 can be adjusted/scaled (depending on the attached control network) so whatever the working range of pwm (and thus the min/max of the RC'd analog) can show full range of the 10 LEDS on the output.

DSE (or Jaycar) used to do a kit for the car which used an LM3914 and coloured LEDS to show low/normal/high battery levels where the full range on the output covered something like 9 thru 15V and could be adjusted with trimpots.
 

Mycroft2152

Senior Member
As they old saying goes, "There are many ways to skin a cat"

It all depends on the requirements, smallest, cheapest, simplest program, etc.
 
Top