1 / 5
Secret Beeper (Prank) — zdjęcie 1
1 / 5

Secret Beeper (Prank)

Zamów wydruk tego modelu

Obliczymy ostateczną cenę na podstawie wybranego pliku. Sprawdzisz ją i zaakceptujesz przed płatnością.

Zapisane na tym urządzeniu.

Informacje o modelu

Źródło
Printables
Licencja
Creative Commons — Public Domain

As an April Fools Day prank for my boss I made this little beeper. It's pretty compact, but allows you to either secret it away on its own or attach to anything magnetic through three 8mm disc magnets on its base.

I used an:

  • ESP32 Qt-Py board
  • LiPo Battery Backpack
  • Piezo-buzzer 
  • Small lipo-battery 

It's definitely overkill since all this could be done with analog components, but I wanted to do it quickly and therefore code was easier. The code is so simple I've attached the Arduino sketch below. 

Code:

// Simple Annoying Cricket Chirp Prank
// Iain Z - April Fools Day 2024

#include <ArduinoLowPower.h>

const int buzzer = A0; //Analog output pin const unsigned int sleepTimes[] PROGMEM = {3, 5, 11, 7, 14, 18}; // Random sleep intervals in mins

void setup(){ pinMode(buzzer, OUTPUT); // Set buzzer - pin 9 as an output }

void loop(){ int freq = random(3700, 3800); // random frequency in this range is picked for this chirp float duration = random(40, 70); // random duration chosen for this chirp (miliseconds) int chirpCount = random(2,5); int numCycles = random(3,5);

delay(2000);

for (int j=1; j<=chirpCount; j++){ for (int i=1; i<=numCycles; i++){ chirpLoud(freq,duration); delay(250); } delay(750); } int sleepTime = sleepTimes[random(0, 5)]*60000; //includes translation to miliseconds LowPower.deepSleep(sleepTime); }

void chirpLoud(int freq, float duration) { for (int i = 3; i >= 0; i--) { tone(buzzer,freq,duration); delay(duration); noTone(buzzer); } delay(duration/2); }

Tagi