SKILL MODULE: DIGITAL STEM 50 k. Select Sound in Script Block menu. Click on and drag the block script to scripting area. l. Click on Upload Mode Broadcast in Script Block Menu. Select and drag-drop on scripting area. i) Select Sound blocks. ii) Drag and drop the block. ii) Drag and drop the block. Edit message to “ON”. i) Select Upload Mode Broadcast blocks.
SKILL MODULE: DIGITAL STEM 51 m. Carry out the same scripting process for off-button. Click off-button sprite and prepare the program as follow. n. We can add another animated feature in stage. Click on Panda sprite to start block scripting. Complete the block scripting as follow.
SKILL MODULE: DIGITAL STEM 52 o. Click on Devices and select Arduino UNO. Complete the block scripting as follow and upload it into Arduino UNO. Click on the spite in the stage area.
SKILL MODULE: DIGITAL STEM 53 Activity 8: Integrate push button and buzzer Components: 1 x Arduino UNO 1 x USB Type-B Cable Male-male jumper wires 1 x 4 pins push button 1 x Buzzer 1 x 1k Ohms Resistor 1 x Bread Board Circuit Diagram: mBlock Scripting: Build the block scripting below and upload it into Arduino UNO. Observe the output. 4 8
SKILL MODULE: DIGITAL STEM 54 Exercise 3: Create a program to turn on/off an LED and buzzer using a single push button. Activity 9: Turn on LED with a clap (using microphone). Components: 1 x Arduino UNO 1 x USB Type-B Cable Male-male jumper wires 1 x 220 Ohms Resistor 1 x LED 1 x Bread Board Circuit diagram: mBlock Scripts: Complete the following block scripts and upload it into Arduino UNO. Observe the output. 1. Sprite > Events > When loudness 50 2. Sprite > Upload Mode Boardcast > send upload mode message ON 12
SKILL MODULE: DIGITAL STEM 55 1. Devices > Arduino Uno > Upload Mode Boardcast > when receiving upload mode message ON 2. Devices > Arduino Uno > Pin > set digital pin 12 output as high 3. Devices > Arduino Uno > Control > wait 1 seconds 4. Devices > Arduino Uno > Pin > set digital pin 12 output as low
SKILL MODULE: DIGITAL STEM 56 4.3 INTEGRATE SENSORS AND ACTUATOR Activity 10: Light sensor with LED Components: 1 x Arduino UNO 1 x USB Type-B Cable Male-male jumper wires 1 x 10k Ohms Resistor 1 x 220 Ohms Resistor 1 x LED 1 x Light Dependent Resistor (LDR) 1 x Bread Board Circuit diagram: mBlock Scripting: Complete the following block scripts and upload it into Arduino UNO. Observe the output. 4 A0 GND 5V - +
SKILL MODULE: DIGITAL STEM 57 Expected output:
SKILL MODULE: DIGITAL STEM 58 Activity 11: Control Blinking LED with potentiometer We going to create a display and Arduino to convert analog value from potentiometer to value second. The value second will be used to control duration of blinking LED.
SKILL MODULE: DIGITAL STEM 59 mBlock Scripting: 1. Complete the following block scripts for Arduino UNO under devices. 2. Add block scripts for Panda sprite as follow. 3. Add another sprite Bear3 and build block scripts as follow. Reading on potentiometer is from 0 to 1023. We need to map it for each duration. Exercise 4: Make some adjustment so that potentiometer able to control (ON/OFF) 3 LEDs. Yellow LED ON when Potentiometer at level 1 to 2 Green LED ON when Potentiometer at level 3 Red LED ON when Potentiometer at level 4 to 5.
SKILL MODULE: DIGITAL STEM 60 Activity 12: Auto Awning System (using Light Dependent Resistor (LDR) and Servomotor) Circuit: Build the circuit as in Diagram below. mBlock scripting: 1. Block scripts for sprite. 2. Block scripts for Arduino UNO devices. Note: Use “if-else” to control servo motor with control threshold for LDR is 100. You can adjust this threshold for sensitivity of the system.