Introduction: Heart Visualizer | See Your Heart Beat
We have all either felt or heard our heart beating but not many of us have seen it. This was the thought that made me start with this project. A simple way to visually see your heartbeat using a Heart sensor and also teaching you basics about electronics and robotics along with being fun to use and appealing to look at.
I hope you have fun making it!
Step 1: Tools, Components, and Materials
ELECTRONICS
- Arduino Nano
- Servo SG90
- MAX30100 Pulse Oximeter SpO2 and Heart-Rate Sensor Module
- 4.7kohm resistors (x 3)
- Micro USB Female jack (power input)
- Perfboard
- Male and female pin header connectors
FASTENERS
- M3*10mm (x20)
- M3*10mm (x20)
- M3*25mm (x4)
- M3 Nuts (x50)
OTHER MATERIALS
- Acrylic sheet
- Standoff
- 40mm (x2)
- 25mm (x4)
TOOLS
- Soldering Iron
- 3D printer
Step 2: 3D Printing Parts
There are 17 unique parts to be printed, most of them are pretty small, with a total print time of around 19 hours. I used white PLA with 100% infill and a layer height of 2mm. You can change these values if needed it should work fine but make sure that the small parts have 100% infill, for strength.
Zip file consisting of all the STL print-ready files. (https://www.thingiverse.com/thing:4266297/zip)
After the files have been printed you can use sandpaper or a hand file and clean out the printed parts especially the links where the parts slide through each other. Smoothening the joints will make the mechanism smooth and will provide less resistance to the servo. This process can take as long as you want as one can get lost trying to make the printed parts look perfect.
Extra notes:
You can re-drill the holes in the 3d printed parts using a 3mm bit. All the holes are of the same dimensions. This will make it easier while screwing in the nuts later on in the assembly.
Step 3: Making the Base
To make the base I used a clear Acrylic sheet of thickness 2.5mm (you can use 3mm sheet too). I have attached an A4 size outline that you can stick on the sheet and cut. If you have a laser cutter then I have attached two .dxf files for you to work with.
Since I don’t have a laser cutter I used an angle grinder to do the job and for making holes I used a 3mm drill bit.
Step 4: Servo Modification
The servo comes with a few connectors but we won’t be able to use them. So, we will have to make a custom one.
For this first cut out the connectors given with the servo and separate the part that attaches to the servo. Now attach the part to the 3d printed servo connector and use super glue them together. We should now have a custom connector.
Attach the connector to the servo using the given M2 screw and make sure that it moves like above. (orientation matters)
Step 5: Making the Circuit / Electronics
I have used a perf board to solder all the components to make the circuit compact but you can also use a small breadboard and jumper wires if soldering is not something you are comfortable doing.
Here’s the wiring diagram for the components.
Extra notes:
You can also this Pulse sensor (link) but MAX30100 has better noise filtering so you will be able to pick the heartbeat more consistently.
I have used the single power source for the heart sensor, Arduino and servo. It works fine without any problems. But if you are using a different servo (higher specs) having separate power source for Arduino and servo would work better.
Make sure to check the connectivity of all the pins and also make sure there is no unwanted shorting in the perf board.
Step 6: Uploading the Code Using Arduino IDE
First, let’s start by installing the necessary libraries to get the sensor working. A big thanks to Oxullo (https://github.com/oxullo) for making such a good library.
You can follow these instructions if you need help with installing libraries (https://www.arduino.cc/en/guide/libraries). I have attached the library for you to download.
Github Download:https://github.com/oxullo/Arduino-MAX30100/archive/master.zip
After you have installed the let’s test if everything is working perfectly.
- Open Arduino IDE and open the example sketch under Files --> Examples --> MAX30100 --> MAX30100 Tester.
- Select “Arduino nano” in board under Tools menu. If you have an old nano board make sure you select ATmega328P (Old Bootloader) in Processor under Tools.
- Upload the code to the board. If there are no errors you can open the Serial Monitor, select Baud rate as 115200 and place your finger on the sensor. You should see a change in value.
- Congratulations! the difficult part is over. But if you do face any errors don’t hesitate to ask in the comments section or a simple google search should be enough.
Now let’s test our code. Upload the below code and open the serial monitor. You should see it saying beat as your heart beats and the servo should start moving back and forth with every beat.
<br>
Attachments
Step 7: Assembly Time!
Now that we have prepared all the needed components it time to start assembling them. I have made a short video showing the assembly process. The process can get quite irritating as everything fits together in a small space. But you will be satisfied by the end of the assembly.
I used a power bank to power the visualizer. But anything that outputs 5v should work.
Extra notes:
Use plastic Greece if needed at the joints to make the motion smoother and also reduce noise.
Don’t tighten nuts too much keep them loose enough so that the joints can move freely.
Update: During the assembly of the stand I used a hollow tube [01:38] and then two 3d printed parts [00:16] [03:14]on either side. I have now made a single 3d printed part called stand which replaces these 3 parts, so you don't have to worry about finding a hollow tube.
After that tedious process, you should have the HEART Visualizer ready to show your heartbeat. Just place the finger on the sensor and you should see the heartbeat along with your heart.
Step 8: Have Fun!
This is a cool way to see someone’s heartbeat. Compare your heartbeats with your family and see who has the lowest or the highest heartbeat. You can even see your heart rate when you are just sitting or right after workout/play and see the heartbeat faster.
If you want to make changes to the design you can download the step file here https://sharathnaik.com/heartvisualizer/
I have tried to make the project as simple as possible for everyone to build their own. If you have any doubts or if I have made mistakes anywhere feel free to use the comments section.

First Prize in the
Heart Contest
32 Comments
Question 9 months ago
Hello! I have a question regarding the wiring bit. So when I upload the tester code to the serial monitor, I get this error "Initializing MAX30100..FAILED: I2C error" I was wondering if you had removed the pull-up resistors on your MAX30100? I've seen several people saying to do that to fix the error, but I wanted to know what you did and advice before I go ahead removing stuff! p.s I decided to put everything together on the breadboard first before soldering. Thank you so much!
2 years ago on Step 8
I can't wait to make this! Though honestly, you've made yours look so good, I'd straight up buy either a kit, or a finished product, from you
Reply 2 years ago
Thank you for that! But you can make it look good too. It's just 3d printing so it shouldn't be thatt difficult.
Reply 2 years ago
Ah, it's not the 3d printing that I'm worried about. It's the hardware and wiring!
Reply 2 years ago
Aha, I tried to keep it as simple as possible. If you find soldering difficult you can always use a breadboard and keep the electronics outside of the base.
3 years ago
Can I use ardunio lily?
Reply 3 years ago
Yes, of course you can.!
Reply 3 years ago
Okay thanks
3 years ago
But when I go and upload the code that controls the whole thing, I get this error message;
sketch_may11a:4:10: error: Servo.h: No such file or directory
#include
#define REPORTING_PERIOD_MS 1000
^~~~~~~~~
compilation terminated.
exit status 1
Servo.h: No such file or directory
I am assuming it must be something wrong with the servo, and I am using a SF0180 servo instead of a SG90 servo, which may be the problem but you might know what I am doing wrong...
Thanks!
Reply 3 years ago
Hey Will, firstly I noticed that your code had some tags like <p></p>. Those are not supposed to be there and I realized it's also there in the code snippet I provided. I guess it got added when copying the code from my pc. I have updated the code now. So please copy the above code and use that.
Now coming to the main issue, I don't think SF0180 servo is causing the problem but rather the servo library is missing. It usually comes installed with Arduino IDE but for some reason is missing from yours. You can install that by going to Sketch --> Include library --> Manage libraries --> Seach for Servo and you will find one by Michael Margolis --> Click on install and then restart your Arduino IDE. That should solve your problem. If you cant find the servo library you can search for how to install the servo library manually. To check if the library has been installed, under Sketch --> Include library, you should now see Servo in the list of libraries.
Also, it's better you run a simple servo program first to see if the servo is working perfectly. and then you can upload the main code to see if everything works together.
Hope that solves everything. Do let me know if you have any other problems.
Reply 3 years ago
Thanks for the advice!
So I uploaded some simple code to the board to see if the servo was working properly, and it was, so I know that everything is wired right and the servo is working.
When I uploaded the code that you updated, it gave me this error message as shown in the first picture. So I assumed that I needed to upload the servo library to the #include command along with the max30100 that you put in there, and when I compiled and uploaded, no errors, and when I open my serial monitor and put my finger on the sensor it will output "Beat!". But the servo does nothing (second picture).
Reply 3 years ago
Ah! the code changed again! I have now uploaded the .ino file. Please use that and let me know if it works.
Reply 3 years ago
OK
So the code uploaded to the board properly, and the serial monitor says SUCCESS for the pulse oximeter and " servo done", and then says BEAT repeatedly when I put my finger on the sensor, so we know the sensor's working. But there is still no response from the servo, much like before. Sorry for asking all these questions, I am fresh to coding in the Arduino platform. ;) Let me know if you have any ideas of what I might do next....
Reply 3 years ago
It's always good to ask questions, I learn in the process too, so do not worry about that. Coming to the problem, I think it may be due to the issue in power. Are you powering it through the Arduino cable or are you using a separate power supply? One thing you can try is to use a separate power source for servo and see if it is working. All you have to do is take the servo +ve pin and GND pin and connect it to a separate 5v supply, maybe you can use another Arduino's 5v pin. This is just to see if insufficient power is what is causing the issue. Also, try using a 5v battery as I showed in the circuit diagram to power the Arduino. Let me know if this helps.
3 years ago
So 15 seconds into the assembly video you pull out a bigger piece to fit onto the lower mount, but I cannot find it on your thingiverse page.. any suggestions?
Reply 3 years ago
Sorry about that. I had made a few updates but didn't mention it clearly. I have now added it to "Update:" in the assembly step. I hope that helps you. Basically I combined a few parts together to make it easier to assemble.
Reply 3 years ago
Thanks!
3 years ago
Where did you get your standoffs from?
Reply 3 years ago
I got it from a nearby hobby store but I guess you can get it from amazon too. Here's a link for 25mm standoff https://www.amazon.com/Aexit-Spacers-Standoffs-Female-Standoff/dp/B07DRC3N6J/ref=sr_1_6?dchild=1&keywords=25mm+spacers&qid=1587496371&s=industrial&sr=1-6
3 years ago
I am having trouble finding acrylic sheet that is exactly 2.5mm thick... will 3mm acrylic sheet work?