In my senior engineering design class for high school, my teacher bought a toaster oven and microcontroller and tasked my group to make surface mount digital dice kit for him to teach surface mount soldering to his digital electronics classes. He bought a couple kits from Beta Layout, but since the parts are discontinued, it is rather hard to reverse engineer.
I found a through hole soldering dice kit on spark fun (https://www.sparkfun.com/products/10212) and found that I could easily convert this to a surface mount kit, especially because the design is open source. However, I ran into an issue, the sparkfun dice rolls using a piezo assembly which is not practical for our kit. I was wondering if there were any professional electrical engineers that would be willing to help my group understand the circuitry behind a piezo, and how I might go about replacing it with a push button. (SPST?, SPDT?)
Best Answer
You don't really need to understand how the piezo works, because a button is much simpler. Just take out everything connected to the piezo (
R5
andD1
) and replace it with a SPST, normally-open momentary button. Connect one button pin to theGP0
pin and the other end to ground.You'll have to change the firmware to enable the internal pullup on
GP0
, to use it as a digital instead of analog input, and to use some other source of randomness. Maybe some sort of timer during debounce.