Things used in this project

Hardware components:
Cutout cortado grande
Punch Through LightBlue Bean
×1
microSD card with microSD to SD adapter
×1
Adafruit Amplifier
×1
4 ohm 3W speaker
×1
11026 02
Jumper wires (generic)
×1
Male header pins
×1
Female header pins
×1
12002 04
Breadboard (generic)
×1
2xAA battery holder
With batteries
×2
Hand tools and fabrication machines:
09507 01
Soldering iron (generic)
An elevator!

Schematics

Schematics
Elevator prank fritzing2

Code

SD Audino ExampleC#
/* 
  This sketch uses a LightBlue Bean to play an audio file from an SD card. 
  
  In the example, a LightBlue Bean is put in an elevator and plays an fart
  sound as soon as the elevator moves. Make sure that the Bean's front is facing 
  up when running the sketch.
    
  This example code is in the public domain.
*/

#include <SD.h>
#define SD_ChipSelectPin 2
#include <TMRpcm.h>

TMRpcm tmrpcm;

int upperThreshold = 290;
int lowerThreshold = 220;

void setup() {
  tmrpcm.speakerPin = 1;
  Serial.begin();

  if (!SD.begin(SD_ChipSelectPin)) {
    Serial.println("SD fail");
    return;
  }
}

void loop() {
  int acceleration = Bean.getAccelerationZ();
  if (acceleration > upperThreshold || acceleration < lowerThreshold) {
    delay(3000);
    tmrpcm.play("fart.wav");
    delay(15000);
  }

  Bean.sleep(100);
}
Github
https://github.com/tfg13/TMRpcm
Github
https://github.com/PunchThrough/Play-Audio-From-SD-Card

Credits

11014907 917762441613247 2463536654633089299 o
Punch Through

We’ve been building connected products since 2009. Our diverse team has expertise in every layer from hardware to software to web.

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

J.A.R.V.I.S. : A Virtual Home Assistant
Advanced
  • 13,804
  • 129

Full instructions

J.A.R.V.I.S. is a personal home automation assistant for controlling electrical home appliances integrated with an augmented reality app.

Pumpkin NotiFire
Advanced
  • 397
  • 9

Full instructions

The Pumpkin NotiFire is a delicious but questionable combination of a Glade aerosol air freshener, fire and text messages.

Smartphone controlled mood light
Advanced
  • 2,121
  • 14

Full instructions

This tutorial teaches you how to make a mood light that you can change color and intensity of using your iPhone.

Touched by Time – Cyborgism
Advanced
  • 1,936
  • 20

I have no “sense" of time - can I develop one? Tempo is a wearable device that feeds time data to my skin through vibration patterns.

Bean Bus
Advanced
  • 820
  • 6

Full instructions

Drive a tiny RC bus over Bluetooth Low Energy with the LightBlue Bean!

Bean Bus

Team Punch Through

CastMinder - The Cast and Splint Monitoring System
Advanced
  • 158
  • 0

Work in progress

The CastMinder system can detect complications in orthopedic casts and splints while healing patients faster and with less pain.

Add projectSign up / Login