TechWire

Tag - Electronic

Why Arduino?

Embedded Systems සමඟ ගනුදෙනුව ආරම්භ කරන බොහෝ දෙනෙක්ට සහ එහි විශේෂඥයන්ට පවා නැතිවම බැරි උපකරණයක් විදිහට Arduino හඳුන්වන්න පුළුවන්.

මේ ලිපියෙන් මම කථා කරන්න බලාපොරොත්තු වෙන්නේ ඇයි අපි Embedded Systems නිපදවීම් කරන අය බහුලව භාවිතා කරන Raspberry Pi වැනි උපකරණයක් භාවිතා නොකර Arduino භාවිතයට යොමු වෙන්නේ කියලා.

එයට ලබා දෙන්න පුළුවන් කෙටිම පිළිතුර, Arduino වල ඇති සරල බව.

Embedded Systems සමඟ ක්‍රියා කරන්න මුල් වරට යොමුවන කෙනෙක්ට සරල, ඉක්මන් ආරම්භයක් ලබා ගන්න පුළුවන් උපකරණ අතර Arduino මුල් තැනක් ගන්නවා. එයට හේතු කිහිපයක් තිබෙනවා,

  • අඩු මිලකට ලබා ගත හැකි වීම
  • ඉගෙනීමට ඇති පහසුව
  • වෙනත් ඉලෙක්ට්‍රොනික උපකරණ හා සම්බන්ධ කිරීමට ඇති පහසුව

දැන් අපි මේ කරුණු පිළිබඳව වෙන වෙනම සලකා බලමු.

අඩු මිලකට ලබා ගත හැකි වීම

වෙලඳපොලේ මේ වන විට Arduino වර්ග කිහිපයක්ම තිබෙනවා. ඔබ Arduino ප්‍රධාන වෙබ් අඩවියේ https://www.arduino.cc/en/Main/Products පිටුවට ගියොත් දැකගන්න පුළුවන් Arduino වර්ග විශාල ප්‍රමාණයක් ඔබට තොරාගත හැකි බව. මේ වර්ග අතරින් බහුලවම භාවිතා වන Arduino Uno උපකරණයක් සමඟ ක්‍රියා කරන ආකාරය මීට පසු ලිපි වලදි සාකච්ඡා කෙරෙන්නේ. (නමුත් එම ලිපි වල එන කරුණු, බොහෝ අවස්ථා වලදී Arduino Nano, Arduino Mini, Arduino Micro, Arduino Mega වැනි උපකරණ වලටත් එලෙසම අදාළයි. )

විවිධ වර්ගයේ Arduino කිහිපයක්

මෙම Arduino Uno උපකරණයක් රු.1000 කටත් වඩා අඩු මුදලකට ඔබට ලබාගත හැකි වීම ඉතා විශේෂයි. මීට අමතර Arduino Mini, Arduino Nano වැනි උපකරණ එයටත් වඩා අඩු මුදලකට ලබා ගත හැකියි.

Arduino Uno

 

ඉගෙනීමට ඇති පහසුව

Arduino වල තිබෙන විශේෂම ලක්ෂණය තමයි ඉගෙනීමට ඇති පහසුව. එයට හේතු වන කරුණු අතර තිබෙන ප්‍රධානම කරුණ තමයි Arduino වලටම විශේෂ වූ ක්‍රමලේඛ භාෂාවක් (Programming Language) තිබීම. එය ඉතාමත් පහසු කිසිදු මූලික දැනුමක් නැති අයෙකුට වුනත් ලෙහෙසියෙන්ම ඉගෙන ගත හැකි ක්‍රමලේඛ භාෂාවක්. ඒ වගේම ඔබට ඉතාමත් සතුටු විය හැකි දෙයක් Arduino වල තිබෙනවා. ඔබ Arduino උපකරණය පරිගණකයට සම්බන්ධ කර මිනිත්තු කිහිපයක් තුලම LED නිමෙන දැල්වෙන රටා මවන්න හැකියාව ලැබෙනවා. එය ආරම්භකයෙකුට ඉදිරි ගමන සඳහා විශාල පෙළඹවීමක් ඇති කරන බව මගේ විශ්වාසයයි. ඔබ භාවිතා කරන්නේ Arduino Uno උපකරණයක් නම් සම්බන්ධ කිරීමට wire පවා නොමැතිව LED බල්බ සමඟ ක්‍රියාත්මක වන ආකාරය පරීක්ෂා කරන්න පුළුවන්.

 

වෙනත් ඉලෙක්ට්‍රෝනික උපකරණ හා සම්බන්ධ කිරීමට ඇති පහසුව

