tetsujin
Active Member
- Joined
- Jun 26, 2009
- Messages
- 102
For various projects of mine I've been working on a design for a microcontroller board. The problem of trying to fit a circuit board into some of these models (not super-small models, just fairly dense with multi-layered parts) has led me to try to make this thing as small as possible. The current version is something like 11mm x 10mm.
The basic idea of how the board will work goes like this: on the board is a tiny microcontroller. From the board, four lines are run to some accessible points on the model exterior: two for power, and two for data. The data lines can be used to issue instructions to the board, change the state of its outputs, and so on. I haven't written the software for the data lines yet, but the plan is to use low-speed I2C, which would allow me to connect a bunch of these things onto a single bus and address them individually.
The other four I/O lines of the controller go to operate LEDs and such. The initial plan for using these I/O lines was that the board would incorporate pull-up resistors, which would also act as current-limiting resistors for the LEDs connected to the line...
The problem I'm running into is basically one of power economy: each I/O line from the microcontroller can only feed or sink up to 20mA of current. That means that making one output drive four white LEDs requires operating each LED at no more than 5mA (I can't hook up the white LEDs in series because the supply voltage to the controller board can only be up to about 6V - which isn't enough for two white LEDs plus a current-limiting resistor... And additionally, the initial design (having the current-limiting resistors do double duty as pull-up resistors) was a problem anyway: the result would be that when the board pulls that output low, more than 20mA would flow through that resistor and into the I/O pin - so the "low" state has to be the one that turns LEDs on, and the LED needs its own current-limiting resistor somewhere. I seem to have run out of space to place such a thing on the board...
I'm trying to come up with a good solution to the power limit issue so the board can drive a larger number of white LEDs. One possibility that comes to mind is to drive the board at a higher voltage: 12V perhaps. This would require adding a voltage regulator to the board, however, to give the board its 5-6V supply... But if I did that, then I'd be able to connect two or three white LEDs in series, connect the anode end to +12V, and the cathode end through a resistor to an open-collector output pin of the microcontroller... If the controller pin sinks up to 20mA in the low state, then those three LEDs could all run at full brightness.
Another option might be to add a LED driver IC, either a constant-current source or just a buffer that would give me more output current than I can get from the microcontroller I/O... This would mean adding a second circuit board, I guess... And using a current source might mean that I'd have to run a greater number of lines from the controller to the various LEDs, in order to get the power I need...
So it's a bit of a puzzle at the moment. I'm not entirely sure what I'm going to do. In current projects I could probably get by with the current 6V power supply, running white LEDs at half power and using one I/O line for each two LEDs... But it might make more sense to change the plan to a 12V supply sooner rather than later, and redesign the board to incorporate a regulator. I suppose I have some time to figure it out...
The basic idea of how the board will work goes like this: on the board is a tiny microcontroller. From the board, four lines are run to some accessible points on the model exterior: two for power, and two for data. The data lines can be used to issue instructions to the board, change the state of its outputs, and so on. I haven't written the software for the data lines yet, but the plan is to use low-speed I2C, which would allow me to connect a bunch of these things onto a single bus and address them individually.
The other four I/O lines of the controller go to operate LEDs and such. The initial plan for using these I/O lines was that the board would incorporate pull-up resistors, which would also act as current-limiting resistors for the LEDs connected to the line...
The problem I'm running into is basically one of power economy: each I/O line from the microcontroller can only feed or sink up to 20mA of current. That means that making one output drive four white LEDs requires operating each LED at no more than 5mA (I can't hook up the white LEDs in series because the supply voltage to the controller board can only be up to about 6V - which isn't enough for two white LEDs plus a current-limiting resistor... And additionally, the initial design (having the current-limiting resistors do double duty as pull-up resistors) was a problem anyway: the result would be that when the board pulls that output low, more than 20mA would flow through that resistor and into the I/O pin - so the "low" state has to be the one that turns LEDs on, and the LED needs its own current-limiting resistor somewhere. I seem to have run out of space to place such a thing on the board...
I'm trying to come up with a good solution to the power limit issue so the board can drive a larger number of white LEDs. One possibility that comes to mind is to drive the board at a higher voltage: 12V perhaps. This would require adding a voltage regulator to the board, however, to give the board its 5-6V supply... But if I did that, then I'd be able to connect two or three white LEDs in series, connect the anode end to +12V, and the cathode end through a resistor to an open-collector output pin of the microcontroller... If the controller pin sinks up to 20mA in the low state, then those three LEDs could all run at full brightness.
Another option might be to add a LED driver IC, either a constant-current source or just a buffer that would give me more output current than I can get from the microcontroller I/O... This would mean adding a second circuit board, I guess... And using a current source might mean that I'd have to run a greater number of lines from the controller to the various LEDs, in order to get the power I need...
So it's a bit of a puzzle at the moment. I'm not entirely sure what I'm going to do. In current projects I could probably get by with the current 6V power supply, running white LEDs at half power and using one I/O line for each two LEDs... But it might make more sense to change the plan to a 12V supply sooner rather than later, and redesign the board to incorporate a regulator. I suppose I have some time to figure it out...