Theory
તમારી palm માં સમાઈ જતો આખો computer
SmartHostel ના gate ને heavy કામ કરવું છે: camera માંથી face recognise કરવો અને એને database સામે check કરવો. આ real COMPUTING છે: Arduino-class chip એ કરી શકતી નથી, પરંતુ gate પર laptop મૂકવો absurd છે.
Answer છે Raspberry Pi: credit-card-sized board જે ખરેખર full computer છે. એ operating system ચલાવે છે, real processor અને memory ધરાવે છે, monitor સાથે connect થાય છે અને textbook જેટલી કિંમતમાં આવે છે. આ પાઠ એને મળે છે; next lesson એનું opposite મળે છે.
Theory
Raspberry Pi, ઔપચારિક રીતે
Raspberry Pi એ Raspberry Pi Foundation (UK) દ્વારા બનાવાયેલું low-cost, credit-card-sized single-board computer છે, જેનું મૂળ purpose schools માં computing education promote કરવાનું હતું.
Key word છે computer: bare microcontroller થી વિપરીત Pi full operating system ચલાવે છે (Raspberry Pi OS, Linux distribution), proper ARM CPU પર. એટલે એ multitask કરી શકે છે, Python, servers અને databases ચલાવી શકે છે, internet સાથે connect થઈ શકે છે અને monitor તથા keyboard ચલાવી શકે છે: board માં shrink થયેલું real desktop.
આ power એનો purpose છે: affordable general-purpose computer AND real computation જોઈએ એવા jobs માટે capable IoT/edge brain.
At a glance
Raspberry Pi ના key components
| Component | Purpose |
|---|---|
| SoC (ARM CPU + GPU) | Processor: OS અને બધું computation ચલાવે છે |
| RAM | Running programs માટે working memory |
| microSD card slot | Storage: OS અને files રાખે છે (built-in hard disk નથી) |
| GPIO header (40 pins) | General Purpose Input/Output: sensors અને actuators connect કરો |
| USB ports | Keyboard, mouse, storage, peripherals |
| HDMI + Ethernet/WiFi/Bluetooth | Display output અને network connectivity |
Theory
GPIO: જ્યાં computer world ને મળે છે
Pi ને IoT board બનાવતો component, માત્ર tiny PC નહીં, તે છે GPIO header: 40 General Purpose Input/Output pins ની row.
GPIO દ્વારા Pi sensors વાંચે છે (pin INPUT તરીકે) અને actuators ચલાવે છે (pin OUTPUT તરીકે): building blocks નું sensing અને actuation brain સાથે wired છે. આ pins ને તમે code માં, સામાન્ય રીતે Python થી control કરો છો.
એક full Linux computer જે individual electrical pins ને પણ poke કરી શકે: આ જ એક નાનાં board ને face recognise AND gate open કરવા દે છે.
Practical
Minimal GPIO: sensor pin વાંચો, LED ચલાવો (concept)
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.IN) # pin 17: a motion sensor INPUT
GPIO.setup(27, GPIO.OUT) # pin 27: an LED / relay OUTPUT
if GPIO.input(17): # sensor sees motion?
GPIO.output(27, True) # switch the corridor light on
# The Pi is a full Linux computer that can ALSO poke pins like this.
Quiz
Raspberry Pi ને simple microcontroller board થી સૌથી વધારે શું અલગ પાડે છે?
- Pi કોઈ sensors connect કરી શકતું નથી
- Pi full computer છે જે CPU, RAM અને storage સાથે operating system ચલાવે છે
- Pi પાસે કોઈ processor નથી
- Pi ફક્ત chip માં burn થયેલો એક fixed program ચલાવી શકે છે
Show the answer
Pi full computer છે જે CPU, RAM અને storage સાથે operating system ચલાવે છે
Pi ખરેખર computer છે: OS (Linux), real CPU, RAM અને microSD storage સાથે. એટલે એ multitask કરે છે, Python/servers/databases ચલાવે છે અને image recognition જેવી heavy computation કરે છે. OS-and-CPU nature જ આખું distinction છે. Option A ખોટું છે: GPIO દ્વારા sensors સરળતાથી connect થાય છે. Option C definition ને contradict કરે છે: SoC તેનો processor છે. Option D MICROCONTROLLER ના single-firmware model ને describe કરે છે (આગળના lesson માં Arduino), Pi નું exact opposite, કારણ કે Pi કોઈપણ computer ની જેમ ઘણા programs load અને run કરે છે. Pi = small computer; આ framing મોટા ભાગના Pi questions નો જવાબ આપે છે.
Think first
Gate ના face recognition માટે Pi કેમ?
Gate ને faces recognise કરવા અને local dashboard host કરવો છે. Pi ની 'it is a computer' nature પરથી 3 capabilities ના નામ આપો જે એને યોગ્ય બનાવે છે. પછી tap કરો.
Show the answer
(1) Compute power: Real ARM CPU અને GPU image-processing / face-recognition libraries ચલાવી શકે છે: એવી heavy math જેને tiny microcontroller touch પણ ન કરી શકે. (2) Operating system + storage: Linux અને microSD એ faces નો database તથા web dashboard server locally ચલાવવા દે છે: એ full computer છે. (3) Rich connectivity + GPIO: Cloud સુધી પહોંચવા onboard WiFi/Ethernet અને gate motor ચલાવવા GPIO pins. ટૂંકમાં: job ને COMPUTING જોઈએ અને Pi computer છે. કોઈ task ને OS, files, networking અને real processing જોઈએ ત્યારે Pi એ બધું આપતો block છે.
Watch out
Raspberry Pi slips
"Pi microcontroller છે": ના, આ OS ધરાવતું single-board COMPUTER છે. આ જ distinction unit test કરે છે.
Hard disk expect કરવી: Pi microSD card પરથી boot કરે છે અને એમાં જ storage રાખે છે; built-in disk નથી.
Simple jobs માટે overkill: એક LED blink કરવા Pi વાપરો તો power અને battery waste થાય છે. Simple, real-time, ultra-low-power jobs માટે Arduino યોગ્ય છે.
GPIO ભૂલી જવું: GPIO નું નામ લીધા વગર તમે IoT board નહીં પરંતુ small PC describe કર્યો છે.
Theory
હવે એનું opposite મળો
Pi heavyweight છે: pins touch કરી શકતું computer. Next lesson featherweight ને મળે છે: Arduino. એ computer જ નથી, પરંતુ bare MICROCONTROLLER છે જે almost no power પર one simple, reliable, real-time job કરે છે. Arduino શું NOT છે (OS, multitasking, heavy compute) એ સમજવું Pi સમજવાનો અડધો ભાગ છે. એ પછીનો difference lesson આ contrast ને દરેક IoT project માટે decision માં ફેરવે છે.
Summary
Key takeaways
- Raspberry Pi એ Raspberry Pi Foundation નું low-cost, credit-card-sized single-board COMPUTER છે.
- એ ARM CPU પર full OS (Linux) ચલાવે છે: multitasking, Python, servers, databases અને heavy compute.
- Components: SoC (CPU+GPU), RAM, microSD storage (hard disk નહીં), USB, HDMI, Ethernet/WiFi/Bluetooth અને 40-pin GPIO.
- GPIO pins sensors ને input તરીકે અને actuators ને output તરીકે connect કરે છે: computer અને physical world વચ્ચેનું bridge.
- Application areas: edge computing, IoT gateways, vision projects, home-automation hubs, education અને robotics.
- Job ને real computing, OS, storage અથવા networking જોઈએ ત્યારે Pi વાપરો.
- Memory hook: Pi એ તમારી palm માં whole computer છે જે pins ને પણ poke કરી શકે છે.