Difference between revisions of "ElectroBlocks/C2/Solar-Tracking-System/English"
(Created page with "{| border="1" |- || '''Visual Cue''' || '''Narration''' |- || '''Slide 1:''' '''Title Slide''' || Welcome to the '''Spoken Tutorial''' on '''Solar Tracking System '''using ''...") |
(No difference)
|
Latest revision as of 18:21, 18 November 2025
| Visual Cue | Narration |
| Slide 1:
Title Slide |
Welcome to the Spoken Tutorial on Solar Tracking System using Electroblocks. |
| Slide 2:
Learning Objectives |
In this tutorial, we will learn about,
|
| Slide 3:
System requirement |
To record this tutorial, I am using the following setup. |
| Slide 4:
About Solar tracking system |
|
| Slide:5
Code file |
|
| Type | Let us open the ElectroBlocks website in the Chrome browser. |
| Only narration | Let us open a new blank project. |
|
Click on the Projects icon located on the toolbar. Select the Choose File option. Locate and open the solar tracking system.xml file. A pop-up window will appear on the screen.Click OK. |
Extract the zip file downloaded in the download folder.
In this tutorial, we will see how to load an existing saved project and work on it. On the toolbar Click on the Projects icon. Select the Choose File option. And open the Solar Tracking System.xml file in the extracted zip folder. A pop-up window will appear on the screen.Click OK. The Solar Tracking System project is loaded with the required blocks for this experiment. |
| This is the complete setup of the Solar Tracking System. | |
| Point to simulation window and zoom the circuit
Point according to the narration |
The circuit is displayed in the simulation window.
Here, two Light sensors are used to detect the light. The servo motor rotates according to the movement of the sun. |
| Only narration | Now, let’s explore the code and the corresponding blocks to understand how it works. |
| Click on the code icon | Click on the Code icon. |
| #include <Servo.h> // Includes the Servo library for controlling servo motors | Servo.h is the the Servo header library, which provides built-in functions to control servo motors |
| Servo servo_2; // Creates a servo object | Creates a Servo object named servo_2, which is used to control a connected servo motor. |
| double spoint = 0; | Spoint is the variable which stores the current angle of the servo motor. |
| pinMode(A5, INPUT);
pinMode(A4, INPUT); |
In the working area, two analog setup blocks are displayed.
These blocks are used to configure the analog sensors. The sensors are connected to analog pins A5 and A4. In the code window , within the void setup() function, pins A5 and A4 are defined as input. In the setup blocks, sensor readings of 512 and 1024 are shown. These values represent the analog readings from the photo sensors. |
| servo_2.attach(2); | The servo motor is connected to pin 2 in the block so that this code is generated. |
| In the working area, the servo motor is linked to a variable called spoint. | |
| if (((double)analogRead(A5) < (double)analogRead(A4))) {
spoint = (spoint + 9); delay(1000); / |
Let us see the condition in the First IF-THEN Block.
If true, the servo motor arm is rotated by 9 degrees to move towards the light. A short delay is added to slow down the movement, making the rotation smooth and realistic. |
| if (((double)analogRead(A5) > (double)analogRead(A4))) { | Now in the second IF-THEN Block, it compares the analog values at A5 and A4,
If the light is more on the A5 the servo rotates to the left. |
| spoint = (spoint - 9); | If the light on A4 is more when compared to A5 then the motor rotates to the right side. |
| Let’s check the output using the simulator. | |
| Click on Home icon on the tool bar.
Click on the Play button |
Click on Home icon.
Now click on the Play button to start the simulation. |
| Point to simulation window | We can see the servo motor rotates from 0 to 126 degrees when sensor1 value is less than sensor 2. |
| Only narration.
Click on the first setup sensor reading number box and change it to 1024. Similarly Click on the second setup sensor reading number box and change it to 512 Again click on the Play button to start the simulation Point to simulation window Only narration |
Let us check the output of the project if sensor1 value is greater than sensor2 value.
Click on the first setup sensor reading number box and change it to 1024. Then Click on the second setup sensor reading number box and change it to 512. Next change the spoint value to 126. Click on the Play button to start the simulation. Now we can see the servo motor rotates from 126 to 0 degrees. |
| Slide:
Summary In this tutorial, we will learn about#Solar Tracking System
|
This brings us to the end of this tutorial.Let us summarise. |
| Slide:
Assignment:
|
As an assignment, please do the following |
| Slide 12:
Thank you |
Thank you for joining. |