My initial plan to control the pinball machine was so have a computer communicate through a USB link to control all my electronics. Apparently, that's pretty difficult. Thankfully, microcontrollers exist. Microcontrollers are, in essence, programmable chips. Kind of like a mini-computer that controls the voltages to a number of pins or reads the voltages off those pins. Start varying voltages and you've got signals.
I borrowed a Arduino microcontroller from a friend of mine who happens to be an electronics wizz. I did a couple basic things with it. I started with the all important turning on a LED (with a resistor this time!). Then I used the transistors from my now disassembled electronics kit, to power the LEDs from a power source other than the microcontroller itself as it can only supply so much power. The Arduino's software is C based which is really close to Java which is the only programming language I learned in class. Lucky.
Quickly, I realized that for my overly ambitious pinball project the regular Arduino was not enough. I ended up purchasing the Arduino Mega which has many more pin outs than the regular Arduino. Mine is not a 'real' Arduino Mega, I got the Chinese knockoff but it works fine. The only problem I've had is that one bank of pins are not exactly set at the standard spacing, but that's it. I also purchased shift registers, IC 74HC595N. This IC is serial in - parallel out. This means that I send a signal set on a clock to the IC, then based on that serial signal it will set the outputs to HIGH or LOW depending on the signal. So, for example, if I send a signal such as 10001001 the IC sets it's last output as HIGH; it's 7th, 6th, and 5th, as LOW; 4th as HIGH; 3rd and 2nd as LOW; and finally it's first as HIGH. The IC runs on the input of 3 pins: data, clock, and latch. The data sends the signal, the clock deliniates between the bits in the signal, and the latch locks in the information. This IC can also be 'Daisy Chained' together so you can input longer signals or more bits, to control more outputs with the same three pins. You could technically daisy chain an infinite amount of 595s together but the more you connect together the longer it takes to change the outputs. I played around with the shift registers for a bit and made a program to display different patters of lights.
I borrowed a Arduino microcontroller from a friend of mine who happens to be an electronics wizz. I did a couple basic things with it. I started with the all important turning on a LED (with a resistor this time!). Then I used the transistors from my now disassembled electronics kit, to power the LEDs from a power source other than the microcontroller itself as it can only supply so much power. The Arduino's software is C based which is really close to Java which is the only programming language I learned in class. Lucky.
Quickly, I realized that for my overly ambitious pinball project the regular Arduino was not enough. I ended up purchasing the Arduino Mega which has many more pin outs than the regular Arduino. Mine is not a 'real' Arduino Mega, I got the Chinese knockoff but it works fine. The only problem I've had is that one bank of pins are not exactly set at the standard spacing, but that's it. I also purchased shift registers, IC 74HC595N. This IC is serial in - parallel out. This means that I send a signal set on a clock to the IC, then based on that serial signal it will set the outputs to HIGH or LOW depending on the signal. So, for example, if I send a signal such as 10001001 the IC sets it's last output as HIGH; it's 7th, 6th, and 5th, as LOW; 4th as HIGH; 3rd and 2nd as LOW; and finally it's first as HIGH. The IC runs on the input of 3 pins: data, clock, and latch. The data sends the signal, the clock deliniates between the bits in the signal, and the latch locks in the information. This IC can also be 'Daisy Chained' together so you can input longer signals or more bits, to control more outputs with the same three pins. You could technically daisy chain an infinite amount of 595s together but the more you connect together the longer it takes to change the outputs. I played around with the shift registers for a bit and made a program to display different patters of lights.
The Arduino Mega using a shift register to control 8 LEDs.
Comments
Post a Comment