Ethan Zhang's Coding Projects

Hi I'm Ethan! I'm 12 years old and began learning robotics with LEGO Mindstorms and block-based coding in Primary 2. I enjoy designing and building robots to automate daily tasks. This passion led me to explore text-based coding with Python, which I now use to solve math problems and create educational games using Pygame for my friends to enjoy and learn from.

Portrait of Ethan Zhang

Project 1: Ultrasonic Activated Tractor

Ultrasonic Activated Tractor

I built a LEGO-based tractor model designed to simulate real-life functionality. It uses an ultrasonic sensor to detect obstacles and automatically stop when objects are within a threshold distance that I configured. This demonstrates the potential advantages of automation and smart technology in modern farming.

Project 1: Ultrasonic Activated Tractor
Project 2: Colour Activated Shooter
Project 2: Colour Activated Shooter

Colour Activated Shooter

Having played at the arcade frequently, I decided to use the concepts of conditional statements, colour detection, and output controls to create a secure and precise shooter that fires a shot when the colour sensor detects two specific colours in the coded order.

Project 3: Touch activated catapult

Touch activated catapult

I learnt how to use the LEGO technic parts to create different designs. Using the coding concept of conditionals (if-else), together with different sensors, I coded my designs to do certain actions only if a specific condition is met. Among many other projects, I created a ping pong racket that hits the ball if the touch sensor is activated

Project 3: Touch activated catapult
Project 4: Automated rabbit head
Project 4: Automated rabbit head

Automated rabbit head

My younger siblings loved playing with their toy rabbit head, which spins when the wind hits it. They used to manually spin and stop it, which was fun but limited. To make it more interactive and engaging, I decided to create an automated version of the toy. In this upgraded version, the rabbit head starts spinning automatically as soon as the program runs. When the ultrasonic sensor detects someone nearby—such as a child approaching—the spinning stops, and the toy returns to its original position.

Project 5: Colour and ultrasonic sensor activated top

Colour and ultrasonic sensor activated top

Playing the top is my childhood game and I decided to recreate a sensor-controlled spinning top using LEGO technic parts and coded it to move when it is activated by a colour sensor. The direction it moves is controlled by the reading of the ultrasonic sensor. It is designed to enhance user engagement and ensures consistent gameplay with minimal effort needed for monitoring or control.

Project 5: Colour and ultrasonic sensor activated top
Project 6: 2 Touch activated speed increasing speed decreasing blades
Project 6: 2 Touch activated speed increasing speed decreasing blades

2 Touch activated speed increasing speed decreasing blades

I built a lego model of a blades that is fully automated to replicate how real fan blades would respond to inputs from sensors. Touch sensor 1 is used to increase the rotation speed while the touch sensor 2 slows it down to enhance user experience and safety.

Time Breakdown (time_breakdown.py)

Description:

In this project, I used math to change a huge number of minutes into days, hours, and minutes. I used division and remainders to see how many full days there were and what was left over. This is important because it shows how math can help us understand time by breaking it down into parts we can read.

Diagram:

Diagram for Time Breakdown

Trinket:

Sentence Reverser (sentence_reverser.py)

Description:

This project takes a sentence as input and reverses the order of the words, demonstrating string manipulation and basic list operations in Python. It's a simple yet effective way to understand how to break down and rebuild text data.

Diagram:

Diagram for Sentence Reverser

Trinket:

Right Triangle Checker (right_triangle_checker.py)

Description:

In this project, I used if-else statements to check if a triangle is right-angled. I asked for three sides, sorted them, and used the Pythagorean theorem to decide if the triangle was right. This is important because if-else lets the program choose different actions based on the input.

Diagram:

Diagram for Right Triangle Checker

Trinket:

Initials Generator (initials_generator.py)

Description:

This project extracts the initials from a given full name, showcasing string splitting, iteration, and character manipulation. It's a practical example of processing user input to extract specific information.

Diagram:

Diagram for Initials Generator

Trinket:

ATM Simulation (atm_simulation.py)

Description:

This project simulates a simplified Automated Teller Machine (ATM) with functionalities like checking balance, depositing, and withdrawing money. It highlights conditional logic, user input handling, and managing a virtual account balance.

Diagram:

Diagram for ATM Simulation

Trinket:

Shopping Cart (shopping_cart.py)

Description:

This project simulates a basic shopping cart experience, allowing users to add items, view their cart, and calculate the total. It demonstrates the use of data structures (like dictionaries or lists) to manage inventory and user selections, along with fundamental arithmetic operations.

Diagram:

Diagram for Shopping Cart

Trinket:

Movie Theater Attendance (movie_theater_attendance.py)

Description:

In this project, I used a for loop to count how many people went to the movies each day for 12 days. I started with a base number and added more every day. This is important because for loops let us do the same calculation over and over quickly.

Diagram:

Diagram for Movie Theater Attendance

Trinket:

Password Security Checker (my_password_checker.py)

Description:

In this project, I created a program that keeps asking for a password until the correct one is entered using a while loop. This project shows how while loops can ensure that an action is repeated until the right condition is reached.

Trinket:

ATM Simulation (atm_simulation.py)

Description:

This project simulates a simplified Automated Teller Machine (ATM) with functionalities like checking balance, depositing, and withdrawing money. It highlights conditional logic, user input handling, and managing a virtual account balance.

Diagram:

Diagram for ATM Simulation

Trinket: