Remake the Infinite Sports Game. More Fun!

by ict2024 in Craft > Reuse

293 Views, 3 Favorites, 0 Comments

Remake the Infinite Sports Game. More Fun!

concept of remake.png

We applied the concept of rethinking, reusing, redesigning, and re-coding to remake it. During the remake process, we rejoiced with each other.

Supplies

WhatsApp Image 2024-05-17 at 2.55.04 PM (1).jpeg
WhatsApp Image 2024-05-17 at 2.55.04 PM.jpeg

Two RC cars 27Mhz and 40 MHz

Reused the UNO with the IO shield

Reused relays

Reused transceiver of the wireless car

Reused foam board (showed as above)

Reused 3D filaments.

Our Theme

Remake it contest video 6 5 2024

Our team wished to have new interesting school activities in the STEAM week and after school, with the theme of "Steam Sports". We had the used UNOs, the used replays, and the used 3D filaments since our fellow schoolmates made the AI 5G water filter system in the instructables before. Here is the website "https://www.instructables.com/5G-AI-Water-Filter-System/". Then we reused and remade the components of the above project to make a new project in the STEAM WEEK "Steam Sports" in Po Leung Kuk Ma Kam Ming College. Students did the exercises and had more fun in the STEAM WEEK. In addition, we learned how to use Tinkercad to make the box holding the circuit, the racing track, the traffic safety cones, the grandstand, the lamp post, the Start Point and the racing car. We enjoyed playing the rc car racing and doing the exercise with an innovative idea. Remake the AI sports!!! Infinite possibilities!!

Reused the Components of the AI 5G Water Filter System

water tester.png

The UNO with the IO shield, relays and DuPont wires could be reused to make the new project, which was used in the project of "https://www.instructables.com/5G-AI-Water-Filter-System/" in the first-time author contest.

Design of the Box Holding the Circuit

box1.png
box2.png

The box holding the circuit was designed by using Tinkercad. The three holes in the box, allowed the wires to pass through. Two holes were for the UNO and the other for the transceiver of the remote control of the mini car.

Product of the Box

control box for green car 40 MHz.jpg
WhatsApp Image 2024-05-16 at 3.19.16 PM (1).jpeg
WhatsApp Image 2024-05-16 at 3.19.16 PM.jpeg

The box was made of old foam boards. Three holes:

  1. One for the charging wire of the mini-car
  2. One for the USB cable of UNO
  3. One for the power cable of UNO

Re-Design the Radio Control Circuit

FIRLWQULU5J5BYP.png
control box for blue car 27MHz.jpg
WhatsApp Image 2024-05-08 at 3.35.27 PM.jpeg

Reused the UNO with the IO shield, the relay and the transceiver of the wireless car. We remade the transceiver by connecting the wires from UNO. Four control buttons in the remote of the wireless RC car were connected to four relays which could be controlled by UNO that the wireless cars could move forward, move backward, turn left and turn right. The soldering process were done.

Re-Soldering the Circuit

Image.jpg
control box for blue car 27MHz.jpg
car.jpg

Remade the circuit in the RC car. The RC transceiver was connected with four digital relays. So, the UNO could control the RC car by writing python programs or block programs. Two cars (27Mhz and 40 MHz) and two RC transceivers (27Mhz and 40 MHz) were remade since two players could play together.

Testing the Redesigned Radio Communication Circuit!

testing - control wireless car.png
turn left forward and turn right backward
relay on off car moving
car moving - back view

The UNO pin 9, pin 10, pin 11 and pin 12 controlled the wireless car to move forward, move backward, turn left and turn right. The video showed that the wireless RC car moved forward and turned left, and moved backward and turned right. We controlled the wireless RC car to move more precisely, which was one of the improvements, by programming.

Re-Code the Python Program

pushup girl.png

We learnt how to write Python with google mediapipe library. Rewrote the python program, which was inspired by learning the website of Aryan Vij . We rewrote the python code by adding the initialisation of UNO and adding the control code of D9 and D11 to call the wireless car turning left and moving forward. The bold and italics codes was added and modified. Remade it again to meet our requirements. Push-up could drive the car to turn left and to move forward. Mediapipe and AI programs were applied to this system, which was the improvement of the single purpose of playing the RC car or the single purpose of doing push-ups.


