Difference between revisions of "ElectroBlocks-archive-sept-2025/C2/Traffic-Lights/English"
Ketkinaina (Talk | contribs) (Created page with "'''Title of the Script: Traffic Lights ''' '''Author: Pratik Nemane''' '''Keywords: '''Electroblocks, arduino board, 220 ohm resistor, LEDs breadboard, spoken tutorial, vide...") |
m (Madhurig moved page ElectroBlocks/C2/Traffic-Lights/English to ElectroBlocks-archive-sept-2025/C2/Traffic-Lights/English without leaving a redirect) |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| − | + | Title of the Script: Traffic Lights | |
| − | + | Author: Pratik Nemane | |
| − | + | Keywords: Electroblocks, arduino board, 220 ohm resistor, LEDs, breadboard, spoken tutorial, video tutorial. | |
{| border=1 | {| border=1 | ||
| − | + | ||'''Visual Cue''' | |
| − | || '''Visual Cue''' | + | ||'''Narration''' |
| − | || '''Narration''' | + | |
| − | |- | + | |- |
| − | || '''Slide 1''' | + | ||'''Slide 1''' |
'''Title slide''' | '''Title slide''' | ||
| − | || Welcome to the Spoken Tutorial on '''Traffic Lights''' using '''Electroblocks'''. | + | ||Welcome to the Spoken Tutorial on '''Traffic Lights''' using '''Electroblocks'''. |
| − | |- | + | |
| − | || '''Slide 2''' | + | |- |
| + | ||'''Slide 2''' | ||
'''Learning Objectives''' | '''Learning Objectives''' | ||
| − | || In this tutorial, we will learn how to, | + | ||In this tutorial, we will learn how to, |
| + | |||
# Build a set of blocks to create a Traffic Light project | # Build a set of blocks to create a Traffic Light project | ||
# Check the output of the experiment using the simulator | # Check the output of the experiment using the simulator | ||
| Line 26: | Line 28: | ||
| − | |- | + | |- |
| − | || '''Slide 3''' | + | ||'''Slide 3''' |
'''System Requirements''' | '''System Requirements''' | ||
| − | || To record this tutorial, I am using: | + | ||To record this tutorial, I am using: |
| + | |||
* Ubuntu Linux OS version 22.04 | * Ubuntu Linux OS version 22.04 | ||
* Google Chrome browser | * Google Chrome browser | ||
A working internet connection to use '''Electroblocks'''. | A working internet connection to use '''Electroblocks'''. | ||
| − | |- | + | |
| − | || '''Slide 4''' | + | |- |
| + | ||'''Slide 4''' | ||
'''Prerequisite''' | '''Prerequisite''' | ||
| Line 42: | Line 46: | ||
'''https://spoken-tutorial.org''' | '''https://spoken-tutorial.org''' | ||
| − | || To follow this tutorial, | + | ||To follow this tutorial, |
| − | * Learner should have a basic knowledge of Electroblocks interface | + | |
| + | * Learner should have a basic knowledge of '''Electroblocks''' interface | ||
* If not, please visit the relevant tutorials on this website. | * If not, please visit the relevant tutorials on this website. | ||
| − | |- | + | |- |
| − | || Type [https://electroblocks.org/ https://electroblocks.org/] ''' | + | ||Type [https://electroblocks.org/ https://electroblocks.org/] ''' |
Highlight the link in the search tab | Highlight the link in the search tab | ||
| Line 53: | Line 58: | ||
[https://electroblocks.org/ https://electroblocks.org/] | [https://electroblocks.org/ https://electroblocks.org/] | ||
| − | || Let us open the '''Electroblocks | + | ||Let us open the '''Electroblocks''' platform using '''Google Chrome browser. ''' |
| Line 59: | Line 64: | ||
| − | You will see the default | + | You will see the default ''' Blink LED''' circuit on the screen. |
| − | |- | + | |
| − | || Click on the''' New File '''icon. | + | |- |
| + | ||Click on the''' New File '''icon. | ||
| Line 68: | Line 74: | ||
Click the '''OK''' button. | Click the '''OK''' button. | ||
| − | || Click on the '''New File/Blank file''' option available on the toolbar. | + | ||Click on the '''New File/Blank file''' option available on the toolbar. |
| Line 74: | Line 80: | ||
Click the '''OK''' button to start a new project. | Click the '''OK''' button to start a new project. | ||
| − | |||
| − | |||
| − | |||
| + | |- | ||
| + | ||Point to the number 3 in the loop block. | ||
| + | ||Observe the loop block in the working area. | ||
It indicates that the simulation will run for 3 times. | It indicates that the simulation will run for 3 times. | ||
| − | |- | + | |
| − | || Point to 3. | + | |- |
| + | ||Point to 3. | ||
| + | |||
Click to change the number from 2 to 3. | Click to change the number from 2 to 3. | ||
| − | || Let us change the number to 2. | + | ||Let us change the number to 2. |
This will simulate the code for 2 times. | This will simulate the code for 2 times. | ||
| − | |||
| − | |||
| − | |||
| + | |- | ||
| + | ||Add the entire Output video.mp4 in the main video at the 1:32 timestamp. | ||
| − | Let’s | + | ||We will create this '''traffic light''' output. |
| − | |- | + | |
| − | || Main Video.mp4 | + | |
| + | Let’s get started by building '''traffic lights''' using '''Electroblocks'''. | ||
| + | |||
| + | |- | ||
| + | ||Main Video.mp4 | ||
Click on the '''Add-ons''' menu. | Click on the '''Add-ons''' menu. | ||
| + | |||
Select '''LED''' Option | Select '''LED''' Option | ||
| − | || We need three '''LED''' blocks with different colours, namely, red, orange and green. | + | ||We need three '''LED''' blocks with different colours, namely, red, orange and green. |
| Line 115: | Line 127: | ||
| − | |- | + | |- |
| − | || Click on the Turn '''LED''' '''block''' and drag it in the working area. | + | ||Click on the Turn '''LED''' '''block''' and drag it in the working area. |
| Line 123: | Line 135: | ||
Point to the '''LED'''. | Point to the '''LED'''. | ||
| − | || Click | + | ||Click and place the '''Turn LED''' block inside the loop block. |
| − | + | ||
| − | + | ||
| − | + | ||
| Line 134: | Line 143: | ||
You can see an '''LED''' connected to the '''arduino'''. | You can see an '''LED''' connected to the '''arduino'''. | ||
| − | + | |- | |
| − | |- | + | ||Zoom in to show the resistor |
| − | || Zoom in to show the resistor | + | |
| Line 142: | Line 150: | ||
| − | || Let us Zoom in to see the circuit connection clearly. | + | ||Let us Zoom in to see the circuit connection clearly. |
| Line 148: | Line 156: | ||
| − | By default, the '''LED''' is always connected to pin 2 of''' Arduino | + | By default, the '''LED''' is always connected to pin 2 of ''' Arduino'''. |
| − | + | ||
| − | + | ||
| − | + | ||
| + | |- | ||
| + | ||Change the''' LED pin '''and '''LED''' colour | ||
| + | ||Change the '''pin''' number to '''pin 12'''. | ||
| − | |||
| + | Click on the colour section on the '''LED block''' and select the green colour. | ||
| + | |||
| + | |- | ||
| + | ||Only narration | ||
| − | |||
| − | |||
| − | |||
Add the''' Wait block''' | Add the''' Wait block''' | ||
| Line 174: | Line 182: | ||
Change to 4 seconds | Change to 4 seconds | ||
| − | || Let’s make sure that the '''LED''' remains turned '''ON''' for a | + | ||Let’s make sure that the '''LED''' remains turned '''ON''' for a specific amount of time. |
| Line 183: | Line 191: | ||
| − | Drag and | + | Drag and place '''Wait block for 0.2 seconds''' block below the '''turn ON LED''' block. |
| − | + | Change the time to 4 seconds in the block as shown. | |
| + | |- | ||
| + | ||Only narration | ||
| − | |||
| − | |||
| − | |||
Duplicate the '''LED block''' | Duplicate the '''LED block''' | ||
| − | || Let’s turn '''OFF''' the green '''LED'''. | + | |
| + | ||Let’s turn '''OFF''' the green '''LED'''. | ||
| Line 203: | Line 211: | ||
This action creates an identical block in the working area. | This action creates an identical block in the working area. | ||
| − | |- | + | |
| − | || Point to '''Duplicate block ''' | + | |- |
| + | ||Point to '''Duplicate block ''' | ||
| Line 214: | Line 223: | ||
Change state of the '''LED''' | Change state of the '''LED''' | ||
| − | || Drag and place this block below the '''Wait for 4 seconds''' block. | + | ||Drag and place this block below the '''Wait for 4 seconds''' block. |
| − | To change the state of the '''LED''', click the | + | To change the state of the '''LED''', click the drop down arrow and select '''OFF'''. |
This block turns OFF the LED connected to pin 12. | This block turns OFF the LED connected to pin 12. | ||
| − | |- | + | |
| − | || Duplicate the '''LED block''' | + | |- |
| + | ||Duplicate the '''LED block''' | ||
| Line 230: | Line 240: | ||
Drag and place this new block below the green colour led block as shown. | Drag and place this new block below the green colour led block as shown. | ||
| − | || Now, let's add a second''' LED''' block to represent the orange colour. | + | ||Now, let's add a second''' LED''' block to represent the orange colour. |
| − | Right click on the '''LED '''block and select the '''Duplicate''' option. | + | |
| + | Right click on the '''LED ''' block and select the '''Duplicate''' option. | ||
Drag and place this new block below the green colour led block as shown. | Drag and place this new block below the green colour led block as shown. | ||
| − | |- | + | |
| − | || click on the dropdown arrow and select On. | + | |- |
| + | ||click on the dropdown arrow and select On. | ||
| Line 244: | Line 256: | ||
Click on the colour section on the LED block and select orange colour. | Click on the colour section on the LED block and select orange colour. | ||
| − | |||
| + | ||To change the state of the ''' LED''', click on drop down arrow and select '''ON'''. | ||
| − | Click on the pin 12 | + | |
| + | Click on the pin 12 drop down menu and change the '''pin''' number to '''pin 11'''. | ||
Click on the '''colour''' section on the '''LED''' block and select '''orange''' colour. | Click on the '''colour''' section on the '''LED''' block and select '''orange''' colour. | ||
| − | |- | + | |
| − | || | + | |- |
| + | ||Duplicate the wait for 4 seconds block | ||
Place this block below the''' LED turn ON''' block. | Place this block below the''' LED turn ON''' block. | ||
| + | |||
Change the time to 1 second. | Change the time to 1 second. | ||
| − | || Let us keep the orange LED turned ON for 1 second. | + | ||Let us keep the orange LED turned ON for 1 second. |
| Line 264: | Line 279: | ||
| − | Place this block below the LED turn ON block. | + | Place this block below the LED ''' turn ON '''block. |
Change the time to '''1 second''' as shown. | Change the time to '''1 second''' as shown. | ||
| − | |- | + | |
| − | || Duplicate the''' LED block''' | + | |- |
| + | ||Duplicate the''' LED block''' | ||
| Line 279: | Line 295: | ||
To change the state of the '''LED''', click on the dropdown arrow and select off. | To change the state of the '''LED''', click on the dropdown arrow and select off. | ||
| − | |||
| + | ||We will now turn '''OFF''' the orange LED. | ||
| − | Right click on the Turn LED | + | |
| + | Right click on the Turn LED on and select the '''Duplicate''' option. | ||
| Line 288: | Line 305: | ||
| − | + | Change the state of the LED to OFF. | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | |- | |
| + | ||Highlight the red '''LED''' block setup between the 5:45 to 6:06 timestamp. | ||
| + | ||Duplicate the previous LED block and place it below the orange LED block. | ||
| − | |||
| + | Change the '''pin''' number to 10 and select RED colour. | ||
| − | |||
| + | Duplicate the '''Wait''' block and set the time to '''2 seconds'''. | ||
| − | + | |- | |
| − | |- | + | ||Only narration |
| − | || Only narration | + | |
| Line 312: | Line 327: | ||
Point the cursor to arduino code | Point the cursor to arduino code | ||
| − | || Let us switch to the '''arduino | + | ||Let us switch to the '''arduino code''' section. |
| Line 318: | Line 333: | ||
| − | An '''Arduino | + | An '''Arduino code''' for a traffic light experiment is generated here. |
| − | |- | + | |
| − | || Point the cursor to arduino code | + | |- |
| − | || The '''LED | + | ||Point the cursor to arduino code |
| − | |- | + | ||The '''LED pin''' connections are defined in the void setup function. |
| − | || Point the cursor to arduino code | + | |
| + | |- | ||
| + | ||Point the cursor to arduino code | ||
Highlight '''digitalWrite(12, HIGH)''' | Highlight '''digitalWrite(12, HIGH)''' | ||
| − | || The working of these 3 '''LEDs''' is explained in the void loop function. | + | ||The working of these 3 '''LEDs''' is explained in the void loop function. |
| − | The '''digitalWrite(12, HIGH)''' command says that the green '''LED''' | + | The '''digitalWrite(12, HIGH)''' command says that the green '''LED''' has to be turned ON. |
| − | + | ||
| − | + | ||
| − | + | ||
| + | |- | ||
| + | ||Highlight the '''delay(4000) ''' | ||
| + | ||The '''delay(4000)''' line of code makes sure that the green '''LED''' is '''ON''' for 4 seconds. | ||
In the arduino syntax, '''4000 milliseconds''' represent '''4 seconds.''' | In the arduino syntax, '''4000 milliseconds''' represent '''4 seconds.''' | ||
| − | |- | + | |- |
| − | || Highlight '''digitalWrite(12, LOW)''' | + | ||Highlight '''digitalWrite(12, LOW)''' |
| + | |||
Highlight remaining all code | Highlight remaining all code | ||
| − | || The''' digitalWrite(12, LOW)''' command says that the green LED | + | ||The''' digitalWrite(12, LOW)''' command says that the green LED has to be turned off. |
Similarly, orange and red '''LEDs''' will be turning '''ON''' and turning '''OFF''' after a given interval. | Similarly, orange and red '''LEDs''' will be turning '''ON''' and turning '''OFF''' after a given interval. | ||
| − | |- | + | |
| − | || Point to the simulator. | + | |- |
| − | || Let’s check the desired results using the '''simulator'''. | + | ||Point to the simulator. |
| − | |- | + | ||Let’s check the desired results using the '''simulator'''. |
| − | || Click on '''Home''' page | + | |
| + | |- | ||
| + | ||Click on '''Home''' page | ||
Click on the play button | Click on the play button | ||
| − | || Click on the '''Home''' | + | ||Click on the '''Home''' page option from the toolbar. |
Click on the '''Play''' button to start the simulation. | Click on the '''Play''' button to start the simulation. | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |- | + | |- |
| − | || One by one step | + | ||Point towards the simulation window. |
| + | ||The visual representation of the simulation shows that: | ||
| + | |||
| + | * The green '''LED''' connected to pin 12 turns ON for 4 seconds, then turns OFF. | ||
| + | |||
| + | * After that the orange '''LED''' connected to pin 11 turns ON for 1 second, then turns OFF. | ||
| + | |||
| + | * Then the red '''LED ''' connected to pin 10 turns ON for 2 seconds, then turns OFF. | ||
| + | |||
| + | |- | ||
| + | ||One by one step | ||
| + | |||
Click the '''Previous''' '''Step''' button | Click the '''Previous''' '''Step''' button | ||
| Line 373: | Line 398: | ||
Click on the '''Next Step '''button | Click on the '''Next Step '''button | ||
| + | |||
Highlight the '''Loop''' block | Highlight the '''Loop''' block | ||
| − | || To see the simulation in the '''step by step '''manner, | + | ||To see the simulation in the '''step by step '''manner, |
| Line 385: | Line 411: | ||
The '''execution''' state of the '''block''' is highlighted with a yellow colour outline. | The '''execution''' state of the '''block''' is highlighted with a yellow colour outline. | ||
| − | |- | + | |
| − | || Only narration | + | |- |
| + | ||Only narration | ||
Click on the '''Download''' icon | Click on the '''Download''' icon | ||
| Line 393: | Line 420: | ||
Click on the '''Download''' '''project''' option. | Click on the '''Download''' '''project''' option. | ||
| − | |||
| + | ||Let us now '''download''' the project in our system. | ||
| − | + | ||
| + | click on the '''Download''' icon. | ||
Then, select the '''Download Project''' option. | Then, select the '''Download Project''' option. | ||
| − | |||
| − | |||
| + | |- | ||
| + | ||Select the directory | ||
| − | |||
| + | Click on the '''Home''' icon | ||
| − | || Select a directory and save the project with the filename '''Traffic Light'''. | + | ||Select a directory and save the project with the filename '''Traffic Light'''. |
Click on the '''Home''' icon. | Click on the '''Home''' icon. | ||
| Line 417: | Line 445: | ||
| − | + | |- | |
| − | |- | + | ||'''Slide 5''' |
| − | || '''Slide 5''' | + | |
'''Hardware Requirements''' | '''Hardware Requirements''' | ||
| − | || To perform this experiment, we require | + | ||To perform this experiment, we require |
| + | |||
* 3 '''LEDs''' (red, green, orange) | * 3 '''LEDs''' (red, green, orange) | ||
| − | * 3 ''' | + | * 3 '''Resistors''' (220 '''Ohms''') |
* '''Arduino Uno''' | * '''Arduino Uno''' | ||
* '''Arduino '''cable | * '''Arduino '''cable | ||
| − | * '''Breadboard '''and | + | * '''Breadboard '''and '''connecting wires''' |
| − | |- | + | |- |
| − | || '''Slide 6''' | + | ||'''Slide 6''' |
'''Circuit Diagram.png''' | '''Circuit Diagram.png''' | ||
| − | || Please refer to this '''circuit diagram''' to make the circuit connections. | + | ||Please refer to this '''circuit diagram''' to make the circuit connections. |
| − | |- | + | |
| − | || Add image | + | |- |
| + | ||Add image | ||
Text box | Text box | ||
| − | || Connect the '''arduino''' to your system with an '''arduino''' cable. | + | ||Connect the '''arduino''' to your system with an '''arduino''' cable. |
| − | Windows users can go directly to the ''' | + | Windows users can go directly to the '''electroblocks''' and '''upload''' the code. |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| + | |- | ||
| + | ||Setup for '''Ubuntu''' users only. | ||
Open the '''terminal''' | Open the '''terminal''' | ||
| − | |||
| − | |||
| Line 472: | Line 496: | ||
| − | + | ||For '''Ubuntu '''users, please follow the steps mentioned below. | |
| − | || For '''Ubuntu '''users, please follow the steps mentioned below. | + | |
| Line 493: | Line 516: | ||
Type the '''password''' and press '''Enter'''. | Type the '''password''' and press '''Enter'''. | ||
| − | + | |- | |
| − | + | ||Type sudo chmod -R 775 /dev/ttyACM0 | |
| − | |- | + | |
| − | || | + | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | Type sudo chmod -R 775 /dev/ttyACM0 | + | |
| Line 510: | Line 527: | ||
Point to command | Point to command | ||
| − | |||
| − | |||
| Line 518: | Line 533: | ||
Go to the electroblocks website and click on the upload button. | Go to the electroblocks website and click on the upload button. | ||
| − | || Then type, | + | ||Then type, |
| Line 530: | Line 545: | ||
| − | This command initiates the communication between '''Electroblocks | + | This command initiates the communication between '''Electroblocks website''' and '''arduino board.''' |
| − | If an error occurs, go back to the '''electroblocks''' website and click on the '''Upload | + | If an error occurs, go back to the '''electroblocks''' website and click on the '''Upload button'''. |
| − | + | ||
| − | + | ||
| + | |- | ||
| + | ||Click on the upload code button and check the arduino USB port name. | ||
| + | ||Click on the''' upload code button''' and check the '''arduino USB''' '''port''' name. | ||
| + | Use the '''port''' name and change it accordingly in the '''sudo command.''' | ||
| + | You have to run these commands only once. | ||
| − | || | + | |- |
| + | ||Restart the system | ||
| + | ||We have to '''restart''' the system to save these changes. | ||
| − | + | |- | |
| − | + | ||Open the '''electroblocks''' website. | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | |- | + | |
| − | || Open the '''electroblocks''' website. | + | |
| Line 570: | Line 582: | ||
Point to Pop up window | Point to Pop up window | ||
| − | |||
| − | |||
Click on the ok button | Click on the ok button | ||
| − | |||
| − | |||
Point to''' traffic light project.''' | Point to''' traffic light project.''' | ||
| − | || Open the '''electroblocks''' website again. | + | ||Open the '''electroblocks''' website again. |
| Line 586: | Line 594: | ||
| − | Click on the ''' | + | Click on the '''Projects''' icon on the toolbar. |
| Line 595: | Line 603: | ||
| − | A pop-window | + | A pop-window will appear on the screen to confirm if you want to open a new file. |
| Line 601: | Line 609: | ||
| − | The '''Traffic light project '''appears on the screen. | + | The '''Traffic light project ''' appears on the screen. |
| − | |- | + | |
| − | || Only narration | + | |- |
| − | || Let’s '''upload''' this '''code''' on the '''arduino | + | ||Only narration |
| − | |- | + | ||Let’s '''upload''' this '''code''' on the '''arduino uno''' to perform the same experiment with hardware. |
| − | || Click on the '''Upload''' code option on the right hand side of your screen. | + | |
| + | |- | ||
| + | ||Click on the '''Upload''' code option on the right hand side of your screen. | ||
| Line 615: | Line 625: | ||
| − | + | ||Click on the '''Upload''' button on the toolbar. | |
| − | || Click on the '''Upload''' button on the toolbar. | + | |
| Line 626: | Line 635: | ||
Select the '''port''' to which '''Arduino''' is connected and click on '''Connect''' button. | Select the '''port''' to which '''Arduino''' is connected and click on '''Connect''' button. | ||
| − | |||
| − | |||
| − | + | |- | |
| − | + | ||Point to''' Good Job '''message on the screen. | |
| − | Point to''' Good Job '''message on the screen. | + | ||It will take a few seconds to connect the '''arduino board ''' to the system. |
| − | || It will take a few seconds to connect the '''arduino board '''to the system. | + | |
| Line 641: | Line 647: | ||
| + | |- | ||
| + | ||Add the entire Output video.mp4 in the main video at the 13:54 timestamp. | ||
| + | ||Notice that the '''LED'''s are turning''' ON''' and turning''' OFF.''' | ||
| − | |- | + | |- |
| − | || | + | ||'''Slide 7''' |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | '''Summary''' | |
| − | + | ||
| − | + | ||
| − | + | In this tutorial, we learnt how to | |
| − | + | ||
# Build a set of '''blocks''' to Create a '''Traffic light project''' | # Build a set of '''blocks''' to Create a '''Traffic light project''' | ||
# Check the output of the experiment using the '''simulator''' | # Check the output of the experiment using the '''simulator''' | ||
| Line 662: | Line 665: | ||
| − | |- | + | ||This brings us to the end of this tutorial. |
| − | || '''Slide 8''' | + | |
| + | |||
| + | Let us summarise. | ||
| + | |||
| + | |- | ||
| + | ||'''Slide 8''' | ||
'''Assignment''' | '''Assignment''' | ||
| − | |||
| − | |||
| − | |||
| + | As an '''assignment''', please do the following,Connect | ||
| + | * A green '''LED''' to pin 3, | ||
| + | * An orange '''LED''' to pin 5, and | ||
| + | * A red '''LED''' to pin 6 on the '''Arduino board'''. | ||
| + | Adjust the delay times as follows: | ||
| − | + | # Set the '''delay''' for the green '''LED''' to 6 seconds. | |
# Set the '''delay''' for the orange '''LED''' to 2 seconds. | # Set the '''delay''' for the orange '''LED''' to 2 seconds. | ||
# Set the '''delay''' for the red '''LED''' to 3 seconds. | # Set the '''delay''' for the red '''LED''' to 3 seconds. | ||
| − | + | ||As an '''assignment''', please do the following, Connect | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | || ''' | + | |
| + | * A green '''LED''' to pin 3, | ||
| + | * An orange '''LED''' to pin 5, and | ||
| + | * A red '''LED''' to pin 6 on the '''Arduino board'''. | ||
| − | + | Adjust the delay times as follows: | |
| − | + | ||
| − | |||
| − | |||
| − | |||
| + | |- | ||
| + | ||Add the entire assignment video.mp4 in the main video at the 14:46 timestamp. | ||
| + | ||Notice the output of the assignment as shown in the video. | ||
| − | + | |- | |
| − | + | || '''Slide 9''' | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | |- | + | |
| − | || '''Slide | + | |
| Line 720: | Line 712: | ||
Thank you for watching. | Thank you for watching. | ||
| − | + | ||
|} | |} | ||
Latest revision as of 12:37, 3 September 2025
Title of the Script: Traffic Lights
Author: Pratik Nemane
Keywords: Electroblocks, arduino board, 220 ohm resistor, LEDs, breadboard, spoken tutorial, video tutorial.
| Visual Cue | Narration |
| Slide 1
Title slide |
Welcome to the Spoken Tutorial on Traffic Lights using Electroblocks. |
| Slide 2
Learning Objectives |
In this tutorial, we will learn how to,
|
| Slide 3
System Requirements |
To record this tutorial, I am using:
A working internet connection to use Electroblocks. |
| Slide 4
Prerequisite |
To follow this tutorial,
|
| Type https://electroblocks.org/
Highlight the link in the search tab |
Let us open the Electroblocks platform using Google Chrome browser.
|
| Click on the New File icon.
|
Click on the New File/Blank file option available on the toolbar.
Click the OK button to start a new project. |
| Point to the number 3 in the loop block. | Observe the loop block in the working area.
It indicates that the simulation will run for 3 times. |
| Point to 3.
|
Let us change the number to 2.
|
| Add the entire Output video.mp4 in the main video at the 1:32 timestamp. | We will create this traffic light output.
|
| Main Video.mp4
|
We need three LED blocks with different colours, namely, red, orange and green.
|
| Click on the Turn LED block and drag it in the working area.
|
Click and place the Turn LED block inside the loop block.
|
| Zoom in to show the resistor
|
Let us Zoom in to see the circuit connection clearly.
|
| Change the LED pin and LED colour | Change the pin number to pin 12.
|
| Only narration
|
Let’s make sure that the LED remains turned ON for a specific amount of time.
|
| Only narration
|
Let’s turn OFF the green LED.
|
| Point to Duplicate block
|
Drag and place this block below the Wait for 4 seconds block.
|
| Duplicate the LED block
|
Now, let's add a second LED block to represent the orange colour.
|
| click on the dropdown arrow and select On.
|
To change the state of the LED, click on drop down arrow and select ON.
|
| Duplicate the wait for 4 seconds block
|
Let us keep the orange LED turned ON for 1 second.
|
| Duplicate the LED block
|
We will now turn OFF the orange LED.
|
| Highlight the red LED block setup between the 5:45 to 6:06 timestamp. | Duplicate the previous LED block and place it below the orange LED block.
|
| Only narration
|
Let us switch to the arduino code section.
|
| Point the cursor to arduino code | The LED pin connections are defined in the void setup function. |
| Point the cursor to arduino code
|
The working of these 3 LEDs is explained in the void loop function.
|
| Highlight the delay(4000) | The delay(4000) line of code makes sure that the green LED is ON for 4 seconds.
In the arduino syntax, 4000 milliseconds represent 4 seconds. |
| Highlight digitalWrite(12, LOW)
|
The digitalWrite(12, LOW) command says that the green LED has to be turned off.
|
| Point to the simulator. | Let’s check the desired results using the simulator. |
| Click on Home page
|
Click on the Home page option from the toolbar.
|
| Point towards the simulation window. | The visual representation of the simulation shows that:
|
| One by one step
|
To see the simulation in the step by step manner,
|
| Only narration
Click on the Download icon
|
Let us now download the project in our system.
|
| Select the directory
|
Select a directory and save the project with the filename Traffic Light.
Click on the Home icon.
|
| Slide 5
|
To perform this experiment, we require
|
| Slide 6
|
Please refer to this circuit diagram to make the circuit connections. |
| Add image
|
Connect the arduino to your system with an arduino cable.
|
| Setup for Ubuntu users only.
|
For Ubuntu users, please follow the steps mentioned below.
|
| Type sudo chmod -R 775 /dev/ttyACM0
|
Then type,
|
| Click on the upload code button and check the arduino USB port name. | Click on the upload code button and check the arduino USB port name.
|
| Restart the system | We have to restart the system to save these changes. |
| Open the electroblocks website.
|
Open the electroblocks website again.
|
| Only narration | Let’s upload this code on the arduino uno to perform the same experiment with hardware. |
| Click on the Upload code option on the right hand side of your screen.
|
Click on the Upload button on the toolbar.
|
| Point to Good Job message on the screen. | It will take a few seconds to connect the arduino board to the system.
|
| Add the entire Output video.mp4 in the main video at the 13:54 timestamp. | Notice that the LEDs are turning ON and turning OFF. |
| Slide 7
|
This brings us to the end of this tutorial.
|
| Slide 8
Adjust the delay times as follows:
|
As an assignment, please do the following, Connect
Adjust the delay times as follows:
|
| Add the entire assignment video.mp4 in the main video at the 14:46 timestamp. | Notice the output of the assignment as shown in the video. |
| Slide 9
|
This tutorial has been contributed by FOSSEE and Spoken Tutorial Project, IIT Bombay.
|