Interactive Dog Skull Prototype

by czw487 in Workshop > 3D Printing

40 Views, 0 Favorites, 0 Comments

Interactive Dog Skull Prototype

574780920_1340427371093188_4578766047889830639_n.jpg
Interactive dog skull prorotype

Motivation & Goal


This is a project in the course Digital Fabrication and Makerspace Skills for Science (FAB) at the University of Copenhagen. In the course each student group is paired with a scientist who presents a specific research challenge or idea.


Our assigned scientist studies canine neuroscience, and the problem we aim to address is the lack of interactive teaching tools for explaining the function of the dog brain. To solve this, we are developing a tactile, sensor-based 3D model that makes learning about canine neuroanatomy more engaging and accessible.

Supplies

Electronics

  1. Wires
  2. Adafruit circuit playground express CPX
  3. Adafruit AGC Electret Microphone Amplifier - MAX9814
  4. Joy-It SEN-Pressure02
  5. Analog output type distance measuring sensor model no. GP2Y0A41SK0F
  6. 4 sewable neopixels
  7. Fritzing - attached file under 'Soldering'


3D printables

  1. Files are attached under 'Step 1: Printing the Objects'
  2. PLA
  3. Some transparent printing material


Machines

  1. 3d printer
  2. Soldering station


Other Materials

  1. 6 Magnets; 8mm diameter, 3mm height
  2. PCB board
  3. Super glue (we used loctite)

Printing the Objects

566644932_825322553480920_3680136123064586124_n.jpg

Here are the files needed to print out the skull and the brain.

For the brain part (Brain_Final.3mf), you should use transparent material, so the lights from the neopixels will shine through.


The rest of the skull can be printed in any color you see fit. We printed the front_left side and the right side lying down, to minimize the aftermath of supporting trees.


The right side is the biggest part and has the longest printing time with about 8 hours.

The brain has the least printing time, with a bit over 1 hour.

Glueing on the Magnets

569280129_836221988957516_6454045659694145694_n.jpg
575266946_1313097663430806_4649759086906792565_n.jpg

This step is about assembling the printed objects with the magnets.

Use the glue on the holes and put in the magnets, then wait a bit for it to dry. Make sure to glue the magnets on the correct way, so it can be assembled later.

The right part of the skull (the red part in this case) needs 2 magnets, the left parts of the skull needs 4 magnets.

Soldering

Fritzing_Dog_Skull.png

In this step, we prepared the Circuit Playground Express (CPX), the sensors, and the power rails so that all the electronic parts could be connected easily using female-to-female jumper wires instead of soldering everything together permanently.

We started by soldering male header pins to the CPX on the pads we needed:

A0, A1, A2, A3, 3.3 V, VOUT (5 V), and GND.

This lets us plug the jumper wires straight onto the board later.

Then we did the same for two of the sensors — the Sharp proximity sensor and the MAX9814 microphone module — while the pressure sensor already came with pins pre-attached.

We also made our own power and ground rails. For this, we took two wires (red for 3.3 V and black for GND) and soldered male header pins to both ends of each wire.

These act as extension cables for power: you can plug them into the CPX on one side and then branch them out to each sensor’s power and ground pins using jumper wires.

By soldering the pins instead of wiring everything directly, the setup became modular — every part can be unplugged and reconnected easily inside the skull, making future repairs or modifications much easier

Downloads

Assembling the Electronics

566642514_821063854218258_7151408954176877772_n.jpg

The proximity sensor has a space for it in the nose of the skull. Start by placing the proximity sensor in the right side of the skull (red part). The right side also has a slit for the pressure sensor, which you also need to put in its place before closing the skull.

The microphone does not have a place cut out for it. We taped it to where the ear should be on the outside of the skull, and connected the wires through the hole in the back of the right side of the skull.



Setting Up CPX With the Code

import time
import board
import analogio
import neopixel

# ---------------- NeoPixels (3 chained on A0) ----------------
PIXEL_PIN = board.A0
NUM_PIXELS = 3
pixels = neopixel.NeoPixel(PIXEL_PIN, NUM_PIXELS, brightness=0.3, auto_write=False)
# pixels[0] -> Touch (FSR) | pixels[1] -> Distance (IR) | pixels[2] -> Sound (Mic)

