A quick thing or two:
- When I first selected the components for the card, I selected the LEDs for lowest price @ Q=10, not giving much thought to current consumption. I found there are much lower forward current (an order of magnitude lower!) on offer, such as Kingbright's APTD3216LSYCK and APTD3216LCGCK (Mouser #'s 604-APTD3216LSYCK & 604-APTD3216LCGCK), which seem to fit the bill, and are priced similarly at higher quantities. I'll give those a go on the next iteration.
- In trying to lower power consumption of the circuit, I set up a sleep function with a watchdog timer interrupt based wake up routine. I'm currently running the circuit at 2.3 mA when running, 3.4 - 12.8 mA when the LEDs are lit, but only managed to get the power consumption to 0.76 mA when sleep is enabled. That is probably because I'm using inverted PWM, and can't turn pins 0 & 1 to inputs and LOW - if I do the LEDs are just left half lit. I've posted a thread on the Arduino forum, but I have a sneaking suspicion that I'll have to do some changes in the circuit beside the code.
- When editing the code to add the sleep function, I had a Eureka moment: the pulsing type code, which I hard coded as a progmem lookup table, was basically a sine wave. That means, it's symmetric, and I can do away with half the table. So instead of going through the whole table, value by value, The function will look at the current numerator, than if that'll be lower than the array length the value returned will be the array cell value corresponding to the cell in the numerator location. On the other hand, if the value will be higher than the array length, the returned value will be array[(array.length - numerator)].
val = (timingVar < 100)?((byte)pgm_read_byte(pwmVal + timingVar)):((byte)pgm_read_byte(pwmVal + (200 - timingVar)));
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.