Heart Visualizer | See Your Heart Beat

16,270

135

31

Introduction: Heart Visualizer | See Your Heart Beat

About: Engineering and Design

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

FASTENERS

    • M3*10mm (x20)
    • M3*10mm (x20)
    • M3*25mm (x4)
    • M3 Nuts (x50)

    OTHER MATERIALS

    • Acrylic sheet
    • Standoff
      • 40mm (x2)
      • 25mm (x4)
    • Brass rod 16.5cm length 2mm diameter

    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>

    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.

    Heart Contest

    First Prize in the
    Heart Contest

    Be the First to Share

      Recommendations

      • STEM Contest

        STEM Contest
      • Role Playing Game Challenge

        Role Playing Game Challenge
      • CNC Contest

        CNC Contest

      31 Comments

      0
      cfwantz
      cfwantz

      4 months 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

      0
      sharathnaik
      sharathnaik

      Reply 4 months 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.

      0
      cfwantz
      cfwantz

      Reply 4 months ago

      Ah, it's not the 3d printing that I'm worried about. It's the hardware and wiring!

      0
      sharathnaik
      sharathnaik

      Reply 4 months 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.

      1
      joshuaanjorin9
      joshuaanjorin9

      1 year ago

      Can I use ardunio lily?

      0
      sharathnaik
      sharathnaik

      Reply 1 year ago

      Yes, of course you can.!

      0
      willmauritsen
      willmauritsen

      11 months ago

      When I upload the test code and open the serial monitor and put my finger on the heart sensor, everything works fine and I can see the value changing.
      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!

      heartvisualizererrorarduino.JPG20200511_174736.jpg
      0
      sharathnaik
      sharathnaik

      Reply 11 months 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.

      0
      willmauritsen
      willmauritsen

      Reply 11 months 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).

      heartvisualizercode.JPGheartvisualizercoderewrite.JPG
      0
      sharathnaik
      sharathnaik

      Reply 11 months ago

      Ah! the code changed again! I have now uploaded the .ino file. Please use that and let me know if it works.

      0
      willmauritsen
      willmauritsen

      Reply 11 months 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....

      heartvisualizercode2.JPG
      0
      sharathnaik
      sharathnaik

      Reply 11 months 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.

      0
      willmauritsen
      willmauritsen

      12 months 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?

      0
      sharathnaik
      sharathnaik

      Reply 12 months 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.

      0
      willmauritsen
      willmauritsen

      12 months ago

      Where did you get your standoffs from?

      0
      willmauritsen
      willmauritsen

      1 year ago

      I am having trouble finding acrylic sheet that is exactly 2.5mm thick... will 3mm acrylic sheet work?

      0
      sharathnaik
      sharathnaik

      Reply 1 year ago

      Yes, that would work too.