Back
Featured image of post Systems Integration

Systems Integration

Week 17

Assignments

Our tasks for this week are:

  • Design and document the system integration for your final project

Assignment

System integration is incredibly important in the teaching heart because the form and function are tied so closely together. In order to mount and drive the light animations in the concise form factor of a 3D heart that can be held in one hand, and that was tethered neither to the base nor an external power source, I had to design both the geometry and the electronics together.

I envision the teaching heart to have that “magical” quality where you can’t tell how it works - you aren’t distracted by wires or boards or the individual electronic components, but can simply be captivated by the effect of the chasing lights diffusing through the organic resin form. This type of “simplicity” takes a lot of thought and design work to pull off!

Inspiration: native heart

In a real heart, the electrical signals, or conduction, which drives the organized contraction of the cardiac muscle to ‘beat" starts in something called the Atrioventricular (AV) node. The conduction pathway, as well as the flow of blood driven by the organized contraction of the muscle tissue, starts in the atria and travels to the ventricles, where blood is pumped/propelled from the heart via the great vessels (either the main pulmonary artery or aorta, depending on whether we’re talking about the right or left side of the heart, respectively).

In my teaching heart, I want light to travel in the same way, as if following the projectory of a blood cell through the heart. For that reason I thought it made sense to place the “brain” of the lighting animation, the board, in a similar location as the AV node. This way I could have the LED stands run from the atria through the ventricles and up the outflow tracts of the great vessels without requiring a lot of wire to connect between the board and where the LED strip would start. The teaching hearts electronics and flowlines would echo those of a real heart.

Source: https://pediatricheartspecialists.com/heart-education/18-arrhythmia/178-av-node
Source: https://pediatricheartspecialists.com/heart-education/18-arrhythmia/178-av-node

Concealing the electronics in the heart

Within the base I knew it would be easier to conceal the electronics, but in the heart itself space was at a premium. I had to be clever about positioning and creating pockets/cavities for the electronics to be housed within the walls of the chambers so they couldn’t be seen. For example, I gave myself a little more space to conceal the electonics by modifying the geometry: by slightly externally offsetting the surface of the heart chambers, I made the walls a little thicker. The difference is not striking/noticable for the user, but made fitting the electronics and battery easier.

I started by measuring the main electronic components (the board complex and battery) and making rough digital 3D models of them in my 3D CAD design software. Then I positioned them relative to the digital 3D heart geometry I’ve been working with. I positioned the board between the atria to minimize it extending into the ventricular chambers, and also because it would be easier to run the LED strips for the right and left heart into the right and left atria if the board were positioned between them. I positioned the battery below, at the base of the heart between the atria and ventricles. For each electronic component I used boolean operations create a cavity to house that component within the heart geometry.

Another design decision I made was to print the ventricles & great vessels as one part and the atria as a separate part which could be press-fit into place over the ventricles. The electronics & wiring would be concealed within cavities between the two 3D printed components, and when they were put together only a bit of the battery and the front the the board/xiao (where the cable jack and on/off switch can be accessed) are visible.

snapping the atria portion of the heart onto the ventricle portion

Board footprint

In order to conceal the electronics within the walls of the heart so the chambers could still be seen but not the electronic components (besides the animated lights), I had to downsize my board as much as possible. Since I was using the Xiao ESP32C3 for its wireless communication capabilities (as well as the battery management and charging, more on that below), I designed a board to interface with the Xiao which would match its footprint. I couldn’t completely conceal the board because I needed to leave the connector on the Xiao available for programming (if I want to modify or update the code) and charging the battery. I placed a small switch on my board, below the Xiao connector, which could connect one terminal of the battery to ground and allow me to turn the heart on or off.

Power Management

My power management strategy was driven by the use experience I wanted to build.

Desired user experience:

  • can pick up the heart, rotate, and examine more closely
  • no cables or wired connections between the heart and the base which controls BPM
  • no cables or wired connection between the heart and an external power source; no need to plug in for the lights to run

Since I knew I wanted the user to be able to pick up the heart to rotate and examine it more closely, while still animated with the light “beating” pattern. To achieve this type of untethered interaction, there has to be a battery mounted within the heart to drive the light strips. But in order to conceal the battery/have it be as unobtrusive as possible in the user’s interaction with the heart, I needed to use a small battery and be clever about how the battery was mounted within the geometry. The geometry needed to allow for wires to run between the cavity where the battery would be house and the cavity where the board would be mounted.

Lighting

Because of the scale of this project, standard neopixel RGB LED stands can be used for testing the code but are too big to work in the tight and nonplanar geometry of a heart.

There are tiny flexible LED filaments called nOOds that would have worked size-and-geometry wise in the heart, but didn’t allow for addressing individual LEDs along the strip - I needed something where the LEDs can be programmed to show an animation, and also can be any color in the RGB spectrum regardless of the neighboring LEDs in the strand.

I identified an ultraskinny RGB neopixel strand which offered both the small formfactor and the fully functionality of individually addressable RGB LEDs.

regular neopixel LED strip vs ultra skinny LED strip