Arduino වලට LED, Motors, නොයෙක් ආකාරයේ සංවේදක උපකරණ (Sensors) හා වෙනත් නොයෙක් උපකරණ කිසිම අපහසුවකින් තොරව සම්බන්ධ කිරීමට හැකියාව ලැබෙනවා. මේ පිළිබඳව ඔබට ඉදිරි ලිපි වලදී බොහෝ කරුණු දැනගන්නට ලැබේවි.

Arduino භාවිතා කර සාදන ලද රෙබෝ යන්ත්‍රයක්

Introduction to Microcontrollers

ඔබගේ නිවසේ මේ වන විට පරිගණක(Computers) කීයක් තියෙනවද? එහෙම නැත්නම්, ඔබ එදිනෙදා ජීවිතයේදී පරිගණක කීයක් භාවිතා කරනවාද? මම මේ ප්‍රශ්නය ඔබෙන් ඇහුවොත් ඔබේ උත්තරය මොකක්ද?

ඔබ ඇතැම් විට පිළිතුරු දෙයි, මම භාවිතා කරන්නේ Laptop එක විතරයි. එහෙම නැත්නම් Laptop එක සහ Desktop Computer එක විතරයි යනුවෙන්. නමුත් මම ඉතාම විශ්වාසයෙන් කියන්නේ, ඔබේ පිළිතුර වැරදියි. ඔබ නොදන්නවා වුනත් ඔබ අතේ බඳින Digital ඔරලෝසුව පරිගණකයක්. ඔබ නොදන්නව වුනත් ඔබේ දුරකථනය, ගණක යන්ත්‍රය(Calculator), නිවසේ ඇති WiFi Router එක ආදී බෙහොමයක් ඉලෙක්ට්‍රොනික උපකරණ, පරිගණක.

ඔබ සාමාන්‍ය ජීවිතයේදී පරිගණක ලෙස හඳුන්වන උපකරණ වන Desktop පරිගණක, Laptop පරිගණක වගේම Notebook, Smart Phone, Tablets වලට කියන්නේ පොදු කාර්‍ය පරිගණක (General Purpose Computers) කියලා. මම මීට පෙර සඳහන් කරපු අනෙක් පරිගණක හඳුන්වන්නේ Embedded Systems(නිහිත පද්ධති) කියලා. පොදු කාර්‍ය පරිගණක සහ Embedded Systems අතර තිබෙන ප්‍රධානම වෙනස ඔබට හිතන්න පුලුවන්ද? ඒ පිළිබඳව සාකච්ඡා කරන්න පෙර Embedded Systems ඔබේ ජීවිතයට කොතරම් සමීපද යන්න පැහැදිලි වෙන්න පහත රූපය ඉදිරිපත් කරන්නම්. මේ රූපයෙන් පෙන්වන්නේ නවීන මෝටර් රථයක Embedded Systems භාවිතා වන කොටස් කිහිපයක්.

නවීන මෝටර් රථයක Embedded Systems භාවිතා වන අවස්ථා.

නවීන මෝටර් රථයක Embedded Systems භාවිතා වන අවස්ථා.

මේ පරිගණක වර්ග දෙක අතර තිබෙන ප්‍රධානම වෙනස තමයි, පොදු කාර්‍ය පරිගණක වලින් පරිශීලකයාට අවශ්‍ය පරිදි අවශ්‍ය කර්‍යය කරගන්න පුලුවන් වීම සහ Embedded Systems යම් නිශ්චිත කාර්‍යයක් සඳහාම නිපදවා තිබීම. අත් ඔරලෝසුවෙන් කරන්නේ වෙලාව පෙන්වන එක විතරයි. ගණක යන්ත්‍රය‍ෙන් කරන්නේ ගණිත කර්ම විතරයි. ඔබට අවශ්‍ය විදිහට ඒවා ක්‍රියාත්මක කරන්න බැහැ. සරලවම කියනවනම් ඔබට කරන්න පුළුවන් එම උපකරණ වලට Input එකක් දීම සහ Output එකක් ගැනීම විතරයි. ඒ අතර සිදුවන ක්‍රියාවලිය ඔබට පාලනය කරන්න බැහැ. එහෙත් General Purpose Computers වල අපට ඒ අතර සිදුවන ක්‍රියාවලිය පාලනය කරන්න හැකියාව තිබෙනවා. ඒ සඳහා තමයි C, Java, C++, C#, Python වගේ Programming Languages(ක්‍රමලේඛ භාෂා) භාවිතා කරන්නේ.

විවිධ Programming Languages වර්ග

විවිධ Programming Languages වර්ග

