My first project: Does my plan makes sense?

Hello,
I'm planning a small project of mine, which will be the first one I'm doing with some electronics of this sort.

I would like to build a small battery powered device which can measure the distance between an object and my T-Shirt and then show this distance on a small display. The object is going to move closer and further afar. The times it traveled should be also shown on the display.

I plan to use the following components:

This is all I plan to get. Coming to my question: Is this going to work and does this make sense or is it too much or maybe too little. I am asking because I do not have any experience in this and I just want to be on the safe side ;)

Thanks a lot for your help in advance.

Are you going to use imaginary wires? Also plan on getting a copy of the Arduino Cookbook to get you started on programming a microcontroller.

No.

You show no charging circuit. You indicate a FT232RL USB to Serial communication adapter... probably because you see a USB-C connector... but this is not a battery charging module. Remove this requirement.

The chip you picked for this can only supply up to 50mA. Have you considered using a SEPIC (buck/boost) converter directly from the USB line? This link will help: All About USB-C: Introduction For Hackers | Hackaday

Good question! Thanks. These should work right (65Stk. Jumper Wire Kabel Steckbrücken für Breadboard, Steckbrett)?

Thanks for the advice! Would this work: Type-C USB 2S 3S 4S BMS 4.5V-15V 18W 2A Li Li-ion Battery Charging Module | eBay.de ?

No I haven't. I don't know what that means but I will do my research. Thanks for the link!

What does this mean exactly? Can you give an example scenario?

That's not a board, it's a chip. What board are you considering and is there a particular reason you choose it over, for example, a board with a ESP32 C3 chip, or other boards with ESP32 S3?

Many of the Seeed Studio XIAO boards use one of the various ESP32 chips and also contain battery charger chips, so you would not need a separate charger board.


So the process should look like this: I place the device on the floor and then I move, for example, a t-shirt like doing a push-up, up and down.
While doing this, the device should measure how often the t-shirt moves up and down and the distance the t-shirt traveled. Minimum distance and maximum distance and all in all what time it took is important to me.

I choose the ESP32 board because this is the one I found during my research and I've seen it in a lot of videos. As I'm totally new to this I thought it may be the best because it could provide the most information about how to code on it at etc.
I will take a look at the one you mentioned. Thank you very much!

If you are going to keep secrets, it's going to be difficult to give good advice. How do we know what board you found during your research? How do we know what videos you watched?

Hi @qeno !

I understand you want to use a ToF sensor to continousely read this distance from the sensor to a moving object (like your shirt) and retrieve the following information

  • Distance the object moved
  • Time the movement took from close to far and back again
  • Velocity of movement
  • How often did the object move back- and forward

That's possible of course but the sensor will only provide the distance in given time intervals. You (your code) will have to evaluate the distance and derive data like velocity, the point/time when the movement stops or changes direction etc. from the distance measurement.

The ToF sensor you linked provides the data via I2C interface. Most Arduino boards provide an I2C interface, there is no specific requirement to use an ESP controller, you can of course.

You should read the datasheet of the sensor: While AZ delivery's German explanations say

Reichweite: Normalmodus 0 - 1000mm, Fernmodus 0 -2000mm

the datasheet tells us something like

40 mm to 4000 mm

This minimum distance is much more realistic than zero...

Your project is surely not an easy job for a beginner but it includes some nice tasks that will remind you of physics lessons at school:

  • Time measurement
  • Distance measurement
  • Calculate velocity from distance traveled over a certain time

It will also require some math and logic coded in your sketch

  • Averaging of data/removal of false measurements
  • Detect the points where the movement changes direction
  • count up/down (forward /backward) movements
  • etc.

I was curious about continuous measurements and found this:
The St Microelectronics VL53L0X can’t measure continuously at arbitrary speed, the measurement timing budget determines the cycle time.

Typical Measurement Cycle Speed

Mode Timing per measurement Max rate
High-speed mode ~20 ms ~50 Hz
Default mode ~30–33 ms ~30 Hz
Long range ~33 ms ~30 Hz
High accuracy ~200 ms ~5 Hz

The minimum timing budget is about 20 ms, meaning the fastest measurement rate is roughly 50 measurements per second**.

The default timing budget is ~33 ms, which gives about 30 Hz updates with better reliability.

Increasing the timing budget improves accuracy and range but slows the cycle rate.