In a demo 3D print of the main body of the heart I used thin strands of tape to map out where the 3D strips might lay on the surface of the heart chambers. I have to be conscious of the pathway along which I lay the LED strands so as not to kink or overstress the delicate LEDs, and mapping it out in tape was very helpful in understanding how I could mount the LED strip with the contours of the heart.

Another consideration for the LED strands positioning is as I mentioned above, how I want them to run from atria to ventricles to great vessels. I needed to incorporate small windows into the cavity where the board is housed between the atria and ventricles through which to feed the LED stands into both the left and right atria.

Simulating mixed & unmixed blood: Ventricular Septal Defect (VSD) detection with a magnet and Hall affect sensor

I included a “repairable” ventricular septal defect (VSD) in the model, which is a very common congenital heart defect in which there’s a hole or communication between the two ventricles. When there is a VSD present, blood from the left ventricle flows into the lower-pressure right ventricle, causing a higher volume of blood to be delivered to the lungs as a mix of both deoxygenated and oxygenated blood. When the hole is not present, or is repaired by a patch, normal flow is restored and the flows on the right and left side of the heart remain separate without any mixing.

I achieved this by tucking a binary switch hall affect sensor into the cavity which would also house the battery, at the underside of the heart in the wall between the two ventricles and atria. I extended the cavity so it would end behind the VSD border; the magnet sensor needed to be near enough to the VSD that a magnet I embed in the removeable VSD patch would be detected and trigger the switch.

testing magnet detection to trigger lighting color change

In the image below you can see the VSD piece in translucent green (with a circular cavity for where the magnet would be embedded) with the cavity behind the VSD, between the ventricular chambers.

Ribbon Connectors

As another design decision made to downsize/consolidate the electrical components, I opted to use 10-wire ribbon cables to connect the LED strips to the board. I would solder the ribbon wires directly to the LED stands (GND, data, & VCC per LED strand) and then be able to just plug the ribbon cables into my board via small vertical 10-pin connector headers. I also made sure to include a cutout in the board to allow the positive battery terminal to be soldered to the + battery pad on the back of the Xiao.

One downside of the ribbon connectors is that it’s not easy to tell which pin is mapped with which wire of the ribbon cable- and it also depends on which side of the cable you’re accessing!

Initially I envisioned running two LED stips for each side of the heart, which would require two header pins and ribbon cables. (Ultimately I found that running just one LED strip per side was sufficient.)

ribbon cable fit test on the small board
ribbon cable fit test on the small board

I did a lot of work on mapping out the pins on the Xiao ESP32C3 to the 10-header pins on my board to the ribbon cable that would connect it to the LED stands. I tried to optimize the board traces so that the wires of the ribbon cable that needed to be soldered to the LED strands would all be next to each other.

Code Process Diagrams

To clarify my thoughts on how to write the code for each board, I created a programming code block flow diagram for each of them.

Base Board Code Diagram

The code for the base board is quite straightforward. The board initializes the ESP NOW protocol to connect to the receiver board mounted within the heart and then checks the input of a potentiometer. The potentiometer’s value is mapped to a BPM value and sent to the reciever board. I chose 30 BPM as a minimum and 180 as a maximum. At the slowest value of 30 BPM it’s easier to track the way the lights/blood moves through each side of the heart, and I chose 180 BPM as the fastest value because that’s the rate at which a newborn’s heart beats.

Heart Board Code Diagram

The reciever board mounted in the heart listens for the BPM value sent from the Base board and adjusts the rate of the lighting animation to match that value. The code diagram is below:

There is also some logic built into the code to change the color of a certain region of the right heart LED string to purple to indicate mixing of oxygenated and deoxygenated blood when the VSD is open (the magnet is not detected by the hall effect sensor).

Notes for the week below

Global Class

  • want to integrate well
  • think about how all the parts will connect together- don’t leave it up to chance
  • working isn’t enough - design importance can be seen in the diverging history between Macs & PCs
  • good design is more than just making it pretty
  • conceptual, preliminary, & detailed design
    • each step is important
  • Design principles for users recitation in 2021:
    1. Simplicity
  1. Natural mappings
  2. User’s language (symbols)
  3. Avoiding modes

DFM = Design for Manufacturing

  • use core set of standard components

  • net shape (use processes that produce parts in their (nearly) finished form)

  • adhesives < fasteners < flextures

  • self-aligning features

  • minimize parts

  • injueciton molding vs 3d print farm

  • KiCad BOM plugin

documentation ex: Howtoons

Packaging

  • how are PCBs & electronics assembled?
  • wire routing
  • mechanism alignment
  • surface finish

Testing

  • QA = quality assurance - prevent defects from coming in
  • QC = quality control - testing that the output works
  • “burn in” = leaving the system running, letting it settle in
  • cycling = running the system up and down through cycles (power)
  • fuzzing = give system random/nonsense inputs to see if you can solicit an unexpected response. good for finding security issues
  • hopefully will prevent failure on the presentation day

Failure modes:

  • mechanical
  • wiring - ripped up traces
Last updated on May 22, 2024
Built with Hugo | Using a personally adjusted version of Nadieh Bremer's website and the theme Stack