project
Logic Pet
Project overview
Logic Pet
Introduction: The Power of Fundamental Electronics
In an era dominated by microcontrollers, microprocessors, and single-board computers, robotics education often skips the fundamental building blocks of electronics. Beginners are frequently taught to immediately rely on Arduino, ESP32, or Raspberry Pi boards, writing lines of C++ or Python code to control basic hardware actions. While software-defined hardware control offers immense flexibility, relying solely on microcontrollers can lead to a gap in understanding pure circuit theory, logic states, signal propagation, and discrete electronics. This project was intentionally designed and constructed without a single microcontroller or software code. By utilizing foundational electronic principles, basic hardware components, and direct logic-level switching, this autonomous "pet bot" proves a fundamental rule: If you understand core electronics, logic states, and component characteristics, you can build intelligent, reactive systems directly through pure hardware.
Conceptual Design & core Philosophy
The central objective of this pet bot is to interact with its immediate environment in real-time. Much like a simple biological organism reacting to physical stimuli, the bot acts as a digital "pet" that responds immediately when an object or hand approaches it. Instead of an analog-to-digital converter (ADC) reading sensor values into a central processor, processing an if-else statement, and sending a pulse-width modulation (PWM) signal to a motor driver IC, this circuit operates instantly through pure hardware feedback loops. No Boot Time: System state changes instantly upon power switch toggle. Zero Software Latency: The response time is limited only by the propagation delay of the semiconductor components and physical relay switching time. Resilience & Simplicity: Eliminates code bugs, stack overflows, firmware corruption, or software hangs.
Hardware Architecture & Components
The physical assembly and electrical layout consist of six fundamental hardware components, carefully selected to create a functional power delivery and logic control loop: Dual 18650 Lithium-Ion Batteries (Power Supply): Connected in series to provide a nominal voltage range. This supplies ample current and voltage to drive both the DC gear motors and the control electronics efficiently. LM7805 Voltage Regulator (Power Conditioning): Acts as the core power stabilization unit. Since Li-ion batteries drop voltage as they discharge, the LM7805 steps down the raw series battery voltage down to a stable, continuous $+5\text{V DC}$ rail. This protects sensitive logic components and ensures consistent relay coil activation regardless of battery level. Infrared (IR) Proximity Sensor Module (Sensing & Decision): Combines an IR emitter LED and an IR photodiode coupled with an LM393 comparator chip. When an obstacle or hand comes near, the reflected IR light changes the output signal from HIGH to LOW (or vice versa depending on module pin configuration), functioning as an optical switch/logic trigger. 5V Single-Channel Relay Module (Actuation Logic Switch): Functions as an electromechanical logic gate and power switch. The logic output signal from the IR sensor directly energizes or de-energizes the relay coil, mechanically swapping the contact switch positions (NO - Normally Open / NC - Normally Closed). Dual DC Gear Motors & Wheels (Locomotion): Provides differential drive locomotion. The relay contacts control power routing directly to the motors to initiate movement, stopping, or directional changes based on the binary logic output of the IR sensor. Master Power Toggle Switch: Provides complete hardware isolation for battery conservation when the bot is idle.
How the Logic Circuit Works
The workflow relies on direct state switching: Power Stabilization: Current flows from the two 18650 cells into the LM7805 regulator. The LM7805 filters noise and regulates the voltage to a steady, distributing power to the IR sensor module and relay module coils. Signal Detection: The IR emitter continuously outputs infrared light. When an object comes into proximity, the receiving photodiode detects the bounce-back. The onboard LM393 comparator compares the photodiode voltage against a reference set by the potentiometer and flips its digital output pin. Relay Triggering: The logic pin of the IR module connects directly to the trigger pin of the 5V relay module. When the logic state trips, the onboard optocoupler/transistor on the relay board energizes the relay coil. Motor Action: The physical switching of the relay contacts instantly completes or breaks the motor circuit (or alternates between forward drive and turn/stop modes), giving the bot its "like-pet" responsive behavior.
Key Learnings & Takeaways
Building this project highlights several crucial engineering principles: Transistor & Relay Switching: Learning how low-current logic signals can control high-current inductive loads (motors) without needing complex software libraries. Power Management: Understanding power regulation, thermal considerations of linear regulators like the LM7805, and battery safety. Logic Optimization: Proving that microcontrollers are not always necessary for simple hardware automation, reducing cost, complexity, and failure points.