The python program was below:


import cv2

import mediapipe as mp

import numpy as np

import PoseModule as pm

#from pinpong.board import Board

#from pinpong.board import Servo

import time


from pinpong.board import Board,Pin,Servo # Import Servo library

Board("uno").begin() # Initialization

pin1 = Pin(Pin.D9, Pin.OUT)

pin1.write_digital(0)

pin3 = Pin(Pin.D11, Pin.OUT)

pin3.write_digital(0)


.....


cap = cv2.VideoCapture(0)

detector = pm.poseDetector()

count = 0

direction = 0

form = 0

feedback = "Fix Form"

staight_angle = 140 # 160 is the best. hip angle is less than 160 will be easier.

right_angle = 90

shoulder_angle= 40


while cap.isOpened():

  ret, img = cap.read() #640 x 480

  #Determine dimensions of video - Help with creation of box in Line 43

  width = cap.get(3) # float `width`

  height = cap.get(4) # float `height`

  # print(width, height)

   

  img = detector.findPose(img, False)

  lmList = detector.findPosition(img, False)

  # print(lmList)

  if len(lmList) != 0:

    elbow = detector.findAngle(img, 11, 13, 15)

    shoulder = detector.findAngle(img, 13, 11, 23)

    hip = detector.findAngle(img, 11, 23,25)

     

    #Percentage of success of pushup

    per = np.interp(elbow, (right_angle, staight_angle), (0, 100))

     

    #Bar to show Pushup progress

    bar = np.interp(elbow, (right_angle, staight_angle), (380, 50))


    #Check to ensure right form before starting the program

    if elbow > staight_angle and shoulder > shoulder_angle and hip > staight_angle:

      form = 1

   

    #Check for full range of motion for the pushup

    if form == 1:

      if per == 0:

        if elbow <= right_angle and hip > staight_angle:

          feedback = "Up"

          if direction == 0:

            count += 0.5

            direction = 1

            pin1.write_digital(1)

            pin3.write_digital(1)

            time.sleep(0.5)

            pin1.write_digital(0)

            pin3.write_digital(0)

            time.sleep(0.5)


        else:

          feedback = "Fix Form"

           

      if per == 100:

        if elbow > staight_angle and shoulder > shoulder_angle and hip > staight_angle:

          feedback = "Down"

          if direction == 1:

            count += 0.5

            direction = 0

            pin1.write_digital(1)

            pin3.write_digital(1)

            time.sleep(0.5)

            pin1.write_digital(0)

            pin3.write_digital(0)

            time.sleep(0.5)

        else:

          feedback = "Fix Form"

            # form = 0

         

           

   

    print(count)

     

    #Draw Bar

    if form == 1:

      cv2.rectangle(img, (580, 50), (600, 380), (0, 255, 0), 3)

      cv2.rectangle(img, (580, int(bar)), (600, 380), (0, 255, 0), cv2.FILLED)

      cv2.putText(img, f'{int(per)}%', (565, 430), cv2.FONT_HERSHEY_PLAIN, 2,

            (255, 0, 0), 2)



    #Pushup counter

    cv2.rectangle(img, (0, 380), (100, 480), (0, 255, 0), cv2.FILLED)

    cv2.putText(img, str(int(count)), (25, 455), cv2.FONT_HERSHEY_PLAIN, 5,

          (255, 0, 0), 5)

     

    #Feedback 

    cv2.rectangle(img, (500, 0), (640, 40), (255, 255, 255), cv2.FILLED)

    cv2.putText(img, feedback, (500, 40 ), cv2.FONT_HERSHEY_PLAIN, 2,

          (0, 255, 0), 2)


     

  cv2.imshow('Pushup counter', img)

  if cv2.waitKey(10) & 0xFF == ord('q'):

    break

   

     

   

     

cap.release()

cv2.destroyAllWindows()

Re-Code the Python Program Again.

