Simple Arduino Sit-up Judge
by onetrueandrew in Circuits > Arduino
1557 Views, 3 Favorites, 0 Comments
Simple Arduino Sit-up Judge
![cover.png](/proxy/?url=https://content.instructables.com/FXU/CNDY/KC68BMTF/FXUCNDYKC68BMTF.png&filename=cover.png)
This simple Arduino setup and sketch will judge just how UP a sit-up needs to be to count. It will play one tone when you recline enough, and another when you sit up enough for a full crunch to count!
Ever get into an unnecessarily heated debate about someone else's crunches not counting? Me neither. But this gadget runs off a 9V battery and is light enough to hold to your chest or be placed in a chest pocket, and do the sit-up judging for you.
Supplies
- Arduino Uno
- Tilt sensor (aka inclinometer)
- Piezzo buzzer (passive buzzer)
- 9V battery & barrel connector
- M-F jumper wire
Step 1: Wiring Up
![situp_bb.png](/proxy/?url=https://content.instructables.com/FJ3/5R14/KC68BMN0/FJ35R14KC68BMN0.png&filename=situp_bb.png)
![side.jpg](/proxy/?url=https://content.instructables.com/FFK/FH81/KC68BMMZ/FFKFH81KC68BMMZ.jpg&filename=side.jpg)
![top.jpg](/proxy/?url=https://content.instructables.com/FLZ/Y1L3/KC68BMN2/FLZY1L3KC68BMN2.jpg&filename=top.jpg)
The Arduino Uno can be powered by a 9V battery using a barrel power connector. Stick a cheap tilt sensor in the GND and Pin13 terminals, and wire the piezzo buzzer to the other GND and Pin6. The buzzer will only work if the negative (-ve) side is grounded.
Step 2: Code
In the Arduino IDE, load this code and upload it to the Uno:
int inPin = 13;
int reading;
const int SpeakerPin = 6;
int lastsensorValue;
void setup() {
pinMode (inPin, INPUT);
}
void loop () {
delay(100);
reading = digitalRead(inPin);
if (reading == 1 && lastsensorValue == 0) {
tone(SpeakerPin, 1500, 300);
delay(500);
lastsensorValue = 1;
}
if (reading == 0 && lastsensorValue == 1) {
tone(SpeakerPin, 200, 300);
delay(500);
lastsensorValue = 0;
}
else {
delay(1);
}
}
Step 3: Test & Enjoy
![chest.jpg](/proxy/?url=https://content.instructables.com/FME/UVBA/KC68BMMW/FMEUVBAKC68BMMW.jpg&filename=chest.jpg)
The buzzer will play one tone when you recline enough, and another tone when you sit up enough for a full crunch to count. Connecting the tilt sensor directly into the Uno headers leaves little room for the sensor to tilt away from the Uno board.