Introduction: A DIY Tactile Coding Automaton With Arduino, 3D Printed, and Lego-compatible Parts

Introduction

Today, it is absolutely crucial to provide kids with tools and toys that further them to step into computer programming as part of their STEAM curricula. Tangible steganography is a early approach to fry's coding Education Department. It is easy to start and provides kids with early entree to scheduling. Tangible coding takes advantage of the kid's non-computing device cognition to express language syntax. It also provides an opportunity for kids to become involved in programming with no screen ill-used. The construct of real programming is interchangeable to text-based programming languages in terms of serial execution of instructions. Merely, instead of typewriting the instructions, either personal blocks are placed/stacked in concert or buttons are pressed whereas each object operating theatre button represents a coding instruction such as commands and flow-of-control structures. Children can put building blocks together or urge push buttons in different orders to create a program. Tangible coding console usually comes with a robot that executes the coding commands generated by the user. In that project, we named a tangible coding robot. Therefore, kids can easily program their robots to perform a different variety of tasks such as moving on a limited path or doing objective manipulation. If a mark is attached to the golem, kids lavatory program the robot to make a motion connected different paths to yield drawing patterns on a paper sail. They give notice also produce beautiful scenes by having their automaton dance. In the present stick out, we have made a robot and a remote control tangible coding console table out of Lego technic, bespoken-built 3D written parts, two ready-made DC gear motors, an Arduino plank, NRF modules, and five pushbuttons. You can go ahead and program your golem to progress a specific course by imperative the cinnamon-red push buttons on the coding soothe.

Step 1: General Vista of the Tangible Coding Automaton

When a user presses the push buttons on different orders, a program is created and saved in the Arduino board located on the steganography console. The coding commands are then sent to the robot using a communication channel planted using an NRF module.

Tread 2: Differential Drive Chemical mechanism and Console

In this tutorial, we will take in the structure of the body of the golem using Lego Technic parts. Then, deuce DC geared wheel motors wish drive the first derivative mechanism of the robot to go on any path on the plane.

In the next whole tone, we will add an Arduino Nano board as the brain of the concrete coding robot. Arduino Nano uses a small-size of it powerful microprocessor that makes information technology suitable for depression-weightiness and small-size projects.

Step 3: Make Your Robot Become a Spirograph

Various ready-to-wear motors, sensors, LEDs can be easily connected to Arduino boards. This feature enables United States of America to do a variety of tasks with this robot. For instance, you can draw patterns on a wallpaper by attaching a marker or add RGB LEDs to smatter with light colours.

Step 4: Create Eye-catching Scenes

The manipulator console has five push buttons for dominant the robots to go forward (hot), backward (green), sour right (red), ferment left (puritan), and play (yellow). The command signals are then transmitted to the robot using the NRF module. The instructions are given in a way that you can easily gain one at home.

Step 5: Materials

List of electronic parts

A) 2x Breadboard, 83 x 52 x 9mm

B) 2x Arduino Nano

C)1x Driver Motor

D) 2x NRF 24L01, without Antenna Module

E) 1x Buzzer, Active Type

F) 1x Breadboard, Miniskirt Size

G) 1x Mini Swop, On-off switch Typewrite

H) 2x Major power Jack, Barrel Type

I) 1x Pushbutton

J) Male to Male Jumper Wire

List of Lego Technic components

A) TT Gear Motor

B) 3D Printed Gear Motor Trapping

C) Frame, 5x7 module

D) Steel ball & ball bearing

E) Wheel 61.6mm D. x 13.6mm

F) MotorcycleT-Beam, 3x3 module

G) Connector peg with friction, 2-module

H) 3D Written Lego set-Compatible Coupling

I) Beam, 9-module

J) 2x M3 x 16 Motorcar Screw

K) 1x M3 x 30 Machine Screw

L) Double cross deflect, 3-module

M) Axle, 2-module connector peg with friction/axle, 2-module

N) Ray of light, 7-mental faculty

O) 2x M3 Nut

P) 2x M3 Nut

Step 6: Forum of Mechanical Parts

Lease's lead off off by collecting the physical structure structure of the robot. The body structure holds everything together including the wheels, the casters, and the electronics. Prepare the Lego Technic pieces accordant to the Lego disunite list, and follow the step-past-step video teacher below.

Mistreat 7: 3D Written Parts

In order to hold the DC gear motors in situ and make a proper connectedness to the Lego pieces, we take over used custom-designed, Lego sympathetic, 3D printed motor housings and dig couplings. Download and print retired the motor housings, couplings. Then prepare the required Lego parts from the Lego Technic part list, and keep an eye on the piecemeal mechanistic assembly tutorial.

Step 8: Electronics and Wiring

For this project, you need to assemble some the automaton and the coding console circuits. For assembling the electronic circuits of the touchable coding console and the automaton, follow the video instructions and the schematics cautiously.

Maltreat 9: Programming

Double-check the warnings from the previous section and construct sure everything is accumulated exactly according to the circle diagrams. Now that you have completed the assembly, it's clock to program your robot. Upload the provided codes to your robot and its steganography console.

Robot:

/*   Tangible Coding Robot     The estimation:     In this project, we will show you how to make a tangible programmable robot retired of Lego set Technic pieces,     Arduino boards, off-the-ledge DC motors, and NRF communicating modules.     The current propose uses two Arduino Nano boards every bit the main comptroller of the     robot and the programming cabinet, severally     The circuit:     - In that circuit, an Arduino Nano is used. Any other types of Arduino     can be used of course of action merely do not forget to change the pin configurations     if you want to alter the circuit on your preference.     Visit the Tart Robotics blog for more data:     <a href="https://www.tartrobotics.com/blog" rel="nofollow">  https://www.tartrobotics.com/blog  </a> */  #define motorRightA A0 #define motorRightB A1 #delimit motorRightPWM 6 #delimit motorLeftA A2 #specify motorLeftB A3 #define motorLeftPWM 5  #admit <SPI.h> #include <nRF24L01.h> #include <RF24.h> #admit <Servo.h> RF24 radio(9, 10); // CE, CSN  // Frame-up Adafriut Neopixel LED Ring #include <Adafruit_NeoPixel.h> #define PIXELSPIN 4 #define NUMPIXELS 16 Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIXELSPIN, NEO_GRB + NEO_KHZ800);  const byte address[6] = "00010"; const int motorSpeed = 80, straightTimeDelay = 600, turningTimeDelay = 560;   null setup() {   radio.begin();   radio.openReadingPipe(0, address);   radio.setPALevel(RF24_PA_MIN);   radio.startListening();   pixels.begin(); // Adafriut Neopixel begin   for (int i = 0; i < 17; i++) {     pixels.setPixelColor(i, pixels.Color(0, 0, 0));     pixels.bear witness();   } }  void loop() {    if (radio.useable()) {     // Take and decode book of instructions     char instructions[50] = "";     radio.read(&instructions, sizeof(instructions));      for (int i = 0; i < sizeof(instructions); i++) {       char message = instructions[i];       stopTheRobot();       time lag(200);       if (message == 'f') {         goForward();       } else if (message == 'b') {         goBackward();       } else if (subject matter == 'r') {         goRight();       } else if (message == 'l') {         goLeft();       } else if (message == 's') {         stopTheRobot();         breaking;       }     }   } }  vacancy goForward() {   digitalWrite(motorRightA, Low-lying);   digitalWrite(motorRightB, HIGH);   analogWrite(motorRightPWM, motorSpeed);   digitalWrite(motorLeftA, HIGH);   digitalWrite(motorLeftB, LOW);   analogWrite(motorLeftPWM, motorSpeed);    pixels.setPixelColor(6, pixels.Color(200, 200, 190));   pixels.setPixelColor(7, pixels.Color(200, 200, 190));   pixels.setPixelColor(8, pixels.Color(200, 200, 190));   pixels.setPixelColor(9, pixels.Color(200, 200, 190));   pixels.setPixelColor(10, pixels.Color(200, 200, 190));   pixels.bear witness();    delay(straightTimeDelay);   for (int i = 0; i < 17; i++) {     pixels.setPixelColor(i, pixels.Color(0, 0, 0));     pixels.indicate();   } } void goBackward() {   digitalWrite(motorRightA, HIGH);   digitalWrite(motorRightB, LOW);   analogWrite(motorRightPWM, motorSpeed);   digitalWrite(motorLeftA, Abject);   digitalWrite(motorLeftB, HIGH);   analogWrite(motorLeftPWM, motorSpeed);    pixels.setPixelColor(0, pixels.Color(0, 200, 0));   pixels.setPixelColor(1, pixels.Discolor(0, 200, 0));   pixels.setPixelColor(2, pixels.Color(0, 200, 0));   pixels.setPixelColor(14, pixels.Color(0, 200, 0));   pixels.setPixelColor(15, pixels.Color(0, 200, 0));   pixels.show();    delay(straightTimeDelay);   for (int i = 0; i < 17; i++) {     pixels.setPixelColor(i, pixels.Color(0, 0, 0));     pixels.show();   } } void goLeft() {   digitalWrite(motorRightA, LOW);   digitalWrite(motorRightB, Gamy);   analogWrite(motorRightPWM, motorSpeed);   digitalWrite(motorLeftA, LOW);   digitalWrite(motorLeftB, In flood);   analogWrite(motorLeftPWM, motorSpeed);    pixels.setPixelColor(2, pixels.Color(0, 0, 210));   pixels.setPixelColor(3, pixels.Color(0, 0, 210));   pixels.setPixelColor(4, pixels.Color(0, 0, 210));   pixels.setPixelColor(5, pixels.Color(0, 0, 210));   pixels.setPixelColor(6, pixels.Color(0, 0, 210));   pixels.show();    delay(straightTimeDelay);   for (int i = 0; i < 17; i++) {     pixels.setPixelColor(i, pixels.Color(0, 0, 0));     pixels.show();   } } void goRight() {   digitalWrite(motorRightA, HIGH);   digitalWrite(motorRightB, LOW);   analogWrite(motorRightPWM, motorSpeed);   digitalWrite(motorLeftA, Eminent);   digitalWrite(motorLeftB, LOW);   analogWrite(motorLeftPWM, motorSpeed);    pixels.setPixelColor(10, pixels.Color(200, 0, 0));   pixels.setPixelColor(11, pixels.Color(200, 0, 0));   pixels.setPixelColor(12, pixels.Color(200, 0, 0));   pixels.setPixelColor(13, pixels.Color(200, 0, 0));   pixels.setPixelColor(14, pixels.Color(200, 0, 0));   pixels.show();    delay(straightTimeDelay);   for (int i = 0; i < 17; i++) {     pixels.setPixelColor(i, pixels.Colourise(0, 0, 0));     pixels.show();   } } void stopTheRobot() {   digitalWrite(motorRightA, Squealing);   digitalWrite(motorRightB, HIGH);   analogWrite(motorRightPWM, 0);   digitalWrite(motorLeftA, HIGH);   digitalWrite(motorLeftB, HIGH);   analogWrite(motorLeftPWM, 0); }<br>

Coding console:

/*   Tangible Coding Cabinet     The idea:     Therein project, we bequeath show you how to form a realizable programmable robot tabu of Lego Technic pieces,     Arduino boards, off-the-shelf DC motors, and NRF communication modules.     The occurrent project uses two Arduino Nano boards as the main restrainer of the     automaton and the programing console, respectively     The circuit:     - In this circuit, an Arduino Nano is used. Any other types of Arduino     can be utilized naturally but do not forget to change the tholepin configurations     if you want to change the circuit on your preference.     Visit the Tart Robotics web log for more data:     https://www.tartrobotics.com/blog */  #delimit forward_button 8 #specify backward_button 4 #define right_button 7 #delineate left_button 5 #define startstop_button 6 #delimit buzzerPin A0 #delimit auxGnd A2 //auxiliary ground stick  #admit <SPI.h> #include <nRF24L01.h> #include <RF24.h> RF24 wireless(9, 10); // Cerium, CSN  const byte address[6] = "00010";  void apparatus() {   radio.begin();   radio receiver.openWritingPipe(address);   tuner.setPALevel(RF24_PA_MIN);   radio.stopListening();   pinMode(auxGnd, OUTPUT);   pinMode(buzzerPin, OUTPUT);   digitalWrite(auxGnd, LOW); }  void loop() {   //Take the instructions (50 instructions in a row maximum)   blacken book of instructions[50];   for (int i = 0; i < sizeof(book of instructions); i++)     instructions[i] = NULL;    boolean runTheProgram = false;    int i = 0;   while (i < sizeof(book of instructions)) {     buzz(100);     while (true) {       if (!digitalRead(forward_button)) {         while (!digitalRead(forward_button));         instructions[i] = 'f';         split up;       } else if (!digitalRead(backward_button)) {         while (!digitalRead(backward_button));         instructions[i] = 'b';         break;       } else if (!digitalRead(left_button)) {         piece (!digitalRead(left_button));         instructions[i] = 'r';         faulting;       } other if (!digitalRead(right_button)) {         piece (!digitalRead(right_button));         instructions[i] = 'l';         break;       } else if (!digitalRead(startstop_button)) {         while (!digitalRead(startstop_button));         runTheProgram = true;         break;       }     }     i++;     if (runTheProgram)       break;   }   book of instructions[i] = 's';   buzz(800);   wireles.write(&book of instructions, sizeof(instruction manual)); }  void buzz(int duration) {   digitalWrite(buzzerPin, HIGH);   hold(continuance);   digitalWrite(buzzerPin, LOW); }

Step 10: Run Your Tangible Coding Robot

Please let United States screw what you think about this tutorial by commenting infra. Your feedback will assistant us to improve our future process.

Please visit Lemony Robotics for more DIY creative projects and STEAM-related educational content. Our Socials: Tart Robotics website, YouTube, Instagram, Facebook, Twitter, Pinterest, LinkedIn

Be the First to Share

Recommendations

  • Anything Goes Contest 2022

    Anything Goes Contest 2022