{"id":24764587,"url":"https://github.com/batushn/logic-gates-line-follower","last_synced_at":"2025-03-23T16:28:29.323Z","repository":{"id":268152474,"uuid":"903460438","full_name":"Batushn/Logic-Gates-Line-Follower","owner":"Batushn","description":"This repository contains the circuit design and logic implementation for a Line-Following Robot built using 4 sensors, logic gates, and DC motors. The robot uses basic digital logic gates to determine motor speeds based on sensor input and follows a line efficiently.","archived":false,"fork":false,"pushed_at":"2024-12-14T17:54:16.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-28T22:36:55.690Z","etag":null,"topics":["binary","breadboard","breadboard-prototype-testing","electrical-engineering","electronics","linefollower","linefollowing","logic","logic-circuit","logic-gates","logic-programming","logicgates","mechanical-engineering","mechatronic-systems","mechatronics"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Batushn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-14T17:00:39.000Z","updated_at":"2025-01-21T01:09:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"9beba236-b860-48a8-9237-9b7ac18f7a83","html_url":"https://github.com/Batushn/Logic-Gates-Line-Follower","commit_stats":null,"previous_names":["batushn/logicgates-linefollower","batushn/logic-gates-line-follower"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Batushn%2FLogic-Gates-Line-Follower","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Batushn%2FLogic-Gates-Line-Follower/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Batushn%2FLogic-Gates-Line-Follower/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Batushn%2FLogic-Gates-Line-Follower/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Batushn","download_url":"https://codeload.github.com/Batushn/Logic-Gates-Line-Follower/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245130284,"owners_count":20565626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binary","breadboard","breadboard-prototype-testing","electrical-engineering","electronics","linefollower","linefollowing","logic","logic-circuit","logic-gates","logic-programming","logicgates","mechanical-engineering","mechatronic-systems","mechatronics"],"created_at":"2025-01-28T22:33:03.103Z","updated_at":"2025-03-23T16:28:29.308Z","avatar_url":"https://github.com/Batushn.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# **4-Sensor Line-Following Robot using Logic Gates**\n\nThis repository contains the circuit design and logic implementation for a **Line-Following Robot** built using 4 sensors, logic gates, and DC motors. The robot uses basic **digital logic gates** to determine motor speeds based on sensor input and follows a line efficiently.\n\n---\n\n## **Overview**\n\nThis line-following robot utilizes:\n- **4 QTR sensors** to detect the position of the line.\n- Logic gates (AND, OR, NOT) to process the sensor signals.\n- Two **DC motors** controlled via an **H-Bridge Motor Driver** (L293D).\n- Two **555 Timer ICs** to generate PWM signals for motor speed control.\n\nThe logic gates are implemented using **74HC series ICs**, and the robot adjusts motor speed dynamically to align itself with the line.\n\n---\n\n## **Components**\n\n| Item                      | Quantity |\n|---------------------------|----------|\n| 10 kΩ Potentiometer        | 2        |\n| Diodes (LN4148)           | 4        |\n| 74HC04 (NOT Gate IC)       | 1        |\n| 74HC32 (OR Gate IC)        | 2        |\n| 74HC11 (AND Gate IC)       | 2        |\n| DC Motors                 | 2        |\n| L293D (H-Bridge Driver)    | 1        |\n| 5V Power Input (Or regulate from 12V)           | 1        |\n| 12V Power Input           | 1        |\n| 5 kΩ Resistor              | 2        |\n| 1 kΩ Resistor              | 2        |\n| 5 nF Capacitors            | 2        |\n| 100 nF Capacitors          | 2        |\n| 555 Timer ICs             | 2        |\n| Single Channel Cables      | 1m        |\n\n\n---\n\n## **Circuit Design**\n![image](https://github.com/user-attachments/assets/3fbfad0c-2ef7-4000-b345-9272e9a0d539)\n\nThe robot consists of two main sections:\n1. **Sensor Processing Unit**: \n   - **4 QTR sensors** detect line position and output **binary signals** (0 or 1).\n   - These sensor signals are fed into **NOT gates** (inverters), **AND gates**, and **OR gates** to implement the decision-making logic.\n\n2. **Motor Control Unit**:\n   - Two **555 Timer ICs** generate PWM signals to control the motor speeds:\n     - **33% PWM** for slow speed.\n     - **66% PWM** for medium speed.\n     - **100% PWM** for full speed.\n   - The H-Bridge Motor Driver (L293D) controls the direction and speed of the motors based on the logic output.\n\n---\n\n## **Truth Table**\n\nThe robot's logic is designed based on the following truth table:\n| S1 | S2 | S3 | S4 | Left Motor | Right Motor | Explanation                        |\n|----|----|----|----|------------|-------------|------------------------------------|\n| 0  | 0  | 0  | 0  | 0%         | 0%        | No input - robot stops          |\n| 0  | 1  | 1  | 0  | 100%       | 100%         | Robot moves forward straight|\n| 0  | 0  | 1  | 0  | 100%       | 66%         | Robot adjusts slightly to the right  |\n| 0  | 1  | 0  | 0  | 66%       | 100%         | Robot adjusts slightly to the left  |\n| 0  | 0  | 1  | 1  | 100%        | 33%        | Robot turns slowly to the left    |\n| 1  | 1  | 0  | 0  | 33%        | 100%        | Robot turns slowly to the left    |\n| 1  | 1  | 1  | 0  | 0%       | 100%          | Robot turns sharply left           |\n| 0  | 1  | 1  | 1  | 100%       | 0%          | Robot turns sharply right           |\n| 1  | 0  | 0  | 0  | 0%       | 100%          | Robot turns sharply left           |\n| 0  | 0 | 0  | 1  | 100%       | 0%          | Robot turns sharply right           |\n| 1  | 1  | 1  | 1  | 0%       | 0%        | Robot stops   |\n| 1  | 0  | 0  | 1  | 100%       | 100%        | Robot moves forward straight       |\n| 1  | 0  | 1  | 0  | 100%       | 100%        | Robot moves forward straight     |\n| 0  | 1  | 0  | 1  | 100%       | 100%        | Robot moves forward straight     |\n| 1  | 1  | 0  | 1  | 100%       | 100%        | Robot moves forward straight  |\n| 1  | 0  | 1  | 1  | 100%       | 100%        | Robot moves forward straight |\n\n\n---\n\n## **Working Principle**\n\n1. **Sensor Input**: \n   - The 4 QTR sensors detect the black line and provide binary outputs.\n   - Sensor values are processed through logic gates to determine motor actions.\n\n2. **Logic Processing**:\n   - **74HC04** ICs (NOT gates) invert signals where necessary.\n   - **74HC11** ICs (AND gates) and **74HC32** ICs (OR gates) combine inputs to produce control signals.\n\n3. **Motor Speed Control**:\n   - Based on the truth table, the two **555 Timer ICs** generate PWM signals at different duty cycles.\n   - These PWM signals adjust motor speeds to steer the robot and keep it aligned with the line.\n\n4. **Motor Driving**:\n   - The **L293D H-Bridge Driver** receives the control signals and drives the motors in the desired direction with the appropriate speed.\n\n---\n\n## **How to Build**\n\n### **Steps**:\n1. Connect the **4 QTR sensors** to the breadboard and configure them to detect the line.\n2. Wire up the **NOT gates (74HC04)**, **AND gates (74HC11)**, and **OR gates (74HC32)** according to the truth table.\n3. Implement the **555 Timer ICs** to generate PWM signals for motor speed control.\n4. Connect the **L293D Motor Driver** to the motors and integrate it with the PWM outputs.\n5. Power the circuit with:\n   - **5V** for logic gates and sensors.\n   - **12V** for the motors.\n\n6. Test the circuit:\n   - Adjust the potentiometers to fine-tune motor speeds.\n   - Verify the sensor logic and motor responses against the truth table.\n\n---\n\n\n## **Usage**\n\n1. Power on the robot with the **5V** and **12V** power lines. You can use a regulator (like LM7805) or L298n's regulator.\n2. Place the robot on a line (black tape or track).\n3. The robot will:\n   - Adjust motor speeds based on sensor inputs.\n   - Follow the line smoothly using the predefined logic.\n\n---\n\n## **Features**\n\n- **No Microcontroller**: This robot relies purely on **logic gates** and analog electronics.\n- **Dynamic Speed Control**: Motors adjust speeds to correct alignment deviations with potantiometers.\n- **Modular Design**: Easily customizable for additional sensors or motors.\n\n---\n\n## **Future Improvements**\n\n- Add more sensors for better precision.\n- Turning to the last direction with a flip-flop circuit to prevent crossing the line.\n\n---\n\n## **License**\n\nThis project is licensed under the **MIT License**.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbatushn%2Flogic-gates-line-follower","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbatushn%2Flogic-gates-line-follower","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbatushn%2Flogic-gates-line-follower/lists"}