I want to use this thread as a log and planning place for my first project. I am a complete beginner in this. I have no engineering background and don't know much about electrical wiring etc. I haven't even bought my Arduino yet. But I am a fast learner and I have programming experience. I believe the practical side of things will be harder for me than writing the code.
I am in need of assistance on everything from what parts I need to buy, to what things I need to think about before using them. I will of course not expect anybody to just hand out this information and will ask well-researched questions in each case.
My very first project will be a little system to alert me when I have reached the proper depth in my squat while working out. I have hip problems and can't go very deep, but it's too easy to go too shallow. I am going to use a piezo buzzer for an audible cue. The buzzer will sound a short beep when an ultrasonic sensor registers a significant change in distance to the object in front of it. That is when my butt "breaks the beam" so to speak.
I'll also add an LCD screen that will show the number of times the beam has been broken (number of reps), as well as a reset button for the counter. I am thinking of powering it all with a 9V battery, as it will only be on a few minutes a couple of times a week. Maybe I can have a power button to only have it on during a squat set, and not in the rest periods.
A nice addition would be to make a pretty box for the whole thing.
My first task is to read up on how to draw schematics of circuits and try to draw one by hand to see if I have understood the basics. I am probably going to miss a few crucial parts, and I am probably not going to understand why I need them. I am hoping this forum will provide much-needed education as to why I want a resistor there, a capacitor here, etc.
I also already have a great idea (in my mind) for my second project, but that will have to wait!
I'll just do some trial and error to determine the height the ultrasonic sensor needs to be at to get it to register my butt/thighs as I reach the proper depth. I will mark out foot position on the floor using tape so that I am always at the same distance from the sensor (front to back so to speak).
The sensor will be placed to my left or right side, on the rack, and aimed at the rack frame. So the ultrasonic sensor will have something in front of it at about 1 meter (the rack frame), and when I squat down my body will be closer, let's say 30 cm. This will be registered as good depth.
You know, "beam" is probably the wrong word for it, but see my other answer and I'm sure you will understand what I mean. I am going to use an HC-SR04 ultrasonic sensor.
Yes, it was the wrong word. I am not here to argue. I am just trying to plan out my first project. When the ultrasonic sensor detects my body in front of it, that will sound the buzzer. When it's out of the way again, I increase the repetition counter.
You could do it without any hardware and just use a laptop with web-cam, (or raspberry pi, or cell phone)
This video shows you how to build Pose Estimation models that can trigger a sound or something once a joint angle has been met.
It might be easier to build with Arduino if you don't have any experience with python.
Thanks for sharing that. It's really cool!
This first project is going to be sort of a learning curve for my next one, which will also use an ultrasonic sensor. Also, I would like to make it small, simple and not too comprehensive. But that surely is a thing to try later!
That's a good point. I don't think it will matter much in this case? I have no idea, but I don't need millimeter precision. How would I figure out the error margin? Are there other sensors that don't need reflectors etc. that are better for this job? I don't want to run cables to the other side of the rack.
You could also use a TOF Rangefinder.. like this one for $20-40
You could stand on top of it and it will give you the reading of distance (in cm) to your butt. When you hit 30cm or whatever threshold you could trigger a buzzer/chime.
The problem that is being explained to you with the ultrasonic sensor, and far worse for the TOF sensor, is that throughout movement you must keep it accurately aimed at a hard reflective surface that is perpendicular to the beam.
In particular, it may or may not respond in any way reliably to your body or clothing.
I think using an HC-SR04 will probably work as the OP intended, with some fiddling. It is certainly inexpensive and easy enough to test, so no great loss if it doesn't work.
For starters, I'd keep it very simple: buy one and a Nano, and use the NewPing library. Put the HC on the edge of a chair or a box, break the "beam" with your butt, and watch the stream of distances on the serial monitor.
Try it with the sensor at various distances from your butt.
See how sensitive the results are to the angle of the beam relative to horizontal, so you know how accurately you need to "level" it each time you use it (if you will remove it and then re-install it, or if it can get "misaimed" by bumping it).
See how sensitive is to the position of your butt relative to the beam. E.g., if you are too far back, you'll break it with your thighs, not your butt.
Try it with various timeouts (in NewPing, that's the max distance you enter as a parameter, beyond which it gives up waiting for a return ping). I doubt it needs to be aimed at a hard reflective surface to do the job.
See if it reliably indicates a detectable change in distance with each break that could be used to trigger a buzzer and counter. If it doesn't, well, you learned something, and there's always plan B........
That's also a solution, yes! But seems more intricate to make from a practical standpoint. The idea for this actually came about after remembering a toy that we had as kids. It was very similar to this:
I don't know what kind of sensor that toy uses? Because that would certainly be accurate enough for my needs. I think my reaction time and speed of descent will be a bigger source of error than the cone of response. This is only based on my memories of the accuracy of that toy.
As long as my feet are at the same place each time, and the device is mounted in the same spot, at the same angle, this should be fine.
And as you say, it's inexpensive to test, very fun to learn about, and really not a life and death situation. I am using this project to learn Arduino, and if I can get a semi-accurate sensor, that's great.