bicep curl 1-4.png

Doing "Bicep curl" to drive the hot fire. Firstly, we did the initialization in the program. We added the pyautogui library into the python program.  The bold and italics codes were added and modified. Students not only did "Bicep curls" but also played video games. All these features were the enhancement of the activity.


import pyautogui

cap = cv2.VideoCapture(0)

detector = pm.poseDetector()

lcount = 0

ldirection = 0

lform = 0

lfeedback = "left Fix Form"

rcount = 0

rdirection = 0

rform = 0

rfeedback = "Right Fix Form"

stop = 4 #4d : four hot fire!

Modify the Codes to Detect the Movement of the Left Hands and the Movement of the Right Hands

   The bold and italics codes was added and modified. Sending the character "d" to control the scratch game to give the hot fire.


lper = np.interp(lelbow, (160, 30), (0, 100))

     

    #Bar to show Pushup progress

    lbar = np.interp(lelbow, (160, 30), (280, 50))

    #Percentage of success of pushup

    rper = np.interp(relbow, (160, 30), (0, 100))

     

    #Bar to show Pushup progress

    rbar = np.interp(relbow, (160, 30), (280, 50))



    #Check to ensure right form before starting the program

    if lelbow > 160 and lshoulder < 30:

      lform = 1

      lfeedback = "Correct Left Form"

    if relbow > 160 and rshoulder < 30:

      rform = 1

      rfeedback = "Correct Right Form"

    """else:

      form = 0

      feedback = "Fix Form"

    """   

      

    #Check for full range of motion for the pushup

    if lform == 1:

      if lper == 0:

        if lelbow <30 and lshoulder <30:

          lfeedback = "l_down"

          if ldirection == 0:

            lcount += 0.5

            ldirection = 1

        else:

          lfeedback = "Fix Left Form"

           

      if lper == 100:

        if lelbow >160 and lshoulder <30:

          lfeedback = "l_Up"

          if ldirection == 1:

            lcount += 0.5

            ldirection = 0

        else:

          lfeedback = "Fix Left Form"

    if rform == 1:           

      if rper == 0:

        if relbow <30 and rshoulder <30:

          rfeedback = "r_down"

          if rdirection == 0:

            rcount += 0.5

            rdirection = 1

        else:

          rfeedback = "Fix Right Form"

           

      if rper == 100:

        if relbow >160 and rshoulder <30:

          rfeedback = "r_Up"

          if rdirection == 1:

            rcount += 0.5

            rdirection = 0

        else:

          rfeedback = "Fix Right Form"

      # form = 0

      

   

    print("left: ", lcount)

    print("right: ", rcount)

     

    if (((lcount>4) or (rcount>4)) and (not(stop < 1))):

      pyautogui.typewrite(['d'], 0.2)

      stop = stop - 1

   

     

    #Left Draw Bar

    if lform == 1:

      cv2.rectangle(img, (580, 50), (600, 280), (255, 255, 0), 3)

      cv2.rectangle(img, (580, int(lbar)), (600, 280), (255, 255, 0), cv2.FILLED)

      cv2.putText(img, f'{int(lper)}%', (565, 430), cv2.FONT_HERSHEY_PLAIN, 1,

            (255, 255, 0), 1)



    #Left Pullup counter

    cv2.rectangle(img, (400, 380), (500, 480), (0, 255, 0), cv2.FILLED)

    cv2.putText(img, str(int(lcount)), (425, 455), cv2.FONT_HERSHEY_PLAIN, 2,

          (255, 0, 0), 5)

     

    #Left Feedback 

    cv2.rectangle(img, (500, 0), (640, 40), (255, 255, 255), cv2.FILLED)

    cv2.putText(img, lfeedback, (500, 40 ), cv2.FONT_HERSHEY_PLAIN, 2,

          (0, 255, 0), 2)


    #right Draw Bar

    if rform == 1:

      cv2.rectangle(img, (80, 50), (100, 280), (255, 255, 0), 3)

      cv2.rectangle(img, (80, int(rbar)), (100, 280), (255, 255, 0), cv2.FILLED)

      cv2.putText(img, f'{int(rper)}%', (10, 430), cv2.FONT_HERSHEY_PLAIN, 1,

            (255, 255, 0), 1)



    #Right Pullup counter

    cv2.rectangle(img, (60, 380), (160, 480), (0, 255, 0), cv2.FILLED)

    cv2.putText(img, str(int(rcount)), (85, 455), cv2.FONT_HERSHEY_PLAIN, 2,

          (255, 0, 0), 5)

     

    #Right Feedback 

    cv2.rectangle(img, (0, 0), (140, 40), (255, 255, 255), cv2.FILLED)

    cv2.putText(img, rfeedback, (0, 40 ), cv2.FONT_HERSHEY_PLAIN, 2, 

          (0, 255, 0), 2)