# ---------------- Sensors ----------------
# FSR on A1
fsr = analogio.AnalogIn(board.A1)
# IR distance on A2
ir = analogio.AnalogIn(board.A2)
# Microphone on A3
mic = analogio.AnalogIn(board.A3)

def volts(ain):
return (ain.value * 3.3) / 65535.0

# ----------- Calibrate FSR baseline -----------
print("Calibrating FSR... don't press.")
t0 = time.monotonic()
acc = 0.0
n = 0
while time.monotonic() - t0 < 1.0:
acc += volts(fsr)
n += 1
time.sleep(0.01)
fsr_baseline = acc / max(1, n)

# ----------- Thresholds -----------
FSR_DELTA_V = 0.10
IR_THRESHOLD_V = 1.0 # adjust if needed
MIC_MARGIN = 1500 # adjust sensitivity
ON_TIME = 1.0 # seconds mic LED stays on

print("FSR baseline:", round(fsr_baseline, 3))

# --- Simple loudness read ---
def read_loudness(samples=100):
vmin, vmax = 65535, 0
for _ in range(samples):
v = mic.value
if v < vmin: vmin = v
if v > vmax: vmax = v
return vmax - vmin # peak-to-peak amplitude

# --- Calibrate mic baseline ---
print("Calibrating mic... stay quiet.")
quiet = sum(read_loudness(200) for _ in range(5)) // 5
MIC_THRESHOLD = quiet + MIC_MARGIN
print("Mic quiet:", quiet, "Threshold:", MIC_THRESHOLD)

# --- Helper functions ---
def fsr_pressed():
return volts(fsr) > (fsr_baseline + FSR_DELTA_V)

def ir_close():
return volts(ir) > IR_THRESHOLD_V

def smooth_bool(read_fn, samples=3, delay=0.01):
hits = 0
for _ in range(samples):
if read_fn(): hits += 1
time.sleep(delay)
return hits >= (samples // 2 + 1)

# --- Main loop ---
last_sound_time = 0
armed = True
margin_low = MIC_THRESHOLD * 0.6 # hysteresis for mic

while True:
# --- Touch (green) ---
pressed = smooth_bool(fsr_pressed, samples=3, delay=0.005)
pixels[0] = (0, 255, 0) if pressed else (0, 0, 0)

# --- Smell (red) ---
close = smooth_bool(ir_close, samples=3, delay=0.005)
pixels[1] = (255, 0, 0) if close else (0, 0, 0)

# --- Sound (blue, 1s hold) ---
loud = read_loudness(120)
now = time.monotonic()
if armed and loud > MIC_THRESHOLD:
last_sound_time = now + ON_TIME
armed = False
pixels[2] = (0, 0, 255) # blue on loud sound
elif not armed and loud < margin_low:
armed = True # re-arm after quiet
if now > last_sound_time:
pixels[2] = (0, 0, 0)

pixels.show()
time.sleep(0.03)


To use CPX, you need to install Visual Studio Code here


Get the CircuitPython Extension for Visual Studio Code here


The code above is what you need to setup the CPX with the electronics.


To set up the code on your Circuit Playground Express (CPX), first connect it to your computer using a USB cable. Press the reset button once until the green light appears and a new drive called CPLAYBOOT shows up. Then, open Visual Studio Code and upload your Python (CircuitPython) code file as code.py to the CPLAYBOOT drive. The board will automatically reboot and start running your code right away.

Glueing on the Brain

After the electronics have been assembled, its time to glue on the brain.

We used the same glue as we did for the magnets.

Interacting With the Skull

566668106_1143551247921386_8815837798015895225_n.jpg
574560528_809740865164499_1418781352378948917_n.jpg
574857150_711901328011558_7623268481778281035_n.jpg
  1. To interact with the skull, simply put something close to the proximity sensor, touch the pressure sensor, or make sounds to trigger the microphone.