Pages: 1 2 3 [4]   Go Down
Author Topic: multiplexing with pwm?  (Read 4751 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 124
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes you're right.

I tried measuring with a slightly better meter and the resistors read as 1.2ohm which is what they should be.  (1.7 is just what I measured, not the rated value)

Is there any benefit in using a capacitor in this circuit as you mentioned before?  If so how do I choose the value, and does it goes in parallel with the led?


Cheers
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 603
Posts: 33408
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

First off have a capacitor on the input of the chip to ground, 0.1uF, that will improve stability. Then a similar value from the output to ground.
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 124
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If I'm running several of these circuits from the same power source, will a single .1uF between +ve and ground suffice, as long as the voltage is within limits?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 603
Posts: 33408
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

No you need one on each device, as close to the device as possible.
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 124
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey Grumpy

Everything worked ok for version 1 of the installation the other day. Thanks loads for your help in getting there. Don't know if I ever said but these led's were for a sound reactive light installation in a club.

I now need to refine a few things so have a couple more questions if you'd be so kind smiley

I ended up using a version of firmata to interface the arduino with the control software (vvvv) and the resolution of the pwm outputs with this is only 8 bit. Turns out this isn't at all enough to do smooth and subtle transitions in brightness at the lower brightness levels as there is a very visible step between each value.  Any idea what the maximum resolution is when using pwm straight from the arduino board?

Something that would help in addition to this would be a way to electronically affect the current from the output with a sort of function curve which would mean that the spacing between steps in the lower end is smaller than the spacing at the higher end. This would give me more control over the lower brightness values which I found to be of most importance.  Is there any (simple) way to acheive this?

Cheers!
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 603
Posts: 33408
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Any idea what the maximum resolution is when using pwm straight from the arduino board?
Yes it is 8 bits. It's defined by the hardware inside the ATmega chip.

Quote
Is there any (simple) way to acheive this?
No sorry, you need external hardware if you are going to get finer resolution.
The problem is that the eye's response is not linear, look up gamma correction, but it needs more hardware resolution.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 27
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Something that would help in addition to this would be a way to electronically affect the current from the output with a sort of function curve which would mean that the spacing between steps in the lower end is smaller than the spacing at the higher end. This would give me more control over the lower brightness values which I found to be of most importance.  Is there any (simple) way to acheive this?

You might use something like a 6-bit (64 step) brightness correction table (array) to provide 64 brightness level values spanning the 256 level PWM duty cycle range.  I've always called it a gamma correction table but that really isn't a correct description.  Here's an example set of values you might try for the array;

Code:
Gamma array size: 64
 Total PWM steps: 255
Gamma correction: .74

  0,  1,  2,  2,  2,  2,  3,  3,  3,  4,
  4,  5,  5,  6,  6,  7,  8,  9,  9, 10,
 11, 12, 13, 14, 16, 17, 18, 20, 22, 23,
 25, 27, 30, 32, 34, 37, 40, 43, 46, 50,
 54, 58, 62, 66, 71, 76, 82, 88, 94,101,
108,116,124,132,141,151,162,173,184,197,
210,224,239,255
Logged

Pages: 1 2 3 [4]   Go Up
Jump to: