Little Train Lab 2: IR Sensor Activation
Little Train Lab 2
Objective
Continued improvement of programming capabilities through the installment of an IR sensor. Program the Little Train to activate through hand motion.
Activity
First Students will attach and wire the IR sensor to the Little Train
Learn how the IR sesnor works while programming
Sucessfully program the Little Train to activate through hand motion
Assessment
Students will the basics of sensor functionality
Learn basic circuitry and intermediate coding skills
In the next phase of our Little Train Project, participants will strengthen thier coding prowess with the introduction of sensors. Participants will attatch and follow scehmatics to wire an IR sensor to their microcontroller and be guided in programming thier little train to detect nearby objects and react.
Lab Summary:
Required Materials:
Photo | Material | Purpose | Recommended Quantity |
---|---|---|---|
Little Train Kit | Assembly kit which fosters hands-on skills and familiarizes participants with parts. | 1 Per Participant | |
USB-C Cable | Provides direct upload connection between computer and C2G microcontroller. | 1 Per Participant | |
C2G Mini Microcontroller | Acts as the control center where code instructions are received and electrical signals are sent to various hardware components to execute actions. | 1 Per Participant | |
IR Sensor Kit | Contains 2 IR senors and 2 sets of female-to-female wire sensors to the microcontroller. | 1 Per Participant |
Step 1
Attach and wire the Little Train's IR Sensor in accordance to these steps or following the video below:
Obtain the designated IR sensor kit, wires + velcro
Carefully wire and attach the IR sensor to your Little Train
Start by wiring the VCC, GND and OUT pins accordingly
With the other ends, wire the C2G-Mini with 3V3, GND and GP5 accordinly
With this you are prepared to move onto Step 2
Step 1
Step 2
Programming the Little Train to activate through the IR sensor:
Using the Code2Grow coding workspace, click on the libraries button and select IR sensor
Once selected, click "add to workspace" this will create a base program for coding the IR sensor.
Based on the wired GP pin, in this case: GP5. Make sure the assigned pin matches.
Plug in your USB-C cable into your C2G-Mini, making sure the microconntroller is on
Program the your Little Train and enjoy the actvation of it through hand motion!