- I've not done any electronics related projects recently.
- I've not done much programming with my kids recently.
(*Push ups for you readers in North America)
I saw you can buy one from Amazon and there are some available as smart phone apps but this isn't the Geek Dad way; I wanted to build one with a Raspberry Pi, program it in Scratch and use some electronics. Ideas:
- Mount a light dependent resistor - as I go down it blocks out light from the LDR, as I go up it allows light again and counts a press up.
- Use a camera and a QR code. As I go down it reads the QR code and counts a press up.
- Use an ultra sonic sensor to measure distance as I go up and down.
The resistors shown on the breadboard diagram on Cymplecy's site are essential to stop you blowing up your Raspberry Pi; they create a potential divider to reduce the +5V output from the HC-SR04 to a GPIO friendly 3.3V. The resistors are:
- Brown-Black-Red = 1kOhms
- Red-Red-Red = 2.2kOhms
The system works brilliantly and with this code block you can get Scratch to show the measurement from the ultra sonic sensor and move the Scratch Cat around.
So this worked beautifully, next I needed a robust housing for the press up counting machine to avoid me breaking it. Enter Lego, the tool of tinkerers everywhere. Here's a series of before, during and after shots:
- Changed the background to make it look better.
- Added a sound at the start to tell you that "It's press up time!".
- Added If statements to detect each Press Up (up to 10) and play an audio message with the number ("1" for the first press up, "5" for the fifth etc).
- Added some motivational (semi-abusive) messages to keep you going.
- Added a "Well Done" message at the end.