Published © CC BY-NC

Madness Machine

A small project with a single evil purpose, fooling people into checking their phones.

BeginnerFull instructions provided10 hours670
Madness Machine

Things used in this project

Hardware components

Raspberry Pi Zero
Raspberry Pi Zero
×1
Toggle Switch, Metal Lever
Toggle Switch, Metal Lever
×1
Adafruit Vibrating Mini Motor Disc
×1
LiFePO4wered/Pi+
×1
Wires
×1
Plastic Enclosure, Project Box
Plastic Enclosure, Project Box
×1

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Drill / Driver, Cordless
Drill / Driver, Cordless

Story

Read more

Schematics

Wiring

Code

madness.py

Python
import RPi.GPIO as GPIO  
import time  
import random

GPIO.setmode(GPIO.BCM)  

motorPin = 26
switchPin = 21

GPIO.setup(motorPin, GPIO.OUT) 
GPIO.setup(switchPin, GPIO.OUT) 

GPIO.output(motorPin, GPIO.LOW) 
GPIO.output(switchPin, GPIO.HIGH) 



while True:

    if GPIO.input(switchPin) == GPIO.HIGH:

        GPIO.output(motorPin, GPIO.HIGH)
        print('on')
        time.sleep(2)

        GPIO.output(motorPin, GPIO.LOW) 
        print('off')
        time.sleep(random.randint(60,300))

Credits

Comments