Push-Up = Drive the Car. Amazing!!!

pushup circle

The Video showed that doing push-up could drive the RC car to move.


The boy did the push up.

https://youtu.be/gg_6U7yvDP8


In the STEAM week, more students liked doing the push-ups rather than in the PE lesson.

Bicep-Curl = Hot Fire. Terrific

teacher bicep curl
girl bicep curl

The video showed that doing bicep curls could drive the street fighter to give the hot fire.

The teacher did the bicep curl.

https://youtube.com/shorts/mPqHURSTFSs?feature=share

The girl did the bicep curl.

https://youtube.com/shorts/WSQzZjlousI?feature=share

In the STEAM week, many students and teachers liked doing bicep curls.

Students Enjoyed to Do the Exercises.

Another boy do the push-up again.
A boy did the bicep curl

More than a hundred students played the AI sports games and did the exercises.

Race Track Design I

race track.png

The race track was designed by using Tinkercad.

Race Track Design II

road 1.png
road 2.png
corner2.2.png
corner2.1.png
corner1.2.png
corner1.1.png
corner of track2.png

The corners and the roads of the race track were drawn by using different objects in Tinkercad. The junctions of two blocks were also drawn.

Race Track Design III

slope1.png
slope2.png

The ramps were designed so that the car racing game was more fascinating. The mechanical locks were inserted to the ramps so that the The ramp structure was more solid.

Traffic Safety Cones

road block 1.png
road block 2.png

We used the Tinkercad to design the traffic safety cones and 3D print them.

Remake the Foam Board to Build the Race Track

making the track.png
Image (4).jpg
Image (3).jpg

After the STEAM week, we built the race track by reusing the unused foam boards. The foam boards could be obtained since many decorations were made on the School Information Day. We used toothpicks and glue to assemble the rack track parts. Since the impact of the racing car is large, both toothpicks and glue could provide the solid anti-collision structure. The race track could be decomposed into smaller pieces for storage. In addition, the race track could be transformed. The foam boards were priceless. After the remade process, the value was added to the unused foam boards.

Assembly the Race Track

圖片1.jpg

We divided the race track into different parts and assembled the race track.

The Product of Race Track

Image (2).jpg
Image (1).jpg

We reassembled the race track in a different format. The clips were used to connect all the parts.

3D Print - the Grandstand

stage-tinkercad.png
stage.png
stage 2- tinkercad.png

We used the Tinkercad to design the grandstand and 3D print it.

3D Print - the Lampstand

light-tinkercad.png
light stand.png

We used the Tinkercad to design the lamp post and 3D print it.

3D Print - the Start Point

starting point - components.png
starting point.png

We used the Tinkercad to design the Start Point and 3D print it.

We Were Playing the RC Car Racing Game

pushup girl 2.png
racing track.png
Conclusion - Remake it contest

AI Sports - STEAM Week! We Remake It! More Fun! We reused the materials to make new games, push-ups (drive car), bicep curls (drive hot fire), and car racing competitions (the track). The innovative idea was the fusion of playing the games with doing the exercises. So, more students and teachers could have more fun. In addition, we could learn the technologies by doing exercises and playing games.

Improvement of Remake It

improvement.png

The Conclusion

conclusion.png

Remake the Infinite Sports Game. More Fun! Infinite possibilities!