You are on page 1of 80

REKA BENTUK ELEKTRONIK

REKA BENTUK DAN TEKNOLOGI


TINGKATAN 2

Bengkel Pengkongsian pdpc PAK21 dan


Pentaksiran untuk Guru –Guru Mata
Pelajaran Reka Bentuk Dan Teknologi (RBT)
KSSM Tingkatan 2 2018
RBT Tingkatan 2 ( DSKP )
MAGNETCODE

MOHD SHUKRI BIN MOHD REJAB. PPN.,PJK.


019 4794262
Download & Install Magnetcode

Install Magnetcode using Search using 'Magnetcode'


Android play store app. keyword and install it.
Register Magnetcode Account

After all
details are
filled
Clik to
(without
start any
mistake)
1st Time Login

Get the
activation
Insert username Open your Email to code from
and password get account your Email
to login activation code
Add Command
Hide / Show All
Commands
Home
Page

Command
Groups
Add Command
Page
Magnetcode Workshop
Module 1: Magnetcode Startup

Webpage:
www.magnetcode.com
Your Smartphone + FREE Magnetcode ==>
Create Apps
Magnetcode
App Projects
Your Smartphone + FREE Magnetcode ==>
Create Apps
Carrot Accessories

+ +
Magnetcode
Automation & Robotics
Projects
Magnetcode Accessories

Buzzer LED Relay DC Motor Servo Motor

Temperature Solar Vibrate Magnet SW Limit SW

Smoke Gas Rain Infrared Obstacle


Pembelajaran Kendiri Yang Mudah
Self Learning Friendly
Easy to understand More than 150 Build in command
each command: examples available: description: No
No technical word Types of coding skills. need pdf file or hard
included. Best project template. copy user manual.
Free Ebooks and Project Videos
Download Magnetcode FREE Ebooks:
www.magnetcode.com

Magnetcode Projects:
www.youtube.com
(search using 'Magnetcode' keyword.)
Magnetcode For Android 4.1 and above
APA ITU SIMULASI ?
Litar Simulasi Magnetcode
Simulation Without Simulation With
Programming Programming

On/Off 1 LED On/Off 2 LEDs Traffic Light Fridge Lamp


Project 2: On off 1 LED

Press 'Simulator' Press '+' Press and hold any


component
Project 2: On off a LED
Mistake? 'Undo' or
'Redo'.

Add these Click LED to 'Rotate' Connect wires from


components or 'Delete'. pin to pin
Project 2: On off a LED

Click 'Text' to edit Set color, size and Done? Press 'Run
it content Simulation'
Project 2: On off 1 LED

Save for future


simulation.

Picture file. For


PC printing.

Click switch to on Tested? Press 'Save Circuit' or


off LED 'Stop Simulation' 'Export JPG'
Project 3: On off 2 LED
Automatic create a
'Connector'

Click '+' to add Connect LED2 'IN' 'Run Simulation'


component to LED1 'IN' 'Save Circuit'
LCD_Show = On
LCD_Show_Text = Mr Hoon

LCD_Update

?
LCD_Text_Size =80
LCD_Align = Middle Menu
Timer = 2 sec
Clear all
LCD_Show_Text = Welcome
LCD_Update
commands in the
Timer = 2 sec 'Home Page'
Goto = 1

Home Page
We will do 3 projects

Project 1. Emergency light

Project 2. LED light flasher

Project 3. LED traffic light


Project 1: Emergency Light

Timer Timer
2 sec 2 sec

Timer 2 sec
Project 1 Output
Press and hold any
command to add it.
You will see
'Command added' tag.

Command added
Return to
'Home'
page.

Continue to press and


hold (e.g. 3 times) to
add more commands.
Delete any
command
Method 1 Method 2
Slide command to the right Select the checkbox behind
and press 'Delete'. each command and press
'Dustbin' icon to delete.
Then
1. Background_Color = White

Change
background
color to red? Red

Click and hold


Click 'Run'
to test
1. Background_Color = Red
1. Background_Color = Red

2. Timer = 1 sec
1. Background_Color = Red

2. Timer = 1 sec

Timer = 2 sec?
2
Press and
hold
How to do this?

Timer Timer
2 sec 2 sec
1. Background_Color = 1. Background_Color = Red
Red
2. Timer = 2 sec 2. Timer = 2 sec

3. Background_Color = Green 3. Background_Color = Green

4. Background_Color = Yellow 4. Timer = 2 sec

4. Timer = 2 sec? 5. Background_Color = Yellow

6. Timer = 2 sec ? 6. Timer = 2 sec

Use these icons to Try out this coding.


move any command
up or down.
Add 2 more colors:
Red -> Green -> Yellow
1. Background_Color = Red

2. Timer = 2 sec

3. Background_Color = Green
Press 'Run' to
4. Timer = 2 sec
test.
5. Background_Color = Yellow But stop at yellow
6. Timer = 2 sec color
background?
No Repeat?
1. Background_Color = Red

2. Timer = 2 sec

3. Background_Color = Green

4. Timer = 2 sec

5. Background_Color = Yellow

6. Timer = 2 sec

7. Goto = 1
Always at
the bottom

Repeat? Use 'Goto = 1'


Jump to line 1
Press 'Run' to
test
1. Background_Color = Red
.
2. Timer = 2 sec

3. Background_Color = Green

4. Timer = 2 sec

5. Background_Color = Yellow

6. Timer = 2 sec

7. Goto = 1

Done? Clear all coding.


Carrot Project Board
Power: Battery 8 AA (1.5V
x8 = 12V), 12V adapter or
12V Lead acid
(Volt: 10VDC - 18VDC)

Switch to On Off power

Brain (Microcontroller):
5VDC, Greenbean, 20MHz

