After building the first prototype I collected all my old flashes I got over the years and had four more slaveflash-triggers to built.
I already figured out an PCB-Layout for the SOIC-version of the attiny 24. But the biggest parts in the design are actually the hex-switch and the optocoupler, so it would make no sense to substitute only the microcontroller by a smaller one. Instead I replaced the hex-switch by a learning mode in software and also replaced the power source.
By replacing the 7805 voltage controller by a button cell with 3V, the power consumption was reduced from 2mA to below 0.5mA without the LED on.
So here it is: Let's got started!
Step 1: Changes in the schematics
- The complete voltage controller section is deleted.
- The hex-switch is replaced by nothing.
- The reset-button
- the flash-detector
- the status-Led
- and the optocoupler.
Step 2: The software
Also the software has changed a bit. The function to read out the hex-switch was omitted, instead two small if-statements were added in the timer overflow interrupt routine. And this is how it works:
After startup the variable "flashesneeded" is zero, that means unset. As long as this is the case the trigger waits to learn how many flashes there will be. The trigger will detect every flash and count it. After firing your real flash once you have to wait for the timer overflow (~1s). Then the if-function will recognize that there were flashes detected while the flashesneeded-variable is still zero. In this case the number of flashes detected will be written to flashesneeded and the learning mode is done. Now the variable differs from zero and no more learning occurs. To learn another number of preflashes only hit the reset button to restart the microcontroller.
It's so easy and simple!
And it saves you a lot of money!