If you want decent accurate answers answer the questions the others have asked. Please realize we cannot see, touch, smell or hear your project, you have to do that for us, our preferred language is the language of electronics, schematics.

I am not trying to keep secrets. I searched through a couple pages and watched a few Videos. I didn't know this is important to you. Sorry!
One of them is this page: ESP32 Versions Explained: Which Board Should You Buy? (2026) – Esp32.co.uk I tried to choose by the specifications they give on these pages and which board seems to be the most universal, If it shouldn't work out the way I think.
(As most of the pages I visit give the same information, I'll only post this link)

I just now noticed, what you meant with the difference in board and chip. Sorry :/
I don't know yet which board to use. I will try to find this one out tomorrow.

Thanks for the advice!
Then this sensor isn't what I need. I'll look for another one. Thanks!

I try my best doing so. Thanks for your input.
I think I understand what your table says, but I do not understand what's the problem with this is for my project. 50 measurements per second seems more them enough?

Consider the end points of the shirt movement. It is going one direction for one measurement and the opposite direction for the next measurement. How will your program know there has been a change of direction between measurements?

I have the impression that the sensor you have chosen is performing quite well with respect to its price.

However, in order to find a possibly more suitable sensor, it would be helpful if you could specify the requirements in more detail:

  • Minimum distance [mm]
  • Maximum distance [mm]
  • Resolution [mm]
  • Accuracy [mm]
  • Maximum velocity of movement [mm/s]

Any Time-of-Flight sensor will have a minimum working distance which depends on its physical principle (ultrasound, laser) and its construction (e.g. the mechanical offset between a transmitter and receiver channel). Laser distance measurement for short distances usually is done by measuring the angle between transmission and reception beam (triangulation).

See here
https://www.acuitylaser.com/sensor-resources/measurement-principles/

Professional sensors do have better specifications, but they also come at a different price.

The only way to know for sure if it will work is to buy the ESP32 and the VL53L0x sensor. Install the library, try the examples and see if you can make it work. Otherwise you can wait around here and maybe someone will try it for you.

I was expecting some form of output, either direct measurement or something like what they taught me in school: 4-20mA, which I then would be able to calculate the distance from.

Thanks for your advice and the link! This is what I am looking for:

  • Minimum distance [mm]: 0 mm
  • Maximum distance [mm]: 1000-1500 mm
  • Resolution [mm]: 1 mm
  • Accuracy [mm]: 1-5 mm
  • Maximum velocity of movement [mm/s]: about 25 mm/s, maybe a bit faster. So maybe a ToF Sensor isn't the right one?

--

@PaulRB To be fully honest, I don't know which board to buy. Because of this and some other websites (ESP32-S3 Boards Compared(2026 Guide) – Esp32.co.uk) I would buy the ESP32-S3-DevKitC-1, because of the "most tutorials, broad compatibility".

I would prefer one of the Seeed Studio XIAO boards you mentioned because it makes the finished build volume smaller. But as a first build, I would guess, from my perspective, that it would make more sense to buy the DevKitC-1.

Of course you will be getting distance measurements! But how will you know which direction the shirt is moving? If you measure 6 inches on one measurement and 5 inches on the next, how will you know there has been a direction change between the two measurements?

Oh, I see. In your first post, you gave links to each of the exact components you were planning to use, except for the ESP32 which had no link. So I assumed you had a particular ESP32 board in mind but did not want to share that.

Any of the ESP32 boards would be more than "powerful" enough for your project, in computing terms. In fact, far less powerful Arduino models, like Nano V3 or Pro Micro, would also be enough.

You won't find a sensor that can measure distance down to zero mm. They either use sound or light to bounce a beam off the target and measure how long it takes to return back to the sensor. For a target that is 0 mm away, they would have to react infinitely fast. No sensor can react that fast, so they all have a minimum distance they can measure.

A minimum distance of zero does not necessarily mean that the sensor must be capable to measure from 0 ...

The sensor itself has already physical dimensions and will quite likely have a housing. How do you define your "zero plane"?

My feeling is that we still do not know enough about your application ... :wink:

Hi, @qeno
Welcome to the forum.

So basically what you project is;
To measure the distance and performance of a human doing pushups.

Did you Google.

arduino pushup counter

Tom.... :smiley: :+1: :coffee: :australia:

The Uno has the most tutorials and example code and is compatible with almost all hardware.