Wireless: Bluetooth, 30 feet


(10 meter), ID: 121600051
Carrot project (for Bluetooth connection)
Carrot Project Board
Input and Output
Digital Output: 6
(DOUT1, DOUT2...)
Digital Input: 4
(DIN1, DIN2, DIN3, DIN4)
Servo Output: 2
(SERVO1, SERVO2)
Pulse Output: 2
(PUSE1, PULSE2)
Analog Input:5
(AIN1, AIN2, AIN3...)
Carrot project
Total: 19
Digital Output Pins (DOUT)
On= Logic 1 = 5V, Off = Logic 0 = 0V
DOUT1
DOUT2

DOUT3

DOUT4

DOUT5

DOUT6
LED
(Light Emitting Diode)
(operating volt: 1.8V to 3.3V)

Red, Orange
(Amber), Green, Blue,
White
Red Black
DOUT1 GND Big LED
DOUT2 GND (5mm Diameter)
DOUT3 GND
DOUT4 GND Small LED
DOUT5 GND (3mm Diameter)
DOUT6 GND
Power up Carrot Project
Board
Power on / off
indicator

Power on / off
switch

Bluetooth connection indicator


(blinking = not connected)
aways off? battery low or damaged
Test LEDs with 5V and GND

Switch on Carrot board. Any LED is off?


Check wiring or LED is damaged.

5V

GND
Project 4: LED Berkelip Tanpa DIN
Red LED On Wait for 2 sec

Wait for 2 sec Red LED off

For Dout or Pulse pin


Off = Logic 0 = 0V
On = Logic 1 = 5V, max 20mA
Project 4: Wiring
We will write a program to
turn on the red LED.

Dout1

GND
Blink red LED at Dout1

1. Dout1 = On

2. Timer = 2 sec

3. Dout1 = Off

4. Timer = 2 sec

5. Goto = 1

Press and hold to


change Dout1 = On
become Dout1 = Off
Project 4: LED Light
Flasher
Turn on Carrot project
board then press 'Run'.
1. Dout1 = On
1. Dout1 = On
2. Timer = 2 sec

3. Dout1 = Off

4. Timer = 2 sec

5. Goto = 1
Connect your program
to the Carrot project
board
Bluetooth pairing PIN: 1234

121600051
Done? Try to save the
project
Where is the file?
Internal Storage -> 'Mydata' folder

Save as text file e.g.


abc.txt
Can use notepad
open or print
Project 5: LED berkelip bersama DIN

Litar Sebenar

Litar Simulasi
Project 5: LED Berkelip
Click
'Run Simulation'

1. Read_Controller
Simulator
2. If C_Din1 = 1
3. Dout1 = On
4. End If

5. If C_Din1 = 0
6. Dout1 = Off
7. End If

8. Goto = 1

Program
Circuit
Project 5: Automatic Light

Real circuit testing


Virtual circuit testing
Project 5: Automatic Light (AIN )
Done? Click
'Run Simulation'

1. Read_Controller
Simulator
2. If C_Ain1 > 200
3. Dout1 = On
4. End If
Set
5. If C_Ain1 < 200 brightness
6. Dout1 = Off
7. End If Controller I/O
Read_Controller
Dout1=On
8. Goto = 1
Decision
Program If C_Ain1 = 0
End If Circuit
Project 6: Traffic Light

Litar sebenar

Litar Simulasi
Project 6: Wiring

DOUT1 DOUT3

DOUT2

GND
Project 6.1: Traffic Light
Done? Click
'Run Simulation'

1. Dout1 = On
2. Dout2 = On Simulator
3. Dout3 = On
4. Timer = 1 sec

5. Dout1 = Off
6. Dout2 = Off
7. Dout3 = Off
8. Timer = 1 sec

9. Goto = 1

Different Program Same Ciruit


Project 6.2: LED Traffic Light

Red LED On

Wait for 2 sec Yellow LED off

Red LED Off Wait for 2 sec

Green LED on Yellow LED on

Wait for 2 sec Green LED Off


Project 6.2 : Traffic Light

Turn on Carrot project


board then press 'Run'.
1. Dout1 = On
2. Timer = 2 sec
3. Dout1 = Off

4. Dout2 = On
5. Timer = 2 sec
6. Dout2 = Off

7. Dout3 = On
8. Timer = 2 sec
9. Dout3 = Off

10.Goto = 1
Project 6.3: Upgrade edit

1. Dout1 = On
2. Background_Color=Red RUN
3.Timer = 2 sec
4.Dout1 = Off
5.Dout2 = On
6. Background_Color=Green
7.Timer = 2 sec
8.Dout2 = Off
9.Dout3 = On
10.Background_Color=Yellow
11.Timer = 2 sec
12.Dout3 = Off
13.Goto = 1
Project 6.4: Upgrade edit

1. Dout1 = On
2. Background_Color=Red RUN
3.Timer = 2 sec
4.Dout1 = Off
5.Dout2 = On
6. Background_Color=Green
7.Timer = 2 sec
8.Dout2 = Off
9.Dout3 = On
10.Background_Color=Yellow
11.Timer = 2 sec
12.Dout3 = Off
13.Text_Speech _Enable =On
14.Text_Speech_Text = Terima Kasih
15.Goto = 1
Projek 7 : LED -> Heavy Duty Load
Relay Module,
Max 250Vac, 10A
-
+
AC / DC Load

8AA / 12V Adapter


8AA / 12V
Adapter
Free Ebook and Project Videos
Download Magnetcode FREE Ebooks:
www.magnetcode.com

Magnetcode Projects: www.youtube.com


(search using 'Magnetcode' keyword.)
BAB 2.3 REKA BENTUK ELEKTRONIK