© 2026 schoolict.net (Ruwan Mangala Suraweera)
11.1 Microprocessor Development Systemsක්රමලේඛක සංවර්ධන පද්ධති
Grade 13 A/L ICT · Lesson 1113 ශ්රේණිය A/L ICT · පාඩම 11
In this videoමේ වීඩියෝවේ
- An MDS is a programmable board for sensing and control.MDS සංවේදනය සහ පාලනය සඳහාය.
- Features: analog/digital I/O, USB, RX/TX, power, reset.ලක්ෂණ: I/O, USB, RX/TX, බලය, reset.
- The IDE edits, compiles and uploads over USB.IDE සංස්කරණය, සම්පාදනය, upload.
- ADC: + = raw × 5 / 1024.ADC: + = raw × 5 / 1024.
- Apps: LED, LDR, temperature fan, magnetic door.යෙදුම්: LED, LDR, fan, දොර.
Notesසටහන්
Syllabus 11.1. A Microprocessor Development System (MDS) is a single board (Arduino, Raspberry Pi and similar boards) with a microcontroller, I/O pins and ports you can program. Unlike a traditional PC, an MDS is cheap, talks directly to sensors and actuators, and runs one control program in real time. You write a sketch in an IDE (editor, compiler, programmer), upload it over USB, and build simple applications: LEDs, LDR lighting, temperature fans and magnetic door switches.විෂය නිර්දේශය 11.1. ක්රමලේඛක සංවර්ධන පද්ධතියක් (MDS) යනු ක්රමලේඛකයක්, I/O පින් සහ ports සහිත තනි පුවරුවකි (Arduino, Raspberry Pi සහ සමාන පුවරු). සාම්ප්රදායික පරිගණකයකට වඩා MDS ලාභදායී වන අතර සංවේදක සහ ක්රියාකාරක සමඟ සෘජුව කතා කර තත්ය කාලීනව එක් පාලන වැඩසටහනක් ධාවනය කරයි. IDE එකක (සංස්කාරක, සම්පාදක, ක්රමලේඛක) sketch එකක් ලියා USB මගින් upload කර LED, LDR ආලෝකය, උෂ්ණත්ව fan සහ චුම්බක දොර ස්විච යෙදුම් සාදයි.
1. What is an MDS?1. MDS යනු කුමක්ද?
- Microcontroller – the “brain” that runs your program.ක්රමලේඛකය – ඔබේ වැඩසටහන ධාවනය කරන “මොළය”.
- Analog input (A0–A5) – reads voltages from sensors (0–5 + → 0–1023).ඇනලොග් ආදානය (A0–A5) – සංවේදකවලින් වෝල්ටීයතා කියවයි.
- Digital input / output (D2–D13) – HIGH or LOW for buttons, LEDs, relays.ඩිජිටල් ආදාන / ප්රතිදාන – බොත්තම්, LED, relays සඳහා HIGH හෝ LOW.
- RX / TX – serial communication; USB – power and programming; Reset – restart; Power – 5 + / 3.3 + / GND.RX / TX; USB; Reset; Power.
2. Connecting and the IDE2. සම්බන්ධ කිරීම සහ IDE
- Download the free Arduino IDE (or similar) from the Internet.අන්තර්ජාලයෙන් නොමිලේ Arduino IDE බාගත කරන්න.
- Connect the board to the PC with a USB cable; select the board and the COM/serial port.USB කේබලයෙන් සම්බන්ධ කර board සහ COM port තෝරන්න.
- Write the sketch → Verify/Compile → Upload. setup() runs once; loop() runs forever.sketch → Compile → Upload. setup() එක් වරක්; loop() නිරන්තරයෙන්.
3. Sensors, actuators and numbers3. සංවේදක, ක්රියාකාරක සහ අංක
| Quantityප්රමාණය | Valueඅගය |
|---|---|
| ADC levels (10-bit)ADC මට්ටම් | 10241024 |
| Voltage step (5 + / 1024)වෝල්ටීයතා පියවර | ≈ 0.005 V≈ 0.005 V |
| raw 820 → voltageraw 820 → වෝල්ටීයතාව | 4.004 V4.004 V |
| LDR divider in light (2 kΩ + 10 kΩ)ආලෝකයේදී LDR බෙදුම | 4.167 V4.167 V |
| LDR divider in dark (50 kΩ + 10 kΩ)අඳුරේදී LDR බෙදුම | 0.833 V0.833 V |
| LED series resistor (5 V, Vf 2 V, 20 mA)LED ශ්රේණි ප්රතිරෝධකය | 150 Ω150 Ω |
| PWM duty 64/255PWM රාජකාරි | 25.1% → 1.25 + avg25.1% → 1.25 + avg |
V = raw × Vref / 1024 = 820 × 5 / 1024 ≈ 4.004 V. For a red LED, R = (Vcc − Vf) / I = (5 − 2) / 0.02 = 150 Ω.V = raw × 5 / 1024 ≈ 4.004 V. R = (5 − 2) / 0.02 = 150 Ω.
4. Application 1 – Blink an LED4. යෙදුම 1 – LED blink
🔌 Blink an LED on pin 13පින් 13 හි LED එකක් blink කිරීම
// Blink LED on pin 13 (built-in LED on many Arduino boards) const int LED = 13; void setup() { pinMode(LED, OUTPUT); // digital output } void loop() { digitalWrite(LED, HIGH); // LED on delay(1000); // wait 1 second digitalWrite(LED, LOW); // LED off delay(1000); }
▶ Simulated runඅනුකරණ ධාවනය
LED 13 = HIGH delay 1000 ms LED 13 = LOW delay 1000 ms (loop repeats)
5. Application 2 – Ambient light (LDR) controls an LED5. යෙදුම 2 – LDR මගින් LED
🔌 Switch LED on when it is dark (LDR)අඳුරු වූ විට LED දැල්වීම (LDR)
// LDR on A0 (voltage divider with 10 kΩ); LED on pin 8 const int LDR = A0; const int LED = 8; const int THRESHOLD = 400; // below this = dark void setup() { pinMode(LED, OUTPUT); Serial.begin(9600); } void loop() { int light = analogRead(LDR); // 0–1023 Serial.print("Light: "); Serial.println(light); if (light < THRESHOLD) { digitalWrite(LED, HIGH); // dark → LED on } else { digitalWrite(LED, LOW); // bright → LED off } delay(500); }
▶ Simulated runඅනුකරණ ධාවනය
Light: 820 LED 8 = LOW delay 500 ms Light: 180 LED 8 = HIGH delay 500 ms
820 is above the threshold 400 (bright → LED LOW). 180 is below 400 (dark → LED HIGH).820 > 400 (ආලෝකවත් → LOW). 180 < 400 (අඳුරු → HIGH).
6. Application 3 – Temperature sensor runs a fan6. යෙදුම 3 – උෂ්ණත්ව සංවේදකයෙන් fan
🔌 Run a fan when temperature is highඋෂ්ණත්වය ඉහළ වූ විට fan ධාවනය
// LM35 on A1 (10 mV/°C); fan relay on pin 7 const int TEMP = A1; const int FAN = 7; const float ON_C = 28.0; const float OFF_C = 26.0; int fanOn = 0; void setup() { pinMode(FAN, OUTPUT); Serial.begin(9600); } void loop() { int raw = analogRead(TEMP); float volts = raw * (5.0 / 1024.0); float celsius = volts * 100.0; // LM35: 10 mV per °C Serial.print("Temp: "); Serial.print(celsius); Serial.println(" C"); if (celsius >= ON_C) { digitalWrite(FAN, HIGH); fanOn = 1; } else if (celsius <= OFF_C) { digitalWrite(FAN, LOW); fanOn = 0; } // between OFF_C and ON_C keep previous state (hysteresis) delay(1000); }
▶ Simulated runඅනුකරණ ධාවනය
Temp: 24.9 C FAN 7 = LOW delay 1000 ms Temp: 29.8 C FAN 7 = HIGH delay 1000 ms Temp: 26.9 C FAN 7 stays HIGH (hysteresis) delay 1000 ms Temp: 25.4 C FAN 7 = LOW delay 1000 ms
24.9 ≤ 26 → fan LOW. 29.8 ≥ 28 → fan HIGH. 26.9 is between 26 and 28 so hysteresis keeps it HIGH. 25.4 ≤ 26 → fan LOW again. LM35: T = + × 100 with + = raw × 5 / 1024.24.9 → LOW; 29.8 → HIGH; 26.9 → HIGH රැඳේ; 25.4 → LOW. LM35: T = + × 100.
7. Application 4 – Magnetic door switch7. යෙදුම 4 – චුම්බක දොර ස්විචය
🔌 Door open/close with a magnetic switchචුම්බක ස්විචයකින් දොර විවෘත/වැසීම
// Reed (magnetic) switch on pin 2 with INPUT_PULLUP; alarm LED on pin 9 // Magnet near switch → pin reads HIGH (closed); magnet away → LOW (open) const int DOOR = 2; const int ALARM = 9; void setup() { pinMode(DOOR, INPUT_PULLUP); pinMode(ALARM, OUTPUT); Serial.begin(9600); } void loop() { int state = digitalRead(DOOR); if (state == LOW) { Serial.println("Door OPEN"); digitalWrite(ALARM, HIGH); } else { Serial.println("Door CLOSED"); digitalWrite(ALARM, LOW); } delay(200); }
▶ Simulated runඅනුකරණ ධාවනය
Door CLOSED ALARM 9 = LOW delay 200 ms Door OPEN ALARM 9 = HIGH delay 200 ms
Key Wordsප්රධාන පද
Sample Q&Aආදර්ශ ප්රශ්න සහ පිළිතුරු
1MDS vs traditional PC – one difference?MDS සහ PC වෙනසක්?
2What does the 10-bit ADC return for 5 V?5 + සඳහා ADC?
3Voltage for raw 820?raw 820 වෝල්ටීයතාව?
4LED resistor for 5 V, Vf 2 V, 20 mA?LED ප්රතිරෝධකය?
5When does the LDR sketch turn the LED on?LDR LED දල්වන්නේ?
6Why use hysteresis on the fan?fan hysteresis ඇයි?
MCQබහුවරණ ප්රශ්න
Choose the correct answer for each question.සෑම ප්රශ්නයකටම නිවැරදි පිළිතුර තෝරන්න.
1An Arduino board is an example of aArduino
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
MDS.MDS.
2Pins A0–A5 are mainly used forA0
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Analog.ඇනලොග්.
3A 10-bit ADC maps 0–5 + toADC
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
2·10 − 1.2·10.
4raw 820 equals aboutraw
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
820×5/1024.×5/1024.
5LED series resistor (5 V, Vf 2 V, 20 mA) isR
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
(5−2)/0.02.150.
6In the LDR sketch, raw 180 makes the LED180
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Below 400.400 ට අඩු.
7LM35: 10 mV/°C. Near 29.8 °C the fan turnsLM35
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
≥ 28 °C.≥ 28.
8A magnetic reed switch on a door is areed
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
Senses open/close.සංවේදකය.
9Which term means: “Microprocessor Development System – a programmable single board”?“ක්රමලේඛනය කළ හැකි තනි පුවරු සංවර්ධන පද්ධතිය” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
MDS – Microprocessor Development System – a programmable single board.MDS – ක්රමලේඛනය කළ හැකි තනි පුවරු සංවර්ධන පද්ධතිය.
10Which term means: “Chip that runs the control program on the board”?“පුවරුවේ පාලන වැඩසටහන ධාවනය කරන චිපය” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Microcontroller – Chip that runs the control program on the board.ක්රමලේඛකය – පුවරුවේ පාලන වැඩසටහන ධාවනය කරන චිපය.
11Which term means: “Pin that measures a voltage as a number”?“වෝල්ටීයතාව අංකයක් ලෙස මනින පින්” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Analog input – Pin that measures a voltage as a number.ඇනලොග් ආදානය – වෝල්ටීයතාව අංකයක් ලෙස මනින පින්.
12Which term means: “Pin that is either HIGH or LOW”?“HIGH හෝ LOW වන පින්” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Digital I/O – Pin that is either HIGH or LOW.ඩිජිටල් I/O – HIGH හෝ LOW වන පින්.
13Which term means: “Analog-to-digital converter (e.g. 10-bit, 0–1023)”?“ඇනලොග්-ඩිජිටල් පරිවර්තකය” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
ADC – Analog-to-digital converter (e.g. 10-bit, 0–1023).ADC – ඇනලොග්-ඩිජිටල් පරිවර්තකය.
14Which term means: “Device that measures a physical quantity”?“භෞතික ප්රමාණයක් මනින උපාංගය” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
Sensor – Device that measures a physical quantity.සංවේදකය – භෞතික ප්රමාණයක් මනින උපාංගය.
15Which term means: “Device the MDS drives – LED, motor, relay, buzzer”?“MDS මගින් පාලනය කරන උපාංගය” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
Actuator – Device the MDS drives – LED, motor, relay, buzzer.ක්රියාකාරකය – MDS මගින් පාලනය කරන උපාංගය.
16Which term means: “Light-dependent resistor used to sense light”?“ආලෝකය සංවේදනයට භාවිත ආලෝක ප්රතිරෝධකය” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
LDR – Light-dependent resistor used to sense light.LDR – ආලෝකය සංවේදනයට භාවිත ආලෝක ප්රතිරෝධකය.
17Which term means: “Temperature sensor that outputs 10 mV per °C”?“°C එකකට 10 mV දෙන උෂ්ණත්ව සංවේදකය” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
LM35 – Temperature sensor that outputs 10 mV per °C.LM35 – °C එකකට 10 mV දෙන උෂ්ණත්ව සංවේදකය.
18Which term means: “Magnetic switch used to detect a door open/close”?“දොර විවෘත/වැසීම හඳුනන චුම්බක ස්විචය” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
Reed switch – Magnetic switch used to detect a door open/close.Reed ස්විචය – දොර විවෘත/වැසීම හඳුනන චුම්බක ස්විචය.
19Which term means: “Software with editor, compiler and programmer”?“සංස්කාරක, සම්පාදක සහ ක්රමලේඛක සහිත මෘදුකාංගය” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
IDE – Software with editor, compiler and programmer.IDE – සංස්කාරක, සම්පාදක සහ ක්රමලේඛක සහිත මෘදුකාංගය.
20Which term means: “Cable/port used to power and program the board”?“පුවරුවට බලය සහ ක්රමලේඛනය දෙන කේබලය/පෝට්” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
USB – Cable/port used to power and program the board.USB – පුවරුවට බලය සහ ක්රමලේඛනය දෙන කේබලය/පෝට්.
MCQ answer keyMCQ පිළිතුරු
- C – MDS.MDS.
- E – Analog.ඇනලොග්.
- A – 2·10 − 1.2·10.
- D – 820×5/1024.×5/1024.
- C – (5−2)/0.02.150.
- B – Below 400.400 ට අඩු.
- A – ≥ 28 °C.≥ 28.
- C – Senses open/close.සංවේදකය.
- E – MDS – Microprocessor Development System – a programmable single board.MDS – ක්රමලේඛනය කළ හැකි තනි පුවරු සංවර්ධන පද්ධතිය.
- B – Microcontroller – Chip that runs the control program on the board.ක්රමලේඛකය – පුවරුවේ පාලන වැඩසටහන ධාවනය කරන චිපය.
- E – Analog input – Pin that measures a voltage as a number.ඇනලොග් ආදානය – වෝල්ටීයතාව අංකයක් ලෙස මනින පින්.
- D – Digital I/O – Pin that is either HIGH or LOW.ඩිජිටල් I/O – HIGH හෝ LOW වන පින්.
- D – ADC – Analog-to-digital converter (e.g. 10-bit, 0–1023).ADC – ඇනලොග්-ඩිජිටල් පරිවර්තකය.
- A – Sensor – Device that measures a physical quantity.සංවේදකය – භෞතික ප්රමාණයක් මනින උපාංගය.
- A – Actuator – Device the MDS drives – LED, motor, relay, buzzer.ක්රියාකාරකය – MDS මගින් පාලනය කරන උපාංගය.
- E – LDR – Light-dependent resistor used to sense light.LDR – ආලෝකය සංවේදනයට භාවිත ආලෝක ප්රතිරෝධකය.
- B – LM35 – Temperature sensor that outputs 10 mV per °C.LM35 – °C එකකට 10 mV දෙන උෂ්ණත්ව සංවේදකය.
- C – Reed switch – Magnetic switch used to detect a door open/close.Reed ස්විචය – දොර විවෘත/වැසීම හඳුනන චුම්බක ස්විචය.
- B – IDE – Software with editor, compiler and programmer.IDE – සංස්කාරක, සම්පාදක සහ ක්රමලේඛක සහිත මෘදුකාංගය.
- D – USB – Cable/port used to power and program the board.USB – පුවරුවට බලය සහ ක්රමලේඛනය දෙන කේබලය/පෝට්.
Structured Questionsව්යුහගත ප්රශ්න
1Compare an MDS with a traditional computer (three points).MDS සහ PC. (4 marksලකුණු 4)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
2List the main features of an Arduino-style board.ලක්ෂණ. (6 marksලකුණු 6)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
3Explain how the IDE gets a sketch onto the board.IDE. (4 marksලකුණු 4)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
4Calculate + for raw 820 and the LED resistor for 20 mA, Vf 2 V.ගණනය. (2 marksලකුණු 2)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
5Describe the LDR, temperature-fan and door-switch applications.යෙදුම් තුන. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
🎮 Game🎮 ක්රීඩා
Summary & Downloadsසාරාංශය සහ බාගත කිරීම්
Key pointsප්රධාන කරුණු
- An MDS is a programmable board for sensing and control.MDS සංවේදනය සහ පාලනය සඳහාය.
- Features: analog/digital I/O, USB, RX/TX, power, reset.ලක්ෂණ: I/O, USB, RX/TX, බලය, reset.
- The IDE edits, compiles and uploads over USB.IDE සංස්කරණය, සම්පාදනය, upload.
- ADC: + = raw × 5 / 1024.ADC: + = raw × 5 / 1024.
- Apps: LED, LDR, temperature fan, magnetic door.යෙදුම්: LED, LDR, fan, දොර.
