Micro:bit | Heart

Overview

Build a mechanical heart that uses a pulse sensor to make the heart beat along with yours

Materials

  • AHeart Base
  • BLinear Gears
  • CDrive Gear
  • DServo Sock
  • EPulse Sensor
  • FSensor Cable
  • GGuides x3
  • HWood Washers x 3
  • I#6 x 1/2" Screws x14

Build Steps

Step 1

Install the guides in position A, B and C using 2 #6 x 1/2" screws

Step 2

Install the linear gears in positions A, B and C using a #6 x 1/2" screw. Leave these screws loose so the gears can slide easily.

Step 3

Install the wood washers into the middle holes in positions A, B and C. Leave the screws a little bit loose to that the washers can spin easily.

Step 4

Install the drive gear A onto the servo sock using 2 #6 x 1/2" screws.

Next, hook the Servo Sock up to position 15 (B).

Download the code example below to your board but, change the "analog read pin P4" temporarily to "analog read pin P0", this will make the servo listen to the knob

Power up the board and turn the first knob (c) clockwise until it stops to turn the gear fully clockwise.

Step 5

Power off the board then connect the pulse sensor to the connection labeled 4(B). On the sensor end (C) line up the the orange wire to the "S" on the sensor. This is the signal wire.

Step 6

Install the assembled heart onto the servo sock making sure the gears are all the way into the center of the heart.

Power up and hold the sensor with the heart symbol towards your skin. Hold it still and the heart should start beating with yours!

The Code

Read the value from the pulse sensor to move the servo.

Code Breakdown

*Note to configure the heart you will need to do the following:

  1. Change “analog read pin P4″ to analog read pin P0”.
  2. Download the code to your Micro:bit
  3. with the heart not installed on the Servo Sock, rotate the first knob “P0” fully clockwise.
  4. Power off the board and fit the heart onto the Servo Sock gear as it is in Step 6