top of page

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

Natural Light Portrait

Attach and wire the Little Train's IR Sensor in accordance to these steps or following the video below:


  1. Obtain the designated IR sensor kit, wires + velcro

  2. Carefully wire and attach the IR sensor to your Little Train

  3. Start by wiring the VCC, GND and OUT pins accordingly

  4. With the other ends, wire the C2G-Mini with 3V3, GND and GP5 accordinly

  5. With this you are prepared to move onto Step 2

Step 1

Step 2

Natural Light Portrait

Programming the Little Train to activate through the IR sensor:


  1. Using the Code2Grow coding workspace, click on the libraries button and select IR sensor

  2. Once selected, click "add to workspace" this will create a base program for coding the IR sensor.

  3. Based on the wired GP pin, in this case: GP5. Make sure the assigned pin matches.

  4. Plug in your USB-C cable into your C2G-Mini, making sure the microconntroller is on

  5. Program the your Little Train and enjoy the actvation of it through hand motion!

bottom of page