Let's Play Baseball( Arduino Reaction Testing Machine)

by Zhang0821 in Living > Health

417 Views, 0 Favorites, 0 Comments

Let's Play Baseball( Arduino Reaction Testing Machine)

截圖 2021-05-23 下午3.38.28.png

Introduction to my design:

-When you are looking at the above image, you might think of a mobile baseball game, a game that is popular in modern phone games. As a fact, as ages rise, our intelligence, memory, and reaction start to decrease too. Then my design has the function of rehabbing and strengthens our reaction, to keep our brain working without stopping. The design is like a phone game but in a form of physic.

How does my design work:

-The way of operating the product is simple and easy. First, when the user plugin the Arduino motherboard with a computer, the LEDs will start to shine. There are four LEDs, as the last and the bottom LED shines, the user should press the bottom beside as batting, the computer will detect that if the user hits the ball or not, if YES, the LCD besides will show SAFE, if NO, the LCD besides will show OUT.

Target audience:

-Aging people: Their intelligence, memory, and reaction decrease as their age rises. By playing the machine, to strengthen their reaction, keep playing every day, trust the process.

-Athletes: Athletes who are playing sports that stress reaction, like baseball, badminton, etc. By playing the machine, to have better coordination between eyes and hands, to train their reactions.

-Children: Play with the machine as a game for children, instead of play phones, play with the machine to train their reactions.

Possible problems and improvements:

-Might feel boring after playing times

-Too simple and the size of the machine is too big

-Add additional functions- like extends to a more likely a baseball game, extends to have rounded, 3 safse/4 balls/foul, and also can add a home run, hit, etc.

-Not only have one way of pitching, can add many ways to increase the level for users.

Step 1: Supplies Needed

2423666688_a387ea3d8f_b.jpeg
截圖 2021-05-23 下午4.43.46.png
截圖 2021-05-23 下午4.44.55.png
截圖 2021-05-23 下午4.43.30.png
截圖 2021-05-23 下午4.43.19.png
截圖 2021-05-23 下午4.43.06.png
截圖 2021-05-23 下午4.42.52.png
截圖 2021-05-23 下午4.42.37.png
截圖 2021-05-23 下午4.42.16.png
截圖 2021-05-23 下午4.41.09.png
截圖 2021-05-23 下午4.41.59.png

1.Arduino Leonardo

2.Male to male Arduino Jumper Wires

3.Button

4. LEDs

5.LCD

6.Tape

7.Scissor

8.Tap c & Arduino connect line

9.Green resistances & purple resistances

10.Any box that is bigger than the Arduino Leonardo

Step 2: Connecting the Circuit

截圖 2021-05-23 下午4.53.32.png
截圖 2021-05-23 下午5.01.55.png
截圖 2021-05-23 下午5.02.29.png
截圖 2021-05-23 下午5.02.58.png

1. + line wires to 5v

2. - line wires to GND

3.1st LED, first wires two wires with a LED, then two sides of the LED wire to green resistance, wire a line to D-pin 11(in front of the LED), wire with - line.

4.2st LED, first wires two wires with a LED, then two sides of the LED wire to green resistance, wire a line to D-pin 10(in front of the LED), wire with - line.

5.3st LED, first wires two wires with a LED, then two sides of the LED wire to green resistance, wire a line to D-pin 9(in front of the LED), wire with - line.

6.Button, first wires two wires with the button, then two wires of the button wire to purple resistance, wire a line to D-pin 12(in front of the button line), wire with - line and +line.

7.LCD, SCL with SCL, SDA with SDA, connect + with VNN, connect - with GND.

Step 3: Make and Draw a Box

截圖 2021-05-23 下午5.11.56.png
截圖 2021-05-23 下午3.38.28.png

First: Find a box that is bigger than the Arduino Leonardo

Second: Draw a baseball field

Third: Cut holes for putting LEDs, LCD, and buttons.

Step 4: Code

#include
#include

// For these LCD controls to work you MUST replace the standard LCD library from... // https://github.com/marcoschwartz/LiquidCrystal_I2C // Direct download https://github.com/marcoschwartz/LiquidCrystal_I2C/archive/master.zip // Your project will not compile until this is done. LiquidCrystal_I2C lcd_I2C_27(0x27,16,2); // set the LCD address for a 16 chars and 2 line display

void setup(){ // put your setup code here, to run once: pinMode( 11 , OUTPUT); // sets the digital pin as output pinMode( 10 , OUTPUT); // sets the digital pin as output pinMode( 9 , OUTPUT); // sets the digital pin as output pinMode( 4 , OUTPUT); // sets the digital pin as output pinMode( 12 , INPUT); // sets the digital pin as input lcd_I2C_27.init (); // initialize the lcd lcd_I2C_27.backlight(); }

void loop(){ // put your main code here, to run repeatedly: digitalWrite( 11 , HIGH ); // sets the digital pin on/off digitalWrite( 10 , LOW ); // sets the digital pin on/off digitalWrite( 9 , LOW ); // sets the digital pin on/off digitalWrite( 4 , LOW ); // sets the digital pin on/off delay( random( 1000 , 3000 ) ); // waits a few milliseconds digitalWrite( 11 , LOW ); // sets the digital pin on/off digitalWrite( 10 , HIGH ); // sets the digital pin on/off digitalWrite( 9 , LOW ); // sets the digital pin on/off digitalWrite( 4 , LOW ); // sets the digital pin on/off delay( random( 1000 , 3000 ) ); // waits a few milliseconds digitalWrite( 11 , LOW ); // sets the digital pin on/off digitalWrite( 10 , LOW ); // sets the digital pin on/off digitalWrite( 9 , HIGH ); // sets the digital pin on/off digitalWrite( 4 , LOW ); // sets the digital pin on/off delay( random( 1000 , 3000 ) ); // waits a few milliseconds digitalWrite( 11 , LOW ); // sets the digital pin on/off digitalWrite( 10 , LOW ); // sets the digital pin on/off digitalWrite( 9 , LOW ); // sets the digital pin on/off digitalWrite( 4 , HIGH ); // sets the digital pin on/off delay( random( 1000 , 1500 ) ); // waits a few milliseconds if (digitalRead( 12 )) { lcd_I2C_27.clear(); lcd_I2C_27.setCursor(0 , 0) ; // set the cursor, counting begins with 0 lcd_I2C_27.print( "SAFE" ); // Print a message to the LCD. delay( 1000 ); // waits a few milliseconds lcd_I2C_27.clear(); } else { lcd_I2C_27.clear(); lcd_I2C_27.setCursor(0 , 0) ; // set the cursor, counting begins with 0 lcd_I2C_27.print( "OUT" ); // Print a message to the LCD. delay( 1000 ); // waits a few milliseconds lcd_I2C_27.clear(); } }

Step 5:My Code on Arduino Cloud

Step 6:Final Product

Let's play baseball(Arduino reaction testing machine)