Roboki - Session 3: Difference between revisions

From Yudurobotics
mNo edit summary
m (Protected "Roboki - Session 3": Edit warring ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) [cascading])
(No difference)

Revision as of 15:54, 23 September 2024

Dive into Basics: Sensor ON - Step-by-Step

Description :

Discover the process of connecting an external proximity sensor to the Roboki microcontroller in this engaging project. As you link the sensor, experience how the built-in LED responds by changing colors according to the distance of an object. This activity provides a practical introduction to sensor-driven LED control, demonstrating how microcontrollers interpret sensor data to create dynamic visual effects. Ideal for young engineers eager to dive into sensor integration and explore the fascinating world of microcontroller applications.

Objective of the Activity:

This activity demonstrates the practical use of sensors in robotics and electronics. By integrating a proximity sensor with Roboki, we will create a system that reacts to its environment—an essential concept in automation, robotics, and even smart devices.By mastering this activity , we will learn how to take sensor readings and turn them into actions, whether lighting up a simple LED or creating dynamic color displays with an RGB LED to real-world concepts that can be extended to more complex robotics projects. These are key ideas that form the foundation of building responsive, intelligent systems.

Before we begin, let us take a look at the Roboki and range sensor, including the external ports A and B where the proximity sensor and other external components are connected. This will help us understand how to use these parts effectively for our projects.

HARDWARE

Introduction to Roboki and Proximity Sensors

Roboki, a powerful and user-friendly microcontroller, opens the door to endless possibilities in robotics and electronics. In this activity, we will explore how to interface Roboki with an external proximity sensor to control LED lights. A proximity sensor detects the presence of nearby objects without physical contact, making it ideal for applications that require distance measurement or object detection. Roboki has two ports ; port A and port B. Any external component can be connected to this port.

This guide will take you through the steps of connecting the proximity sensor, reading its values, and using those readings to control LEDs, including programming an RGB LED to display different colors based on sensor data.

Proximity sensor

Range sensor.jpg

A proximity sensor measures the distance between itself and an object by emitting electromagnetic radiation (like infrared) and detecting the reflection. When the object comes within a certain range, the sensor picks up a signal, and Roboki can use this information to trigger an output.

Key Features of a Proximity Sensor:

  • Detects objects without physical contact.
  • Provides distance-based values that can be used to trigger actions.
  • Commonly used in automation systems and robotics.

Connecting the Proximity Sensor to Roboki:

Step 1: Ensure Roboki is powered and ready to connect to external components.

Step 2: Connect the proximity sensor to Roboki’s designated ports and connect it while coding accordingly.

Reading Values from the Proximity Sensor:

Once the sensor is connected, Roboki can start reading the sensor values. In the Plode app :

  • The sensor provides a range of values that reflect how close or far an object is from the sensor.
  • High sensor value: Object is closer.
  • Low sensor value: Object is farther away.

Connecting sensors.

1. Place the Roboki  on a flat surface  as shown in the image below.


Roboki on a surface.jpg


2. Connect the range sensor to Roboki port A using an angle connector. Ensure that the range sensor is connected in the correct direction, as connecting it incorrectly may result in inaccurate sensor readings. Connect the sensor as shown in the image to avoid issues.

Roboki connected to sensor.jpg

SOFTWARE

Now, let us program our Roboki to recognise readings from the proximity sensor and use them to control the LED. To do this, we will connect Roboki to the PLODE app, where we can write and upload the code needed to make the sensor readings trigger LED actions. By programming the Roboki, we will be able to illuminate the LEDs based on the proximity sensor reading. Follow the step-by-step instructions in the video below to complete the coding process and get your Roboki ready to light up its LEDs based on sensor values.


What Next?

Challenge!

Create a program to control an RGB LED and make it illuminate in different colors using a sensor.