Lets say I have an external interrupt to the Arduino, triggering at a constant 30Hz.
At the moment, this controls two individual LED arrays, and there is a 30 Ohm rheostat on each LED array.
What Im trying to do is eliminate the rheostats (which often need twiddling), and emulate the ‘resistance’ via software, maybe via PWM.
But I dont think you can do PWM within an interrupt, because there is no Delay() available, and I cannot increase the external interrupt to trigger at say, 10KHz.
So what I was thinking, is maybe having a 555 timer chip, to do the PWM. I then control this from within the arduino interrupt, by turning it OFF, or ON and then programming it to emit PWM at a given (software controlled) rate.
I thought about a digital pot, but I cannot find any rated at 30 Ohms (min 150Ohms), and the the 32 step granualrity is presumably going to be too ineffective.
The other problem with a 555 timer, is that my understanding is that, Im not entirely sure how I can vary the duty cycle from between 0-100% at runtime. From what Ive read, you can wire it to have a duty cycle of < 50% with resistors+cap, but to then change it to > 50% you should rewire it with a different resistor/cap combination. So I wouldn’t be able to get the full 0-100% range.
There is one final problem (as always). If I went down the 555 route, I need it to emit ~800mA. Whereas the 555 can only do 220mA, so I guess Id then need the 555 to control a transistor, with the transistor switching a 7.5V power source
I cant help thinking Im maybe over engineering this, but Id really like to remove the manual rheostats from my circuit, so they can be controlled via primitive AI in the software.
Im really interested in any other ideas how to achieve this.