Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Which Route to Take?

Status
Not open for further replies.
Hi Guys,

Lets say I have an LED that I want to control via my computer. I've got a simple program that enables me to turn it on or off. Lets say I'm using the parallel port to control the LED. If I do something really basic like connecting an LED to one of the output pins on the parallel port, then I will need to be constantly supplying a voltage to it to keep it on i.e. sending 1's over the parallel port in intervals that would ensure that it looks like it's constantly getting a voltage.

This seems very inefficient to both from having to constantly supply power to it through the computer and the fact that I'm using bandwidth of the parallel port. When would it be worth my time to design a circuit (excuse the ingorance, I'm noob) but a circuit that has a ?controller? IC as well as other components I would imagine like capacitors etc that would then effectively only ever receive state change signals i.e. to turn the LED on or off. Then I can for example use solar panels for power to light my LEDs.

From my understanding, LEDs are not very power hungry, so maybe this setup is too elaborate but I'm trying to figure out how you would approach this problem when the question comes to scaling? For one LED this is probably way overkill, but for hundreds?

The other thing is, it doesn't necessarily have to be a parallel port, that's just an example that I understand that I'm pretty comfortable in being able to build a working LED contrallable from my PC. Ethernet might be a better option simply because I can send more data without having to worry about reaching the maximum limits of capacity of the "infrastructure".
 
Serial port has few lines that can be controlled directly by the computer. You still will need some sort of circuit to limit LED current, but this might be as simple as single resistor.

If you need hundreds, it's probably good idea to use a microcontroller which communicates to the computer and turns LEDs on and off as directed.
 
You need to pick a "reasonable" number to get an idea as to what technology to use.
5 x 7 or even more can be multiplexed. Row and colum data.

An LCD controller has lots of pixels and it that's what you want to do in terms of the # of LED's, that's another can of worms.
One way might be to use a dual port RAM. These memory chips can write from one set of data lines and read from another. You can write the data at your leisure, but the reading and displaying would occur superfast and the LED would appear to be continuously on.
 
When driving a LED from a parallel port pin you do not have to keep rewriting the state of the LED (on off) over and over again. The port pin has a latch behind it. You write to it once, and it retains the state until the power goes off...

If you want more LEDs, each one can have its own latched bit. This is the basis of KISS's suggestion of using a RAM, where each bit in the RAM drives one LED.
 
If I have 2 LEDs which I want to control separately (assuming of course we're just dealing with two states - on and off, maybe someone has invented a third state that I'm not aware of!), I'll need 4 bits correct?

What about if I have an on off button as well. This would be an input, so wouldn't affect the number of output bits correct? So effectively, I'll need a microcontroller that is able to handle 4 bits out and 2 bits in? i.e. I'll need a microcontroller that has both ins and outs as discussed?

So getting a 32 bit microcontroller would be totally overkill?

I'm just trying to get my head around microcontroller selection.
 
2 states = base 2 = binary

2 LEDS = 2 binary digits = 2 bits

States are:
00
01
10
11

in base 2 and 0,1,2 and 3 in base 10
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top