My PCBs from Allpcb.com and the components have arrived a while ago, but I had to delay the assembly due to some unrelated stuff.
Finally the assembly have started.
The PCBs are in excellent condition -- AllPCB quality, as always, very good:
The final wiring diagram is as following:
Each of the 6 rear buttons has an optointerrupter, with the LED connected to the corresponding Arduino pin via a 1.1К resistor, and the photo-transistors connected to the pin 15 in parallel. The pin is pulled up by 10K resistor. To test a certain button, Arduino momentarily pulls up the control wire of corresponding LED, waits for 1 ms, then reads voltage on the pin 15. If the switch is "not closed" (that is no chopper between the LED and the photo-transistor) pin 15 will be low. If the switch is "closed", wire will be high. After switching the LED off, Arduiono further waits 1 ms, so the photo-transistor can lock completely, after that, the next button is tested, and so on.
I preferred this method over constantly shining LEDs on the photo-transistors, as only one LED is lit at the time, thus the LED power consumption is 2 mA instead of 12.
In the original PCB I made a mistake wiring 5V to the Arduino directly and not through the USB port. It was discovered that without 5V on the USB pin 1 Arduino Micro Pro does not connect to the PC. I fixed this by soldering the 5V wire to the board and cutting the trace to Arduino pin.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.