3 AM, 10 Ohms: Code Deployment & The Classical Runway

Welcome back to the midnight grind. If you followed along with Part 1, you know we are tracking the jump from loose desk wires to fully simulated cloud systems. In this second entry, we are looking directly at the engine room: the exact C++ source code and the specific virtual hardware configurations running our automated system on Tinkercad. Standing up this project again wasn’t just a simple technical rerun. When you sit down to translate a physical build from your 9th-standard school exhibition into flawless digital code, it stops being a mere circuit. It becomes an active timeline of your own growth—a tangible, electrical memory of the exact moment you chose to stop just consuming technology and start building it. Below is the architecture, the code breakdown, and the hardware logic that keeps the alarm steady before we prepare our leap into the quantum sensor landscape.
The Bill of Materials: Virtual Hardware Inventory
To replicate this simulation setup on Tinkercad, you will need to assemble the following components in the workspace:
Component Tag Quantity Component Name Description / Role U2 1 Arduino Uno R3 The core microcontroller handling logic automation.
PIR1 1 PIR Sensor Passive Infrared sensor to detect physical motion.
S1 1 Pushbutton Simulates the physical state of the access door.
PIEZO1 1 Piezo The active audible buzzer to broadcast the alert state.
R1, R2 2 10 kΩ Resistor Pull-down resistors ensuring clean digital logic signals.
BAT1 1 9V Battery Supplementary raw power supply feed.
The Automation Engine: C++ Source Code
Here is the exact production script running inside the virtual Arduino platform. It employs a two-stage evaluation matrix: first validating the primary boundary perimeter (the door state) before polling the optical motion array.
C++
const int doorButtonPin = 2; // Pin connected to the door button const int sensorPin = 3; // Pin connected to the intruder sensor const int buzzerPin = 10; // Pin connected to the alarm buzzer
void setup() { pinMode(doorButtonPin, INPUT); pinMode(sensorPin, INPUT); pinMode(buzzerPin, OUTPUT); }
void loop() { int isDoorOpen = digitalRead(doorButtonPin); int isIntruderPresent = digitalRead(sensorPin);
// STAGE 1: Check if the door is open (Button is pressed) if (isDoorOpen == HIGH) {
// STAGE 2: If the door is open, check if the sensor triggers
if (isIntruderPresent == HIGH) {
digitalWrite(buzzerPin, HIGH); // SOUND THE ALARM
} else {
digitalWrite(buzzerPin, LOW); // Door is open, but no intruder yet
}
} else { // If the door is securely closed, keep the alarm completely quiet digitalWrite(buzzerPin, LOW); } }
Deconstructing the Code Logic
- The Pin Mappings: We bind the hardware peripherals directly to the Arduino's digital registers. The physical access check relies on pin 2, the infrared motion processing sits on pin 3, and the high-output warning transducer draws execution logic from pin 10.
- Conditional Gateways: The loop establishes a nested defensive layout. The controller systematically refuses to evaluate movement vectors unless the door interface reflects an unsealed baseline status (isDoorOpen == HIGH).
- Execution Deflection: By enforcing a strict hardware pull-down system through our 10 kΩ resistors, the program avoids floating voltage lines, guaranteeing the piezo element never yields false triggers when the space remains undisturbed.
Transitioning Beyond Macro Mechanics
Deploying this clean, predictable script brings a sense of absolute closure to our classical electronics experiment. Everything works exactly as planned on the macro level: if a physical body breaks the beam path, the sensor registers the event, and the output responds. But this predictable loop highlights the precise limitations of classical macro physics. We are looking at massive, visible disturbances to cross a threshold. In our final entry, we are tearing down this macroscopic framework. We are stepping out of basic cloud scripts and heading straight to the edge of modern quantum mechanics—examining how microscopic lattice flaws inside solid-state diamonds let us measure structural properties at the atomic level.
The classical runway ends here. Get ready for Part 3, where the code scales down to the quantum limit.
About the author
- Documenting a self taught transition from classical circuit automation to solid state quantum sensing. Leveraging computational simulations and AI-assisted workflows to prepare for global research paths in nanotechnology.
Comments
Join the discussionNo comments yet. Be the first to comment.
3 AM, 10 Ohms: From Soldering to Simulating
Documenting a self-driven evolution from raw physical hardware prototyping to cloud-based circuit simulation. This 3-part technical series tracks the transition from hacking classical sensor architectures on Tinkercad using AI-generated C++ code, toward scaling past classical physics limits to explore solid-state quantum engineering.

