
“A speaker works by activating an electromagnet which is nearby a “regular” magnet. This produces vibration, resulting in sound. So if instead of supplying current to the speaker, we can produce current (if very little) by moving the speaker itsself. This current can then be detected and interpreted by a microcontroller such as the Arduino.”