Offline Coding activities for Kids aged 5 to 8. Now in a Book format
STEAM projectsHavi ControllerCoding

How to make a pushup counter using python and Havi Controller

Last Updated on 27/02/26
pushup-counter-feature-image.jpg

pushup counter banner image

Regular exercise helps the body stay strong, active, and healthy.

Simple movements like stretching, jumping, or doing push-ups improve strength, balance, and energy. Exercise also helps children feel more focused, sleep better, and build confidence over time. When physical activity becomes a part of daily life, it supports both physical well-being and a positive mindset.

The push-up counter senses when someone moves down and pushes back up, observing the motion without getting in the way. There are no buttons to press or numbers to remember, just simple movement and steady progress. Each completed push-up is noticed and counted, making the exercise feel smooth and uninterrupted.

This simple system makes exercising easier and more enjoyable. Instead of worrying about counting in your head, you can focus on your movement and your strength. It helps children stay motivated, parents track progress, and families turn exercise into a shared activity. With every push-up, the counter encourages consistency, confidence, and healthy habits, making fitness feel fun, achievable, and rewarding.

In this blog, we are going to make a pushup counter system, using the IR Element, Havi controller (an esp32 based microcontroller, more powerful than arduino) and Python code. Get all the components from Havi DIY Robotics starter kit and Havi advanced robotics kit add-on. Or you can contact us to get these project-specific components.

Let’s start.

Things you need to make a pushup counter

Elements:

  • Havi Controller
  • IR Element
  • Buzzer Element

Accessories:

  • Power bank with USB Cable – 2
  • Data cable
  • 3-pin cable

For programming:

  • Laptop/computer with active internet connection
  • Havi MicoPy
  • Mobile phone(optional)

How to make a pushup counter

Step 1
First, let’s make the circuit.

Snap IR Element at input 1 port of Havi Controller. Snap Buzzer Element at output 1 port of Havi Controller.

pushup counter circuit

Step 2
Connect the Havi Controller to the laptop/desktop using data cable & connect the power bank with the Havi Controller using USB cable.

pushup counter circuit connection with laptop

Step 3
Open your web browser and search for Havi MicoPy. Connect your Havi Controller with Havi MicoPy.

Step 4
Once Havi Controller is connected with Havi MicoPy, paste the code for pushup counter in the main.py file.

Download the python code by clicking on the following button.

Pushup counter python code

Step 5
Once you paste the code to the main.py file, change the wi-fi settings as per your wi-fi.

code change in pushup counter

Step 6
Run the code. The following should be displayed in the terminal, then open the generated server address in a new tab.

new tab open the pushup counter

Step 7
Once the web server tab will open, the count will automatically start at 0.

pushup counter screen

To test, keep your hand near the IR LED and see the count will increase by 1 and buzzer will beep. Watch the following video.

Your pushup counter is ready. Use another power bank with the controller to make the device free from laptop/computer. Now, copy the web address and paste it into the browser on your smart phone. The phone should be connected with the same wi-fi.

Tada… you can display the pushup counts on your phone.

Now, set your posture and start doing pushups.

To reuse or log a new count, press the EN button on the controller.

This way, you can make your own exercise tracker using Havi’s advanced robotics kit add-on.

Liked this article? Share with your friends

We send a weekly newsletter that covers useful resources and insights about Creative Play. Toys, Games, DIY Projects, Sports, Music, Robotics, Art, STEAM, Parenting…No spam, just useful content.


    We send a weekly newsletter that covers useful resources and insights about Creative Play. Toys, Games, DIY Projects, Sports, Music, Robotics, Art, STEAM, Parenting. No spam, just useful content.




      Send me the download link to following email id

        This will close in 0 seconds

        0
        0
        Your Cart
        Your cart is empty
        Calculate Shipping
        Apply Coupon