0% found this document useful (0 votes)
13 views9 pages

Annex For Task 3 IoT Device Programming Part 1

This document presents three basic exercises for programming IoT devices using the Tinkercad simulation tool. The first exercise involves turning a LED on and off connected to an Arduino output pin. The second exercise uses a push button to change the blinking period of a LED. The third exercise turns a LED on and off depending on the light detected by a photoresistor. Circuit diagrams and steps to simulate each exercise in Tinkercad are provided.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views9 pages

Annex For Task 3 IoT Device Programming Part 1

This document presents three basic exercises for programming IoT devices using the Tinkercad simulation tool. The first exercise involves turning a LED on and off connected to an Arduino output pin. The second exercise uses a push button to change the blinking period of a LED. The third exercise turns a LED on and off depending on the light detected by a photoresistor. Circuit diagrams and steps to simulate each exercise in Tinkercad are provided.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

ANNEX FOR THE DEVELOPMENT OF TASK 3.

Activity Guide and Evaluation Rubric - Task 3


IoT Device Programming Part 1

BASIC TUTORIAL TINKERCAD


Before creating a real circuit, it is possible to simulate it beforehand with the
in order to ensure that everything works correctly. For this, there are
tools like the one offered by Autodesk and available for
free on the page[Link] is shown
in a few steps how to make a basic circuit with this
tool.

1. After registering and accessing the tool's Dashboard,


select the option "Circuits – Create new Circuit"

A new project will open where you can start to input


components.

1
There are different options within the circuit. Some
of the most important:
To edit the code, the Code option must be selected.
Editor.
To add components from the component library
si se selecciona la opción+Components.
To start the simulation, select the Start option.
Simulation.

4. If the option +Components is selected, in the


the bottom will display a dropdown with the different
available components. The main one is the Arduino board
One inside the Arduino Basic Kit subfolder.

5. To introduce a component into the circuit, it is enough to


click once on it and another on the diagram in the
desired position. To remove it you can click on
the component and press Delete or Backspace. The
components with pins can be interconnected by
cables. For this, you need to click on a pin and then
click on another pin to close the connection. All the
introduced elements are easily editable.

2
Como ejemplo se muestra el siguiente esquema que incluye una placa
Arduino UNO, a LED and a 220 ohm resistor:

6. If you want to modify the code, click on Code Editor,


we deactivate the button Blocky to access the editor, as shown in
continuation (in this example, a code has been introduced that makes
blink the green LED every 1 second.

7. Once the corresponding code is entered, simulation can be performed.


real execution of the circuit by selecting the option Start Simulation and
you will observe how the green LED of the circuit turns off and turns on
desired frequency.

Note: Each simulation you perform must include its name and period.
academic who is enrolled.

3
DEVELOP 3 BASIC EXERCISES IN TINKERCAD

EXERCISE 1

Activate an LED using the Arduino board. The LED, connected to one
from the output pins of the board (pin 13), blinks with a period
determined (200 ms) and it
shows through the SERIAL port when the LED is at LOW or HIGH level.

The assembly scheme is as follows:

4
Keep the following in mind: (Requires doing other simulations)
1. Simulate the proposed scheme with the online tool.
2. Modify the circuit so that the LED lights up when connected to the pin.
12 and change the blinking period from 200ms to 1s.
3. Create a program that executes the sequential lighting of four
LEDs connected to pins 10, 11, 12, and 13 with a period of 500
ms.
4. Create a program that simulates the behavior of a
traffic light. Use three LEDs in red, green, and
orange. The sequence they must follow is the following: Green (8
seconds) - Orange (3 seconds) - Red (10 seconds).

Answer:
When I carry out the respective tests, I will conclude about the exercise, and
how it would be useful in your daily life.

5
EXERCISE 2

Use a push button to vary the operation of a circuit. The


The button is connected to pin 7 (configured as an input pin) and acts
about pin 13 (configured as an output pin) that turns on and off the
LED.

The assembly diagram is as follows:

6
Take the following into account:

1. Simulate the proposed scheme with the online tool.


2. Create a program that makes an LED blink with a period of
500 ms and that when the button is pressed, the blinking period changes to 1
second.
3. Create a program that simulates the operation of a level crossing.
through a red LED and a green LED. The red LED remains lit
until a button is activated, which will turn off the red LED and turn on the
Green LED. When the button is released, the red LED will light up again.
and the green LED will turn off.

Response:

When I carried out the respective tests, I concluded on the exercise, and
how it would be useful in your daily life.

7
EXERCISE 3

A light-dependent resistor (LDR) is a component


an electronic component whose resistance decreases with the increase of intensity
incident light. The following image shows its electrical symbol.

The electrical resistance value of an LDR is low when there is light.


impacting on it (it can go down to 50 ohms) and very high when it is
in the dark (several megaohms).

The following example turns on an LED (pin 13) based on


from the intensity of incident light on a photoresistor. The LED remains
turned on when there is no light and turns off when the intensity exceeds a
determined level. The value of the photoresistor is measured as an input
analog (A0).

8
Take into account:

Simulate the proposed scheme with the online tool.


2. Create a program that makes the LED blink with a period
dependent variable
of the value of the photoresistor.

You might also like