Python Tutorials – பாடம் 7 – LDR Sensor on Raspberry Pi Pico

Raspberry Pi Pico வை பயன்படுத்தி LDR ஐ கட்டுப்படுத்துவது

Required Components

  1. LDR Sensor-1 no
  2. Raspberry Pi Pico board-1 no
  3. Connecting wires-1 set

Circuit

Steps

  1. நாம் பயன்படுத்தும் உபகரணங்கள் சரியாக வேலை செய்கிறதா என்பதை உறுதி செய்து கொள்ளவும்.
  2. Raspberry Pi Pico பின்னான GP27 ஐ LDR பின்னான D0 உடன் இணைக்க வேண்டும்.
  3. Raspberry Pi Pico பின்னான 3V3 (OUT) ஐ LDR பின்னான +5V உடன் இணைக்க வேண்டும்.
  4. Raspberry Pi Pico GND உடன் LDR GND ஐ இணைக்க வேண்டும்.
  5. Python program ஐ சரி பார்க்க வேண்டும்.
  6. மின்சுற்றை சரி பார்க்க வேண்டும்.
  7. Python program ஐ ரன் செய்ய வேண்டும்.

Python Program

from machine import Pin
import time
 
ldr = machine.ADC(27)
 
while True:
     print(ldr.read_u16())
     time.sleep(2)

Leave a Reply

Your email address will not be published. Required fields are marked *