මේ පරිගණක වර්ග දෙකේ ඉහත සඳහන් කරපු වෙනස්කම ඇතිවෙන්න හේතුවන උපාංග දෙකක් තිබෙනවා. General Purpose Computers වල භාවිතා වන Processor එක සහ Embedded Systems වල භාවිතා වන Microcontroller තමයි ඒ උපාංග දෙක. මේ උපාංග දෙකේ ප්‍රධාන වෙනස්කම් කිහිපයක් පහතින් සඳහන් කරන්නම්.

Processors Microcontrollers
මිල ඉතා අධිකයි. මිල ඉතා අඩුයි.
විදුලි පරිභොජනය අධිකයි. සුළු විදුලි පරිභෝජනයක් ඇත.
RAM, ROM, I/O Ports පිටතින් සම්බන්ද කළ යුතුයි. RAM, ROM, I/O ports වෙනම සම්බන්ද කළ යුතු නැත. අභ්‍යන්තරයේම ඇත.
පරිශීලකයාට අවශ්‍ය කාර්‍යයන් ඉටු කර ගැනීමට සකසා ඇත. එක් නිශ්චිත කාර්‍යයක් පමණක් ඉටු කර ගැනීමට සකසා ඇත.

 

RAM, ROM, I/O Ports පිළිබඳව දැනුමක් ඔබට ඇතැම් විට නැති විය හැකියි. ඉදිරි ලිපි වලදී ඒ පිළිබඳ දැනුම ඔබට ලබා ගත හැකියි. ඉහතින් සඳහන් කරපු මූලික දැනුම ඔබට ඉදිරි ලිපි වලදී මෙන්ම සාමාන්‍ය ජීවිතයේදීත් ඉතා වැදගත් වේවි.

මින් ඉදිරියට ඇති ලිපි වලදී අපි සාකච්ඡා කරන්න බලාපොරොත්තු වන්නේ Microcontrollers පිළිබඳව පමණයි. ආරම්භයක් ලෙස ඔබට වැඩිදුර අධ්‍යනය සඳහා දැනට ලෝකයේ බහුලවම භාවිතා වන Microcontrollers වර්ග දෙක පහතින් දක්වන්නම්.

  • Atmel
  • PIC
Atmel වර්ගයේ මෛක්‍රොෙකොන්ට්‍රෝලයක්.

Atmel වර්ගයේ මෛක්‍රොෙකොන්ට්‍රෝලයක්.

 

Contactless electronic payment cards – are they for us?

Even a casual visitor to Hong Kong will not fail to notice the ubiquitous purple, yellow and green signs marked “Octopus” — displayed on everything from shop counters to vending machines to trains and buses. You will see locals of all ages waving similarly colored cards over readers in almost all cases where you would usually expect them to use coins. “Octopus” is a contactless smartcard — simply waving it over a reader will deduct a specified amount from your personal account, which can be reloaded with money electronically.

The scheme in itself is nothing new or fascinating. What is fascinating is that the system has been in operation since 1997 and 95% of the region’s population use it with ease for a variety of purposes, generating about HK$130 million worth of transactions every day.

It is also fascinating that the system has never been successfully hacked. While many North American and European cities use similar smartcards for their public transport systems, the Octopus card is used almost everywhere. Wherever a credit card reader is present, an Octopus card reader will most likely be present as well. You could even board buses that look as dilapidated as the private buses you get in Colombo, and find a card reader near the door. Hong Kong is a case study in how such a system may be practically implemented.

Colombo is a city that clearly has bigger needs that a contactless payment card, but let us look at the hypothetical pros and cons nonetheless.

Coins have become an expensive problem for the Sri Lankan mint — they have become more expensive to produce than the value they represent. While the government has responded by reducing the mass and composition of the coins, much greater savings can be achieved by switching to a contactless smartcard for making small payments (such as bus fares).

There are significant differences between using a contactless smartcard and a credit card. The smartcard never leaves your hand (you wave it over the reader when the cashier tells you or the machine prompts you) and it cannot be used to perform CNP (“card not present”) transactions by using a number (as in online transactions). The card has to be physically present. Readers usually display your card’s balance immediately after the deduction is made — no monthly bills or interest are involved. However, like credit cards, they can be cancelled if stolen — these cards are not transferable.

Yet another thing to consider is consumers’ tendency to overspend with credit cards — unless an SMS alert system is setup, there is no running balance indication. Since an Octopus-like system displays an immediate balance, consumers may be less likely to overspend. They will definitely not spend beyond their means because the system is based on debit.

In terms of difficulties, the biggest problem would be getting vendors to adopt the system and the initial capital cost of deploying readers at vendor premises.

Bus conductors are unlikely to look at the system kindly, given how it might put them out of a job. Getting the general population — especially in and around Colombo — to adopt the system is less likely to be a problem.