How I (safely) Electrified a Drawer to Stop Myself From Using My Phone!

by ArihantNag in Circuits > Sensors

177 Views, 0 Favorites, 0 Comments

How I (safely) Electrified a Drawer to Stop Myself From Using My Phone!

Capture.PNG

This project involves electronic components that can be dangerous if handled incorrectly. Transformers and other power‑conversion devices can generate voltages that may cause injury if misused. Do not attempt to modify, open, or touch any part of a circuit that connects to a transformer or any other high‑voltage source, if you choose to do so because your intrusive thoughts got the best of you, SNAP OUT OF IT!

If you are under 18, you should only work on the low‑voltage parts of the circuit (such as the Arduino, sensors, and basic wiring) and have a qualified adult handle anything involving mains power, transformers, or high‑voltage modules.


I’ll be honest, I have a bad habit of blowing past the screen‑time limits my parents set. I know it’s not great, but nobody’s perfect. Instead of pretending I don’t do it, I figured I’d turn the whole situation into something a bit more productive. That’s what inspired this project. It’s my way of exploring how we interact with our devices and maybe even finding a smarter way to keep myself in check. I accomplished this by strapping an ultrasonic sensor and high voltage generator to a drawer in which I place my phone, this has proven quite effective due to my dislike for the sparks that could jump at me if I got too close (I promise that won't happen to you). the overall conclusion of this project is it kept me from using my devices and it kept others from stealing things I placed in the drawer.

Supplies

Diagram

Capture.PNG

In this comprehensive diagram it depicts the relay controlling a lock, we won't need that. Instead, we'll throw out the lock module and replace it with that good ol' high voltage booster conversion thingy from the last step (I still don't quite know what it's called). After you have done that make sure the copper-colored side isn't the input, otherwise quite literally nothing will happen. here's the wiring in text:

ultrasonic sensor to Arduino

VCC - 5V on Arduino

GND - GND

Trig - any digital pin (e.g., D9)

Echo - any digital pin (e.g., D10)

Arduino to relay

Relay VCC → 5V on Arduino

Relay GND → Arduino GND

Relay IN → a digital pin (e.g., D7)

This lets the Arduino turn the relay ON or OFF making the system trigger.

high voltage module and psu to relay

5V of spliced usb cable - NC on relay

Positive (+) on high voltage module - COM on relay

Negative (-) on spliced usb cable to Negative (-) on high voltage module

make sure the output wires of the high voltage module are close together to see the arcing





Code

const int TRIG_PIN = 7;

const int ECHO_PIN = 6;

const int RELAY_PIN = A5;

const float DISTANCE_THRESHOLD = 3.81; // cm (1.5 inches)

const float SOUND_SPEED = 0.017; // cm/us

const unsigned long DEBOUNCE_DELAY = 100; // milliseconds



float duration_us, distance_cm;

bool relayState = LOW;

unsigned long lastToggleTime = 0;



void setup() {

Serial.begin(9600);

pinMode(TRIG_PIN, OUTPUT);

pinMode(ECHO_PIN, INPUT);

pinMode(RELAY_PIN, OUTPUT);

}



void loop() {

// Trigger the sensor

digitalWrite(TRIG_PIN, HIGH);

delayMicroseconds(10);

digitalWrite(TRIG_PIN, LOW);



// Measure the pulse duration

duration_us = pulseIn(ECHO_PIN, HIGH);



// Handle case where pulseIn times out

if (duration_us > 0) {

distance_cm = SOUND_SPEED * duration_us;



// Check distance against threshold

if (distance_cm < DISTANCE_THRESHOLD) {

if (relayState == LOW) {

relayState = HIGH; // Activate relay

lastToggleTime = millis();

}

} else {

if (relayState == HIGH && (millis() - lastToggleTime >= DEBOUNCE_DELAY)) {

relayState = LOW; // Deactivate relay

}

}

} else {

Serial.println("Measurement timeout or error");

}



// Control the relay

digitalWrite(RELAY_PIN, relayState);



// Print the distance

Serial.print("Distance: ");

Serial.print(distance_cm > 0 ? distance_cm : 0); // Avoid negative distances

Serial.println(" cm");



delay(120); // Small delay for stability

}

With Great Power Comes Great Responsibility

While we've already assessed you're not very responsible due to your chronic phone habits, I trust you won't test the circuit with the high voltage output directly in contact with you, because that would be quite stupid.

Test It Out

safe drawer (i guess idk)

not only can the drawer be used for devices but also for storing safe items such as Halloween candy, snacks etc...

A Deep Dive Within High Voltage

wir.PNG

credit: Yosoo

Boost step‑up modules take a relatively low input voltage and convert it to a much higher output voltage. Inside the module, an oscillator rapidly turns the current on and off thousands of times per second. When the current through an inductor is suddenly interrupted, the collapsing magnetic field within the inductor releases a high voltage spike. This high voltage spike is fed into a transformer, which multiplies the voltage once more.

As a result, boost modules can multiply the voltage of a low input voltage to high levels where the output can arc through the air. Boost modules are of interest to those studying the physics behind such circuits. However, due to the high voltages that they can output, they are dangerous to play with and should only be in the care of adults.


How I Installed It

Capture.PNG

For my 5v PSU, I just used an RPI Pico since that seemed to deliver enough power for a strong arc. I used tape to hold the output wires in place and keep them close; this seemed to be the most reliable in long term use. I used a hidden power bank in order to supply power and kept it on the left-hand side of the drawer and my bed to ensure I don't use my phone during the night. I placed the sensor dangling on top of the hole where a person's hand goes and even if they try to open the drawer from another part, the sensor falls and still triggers the system every time!