Skip to main content

Programmer Turns Raspberry Pi CPU Into a Button

Raspberry Pi
(Image credit: Mcllrn)

Making cool projects on the Raspberry Pi is more often than not the whole point of having one. The single-board computer's 40 GPIO pins make it possible to attach a seemingly endless selection of external sensors, buttons and more but maker Mcllrn decided this was no longer necessary. Using nothing more than the CPU by itself, Mcllrn has managed to turn the processor into a functioning button you can use for input in any Python program. 

Add this to our list of things you can do with a Raspberry Pi that you probably should not do. In the spirit of pushing the Pi to its limits, we had to feature this project as it’s one of the most clever uses of the CPU we’ve seen so far.

The button “presses” are registered by constantly monitoring the temperature of the CPU. When Mcllrn touches the processor with a bare finger, the temperature lowers. This temperature change is enough to detect and register a specific response. A simple Python script demonstrates the input recognition in the demo video shared by Mcllrn.

Some of the best Raspberry Pi projects are the ones you can recreate at home but you may want to slow down before you begin poking your processor. It’s definitely impressive that something like the CPU can be used in such a way that deviates so far from its original purpose. However, this setup is far from optimal in a practical setting. Continuous use could damage the processor, especially when factoring in hazards like static.

Check out the original Reddit thread to get a closer look at this awesome CPU button project and see it in action. 

  • Nolonar
    When Mcllrn touches the processor with a bare finger, the temperature rises.
    It's actually the other way around. The finger cools the CPU down.

    According to the OP on Reddit:
    As I’m touching the CPU, its temperature drops, I’m detecting those drops and registering it as a “button press” which changes the color of the font on the screen
    Reply
  • klarkent
    I find it kind of incredible that people in Tom's Hardware think that a finger could raise the CPU temperature 😅 unless you're lava man... Sure!
    Reply
  • JWNoctis
    Comes winter and this could easily become a fry-my-Pi-with-static-electricity button.

    Intriguing, but do use caution.
    Reply
  • TerryLaze
    JWNoctis said:
    Comes winter and this could easily become a fry-my-Pi-with-static-electricity button.

    Intriguing, but do use caution.
    As long as you only touch the heat sink it should be safe, I mean we slap big chunks of metal on there, if it would let electricity through we would have a very bad time with CPUs in general.
    Reply