Build a wearable Spider-Man mask display that reacts to motion and displays an animated face on a circular screen. This project uses a Raspberry Pi Pico to drive a round 240x240 display and read motion data from an accelerometer, creating dynamic facial expressions that respond to the wearer's movements.
The guide includes a complete parts list, wiring diagram showing connections between the Pico, display, and motion sensor, step-by-step assembly instructions, and ready-to-flash firmware. Builders will learn how to interface SPI and I2C peripherals, render pixel art animations, and create interactive wearable electronics.
Wiring diagram

Assemble it in 2 steps
1. Keep the case assembled
The screen and shake sensor are already wired inside the non-touch RP2040-LCD-1.28-B. No extra parts or wires are needed. Use USB power for this project.
- Check that your model is the non-touch version; the touchscreen uses different reset wiring.
2. Connect USB safely
Plug a USB-C data cable into the case and your computer. Leave the battery connector alone.
- Hold the case securely for a short wrist shake. Do not strike it or pull against the USB cable.
Deploy the firmware
#include <Arduino.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GC9A01A.h>
#include <math.h>
arduino::MbedSPI displaySPI(11, NC, 10);
arduino::MbedI2C motionWire(6, 7);
Adafruit_GC9A01A screen(&displaySPI,8,9,12);
uint8_t address=0x6B;
bool readRegs(uint8_t reg,uint8_t *b,int n){motionWire.beginTransmission(address);motionWire.write(reg);if(motionWire.endTransmission(false))return false;if(motionWire.requestFrom(address,(uint8_t)n)!=n)return false;for(int i=0;i<n;i++)b[i]=motionWire.read();return true;}
bool writeReg(uint8_t r,uint8_t v){motionWire.beginTransmission(address);motionWire.write(r);motionWire.write(v);return motionWire.endTransmission()==0;}
bool readAccel(float &x,float &y,float &z){uint8_t b[6];if(!readRegs(0x35,b,6))return false;x=(int16_t)(b[0]|b[1]<<8)*1000.0f/4096;y=(int16_t)(b[2]|b[3]<<8)*1000.0f/4096;z=(int16_t)(b[4]|b[5]<<8)*1000.0f/4096;return true;}
bool imuOK=false;
uint32_t angryUntil=0,lastSample=0;
int previousFrame=-1;
bool previousAngry=false;
uint16_t pixels[240*240];
// Draw on a 60x60 logical grid, enlarged four times for crisp pixel art.
void dot(int x,int y,uint16_t c){if(x<0||x>=60||y<0||y>=60)return;for(int j=0;j<4;j++)for(int i=0;i<4;i++)pixels[(y*4+j)*240+x*4+i]=c;}
void line(int x,int y,int xx,int yy,uint16_t c){int dx=abs(xx-x),sx=x<xx?1:-1,dy=-abs(yy-y),sy=y<yy?1:-1,e=dx+dy;while(true){dot(x,y,c);if(x==xx&&y==yy)break;int e2=e*2;if(e2>=dy){e+=dy;x+=sx;}if(e2<=dx){e+=dx;y+=sy;}}}
void drawFace(int frame,bool angry){
for(int y=0;y<60;y++)for(int x=0;x<60;x++){
float dx=(x-29.5f)/27,dy=(y-29.5f)/30;
uint16_t c=0;
if(dx*dx+dy*dy<1)c=(x<12||x>47)?0x9800:(angry?0xB800:0xE800);
dot(x,y,c);
}
// Black mask web spokes and scalloped cross-webbing.
for(int k=0;k<12;k++){float a=k*3.14159265f/6;line(30,29,30+int(29*cosf(a)),29+int(32*sinf(a)),0);}
for(int r=9;r<=29;r+=7)for(int k=0;k<12;k++){
float a=k*3.14159265f/6,b=(k+1)*3.14159265f/6,m=(a+b)/2;
line(30+int(r*cosf(a)),29+int(r*sinf(a)),30+int((r-2)*cosf(m)),29+int((r-2)*sinf(m)),0);
line(30+int((r-2)*cosf(m)),29+int((r-2)*sinf(m)),30+int(r*cosf(b)),29+int(r*sinf(b)),0);
}
// Angular mechanical housings, mirrored on each side.
for(int side=0;side<2;side++)for(int u=0;u<22;u++){
int x=side?54-u:5+u;
int top=19+u/3, bottom=37-u/5;
for(int y=top;y<=bottom;y++){
uint16_t c=0;
bool rim=(y==top+1||y==bottom-1||u==1||u==20);
if(rim)c=0x4208;
if(u>=3&&u<=18&&y>=top+3&&y<=bottom-3){
int center=(top+bottom)/2;
int aperture=frame==0?12:frame==1?5:1;
if(abs(y-center)<=aperture/2)c=angry?0xF800:0xFFFF;
}
dot(x,y,c);
}
}
screen.drawRGBBitmap(0,0,pixels,240,240);
}
void setup(){
Serial.begin(115200);
pinMode(25,OUTPUT);digitalWrite(25,LOW);
displaySPI.begin();
screen.begin(40000000);screen.setRotation(0);screen.invertDisplay(true);
screen.fillScreen(0);digitalWrite(25,HIGH);
motionWire.begin();motionWire.setClock(100000);
uint8_t id=0;imuOK=readRegs(0,&id,1)&&id==5;
if(!imuOK){address=0x6A;imuOK=readRegs(0,&id,1)&&id==5;}
if(imuOK){imuOK=writeReg(2,0x60)&&writeReg(8,0)&&writeReg(3,0x26)&&writeReg(8,1);delay(20);}
Serial.println(imuOK?"Motion ready":"Motion sensor unavailable; animation still runs");
}
void loop(){
uint32_t now=millis();
if(imuOK&&now-lastSample>=10){lastSample=now;float x,y,z;if(readAccel(x,y,z)){
float magnitude=sqrtf(x*x+y*y+z*z);
if(magnitude>2300){angryUntil=now+5000;}
}}
bool angry=(int32_t)(angryUntil-now)>0;
uint32_t phase=now%380;
int frame=phase<260?0:phase<290?1:phase<330?2:phase<360?1:0;
if(frame!=previousFrame||angry!=previousAngry){drawFace(frame,angry);previousFrame=frame;previousAngry=angry;}
delay(1);
}Remix this project
Make it yours in one click
Open a full copy of this project in your own Schematik workspace, diagram, code, parts, and assembly steps included. Swap the sensor, add features, or redesign the whole thing with AI. The author's original stays untouched.



