Cov txheej txheem:

LED TESTER: 8 Kauj Ruam
LED TESTER: 8 Kauj Ruam

Video: LED TESTER: 8 Kauj Ruam

Video: LED TESTER: 8 Kauj Ruam
Video: ТЕПЕРЬ НЕ ПРОПАДУ 10-ть самоделок ВЫРУЧАТ ГДЕ УГОДНО! 2024, Hlis ntuj nqeg
Anonim
LED ntsuas
LED ntsuas

Cov cuab yeej no yuav tso cai rau koj:

1. Ntsuas cov hluav taws xob qis LEDs, suav nrog hom saum npoo, 2. Zaub nws 'qhov hluav taws xob poob qis (VLED), 3. Kho nws qhov ci ci los ntawm kev hloov pauv tam sim no los ntawm nws (iLED), 4. Xaiv ib qho hluav taws xob txog 9V uas koj npaj yuav siv LED rau hauv ib qhov haujlwm (Vtarget), thiab

5.

6. Tshawb xyuas cov neeg luv luv thaum kuaj.

7. Tswj qhov sib piv/ci ci ntawm LCD.

Kauj Ruam 1: Muab Credit Qhov Twg

Ua ntej, ua tiav qhov txiaj ntsig rau lub tswv yim no thiab cov khoom siv hluav taws xob txuas mus rau tus sau ntawm chav ua haujlwm chav nyob please (thov saib nws thawj kab lus ntawm https://www.robotroom.com/LED-Tester-Pro-1.html). Kuv yoog nws lub tswv yim rau siv nrog PIC 12F683, siv qhov yooj yim heev (thiab muaj zog) Great Cow Basic rau coding. Txhawm rau kom suav tus lej qis hauv PIC, Kuv siv 2-xaim LCD Circuit los ntawm Myke Predko (saib

Kauj Ruam 2: Cov Ntaub Ntawv Xav Tau thiab Cov Npe

Dav dawb hau rau Schematic & Layout

Great Cow Basic rau coding

Superfine hobby pom

Daim ntawv teev npe:

Tus Nqi

C1 0.1uF CAPACITOR

C2 1uF POLARIZED CAPACITOR

C3 0.1uF CAPACITOR

C4 0.1uF CAPACITOR

C6 0.1uF CAPACITOR

C7 1uF POLARIZED CAPACITOR

C8 0.1uF CAPACITOR

D2 1N914 DIODE

IC1 PIC12F683 PIC12F683P

IC2 74LS174N Hex D hom FLIP FLOP, meej

R1 1K RESISTOR

R2 10K POTENTIOMETER

R3 500 POTENTIOMETER

R4 10K POTENTIOMETER

R5 47 RESISTOR

R6 10K RESISTOR

R7 10K RESISTOR

R8 47 RESISTOR

R9 100 POTENTIOMETER

Poj niam lub taub hau rau LCD, Sab Nraud LEDS

SMDL SPDT Hloov rau ON/OFF

LM317 VOLTAGE REGULATOR

MCP1702-5V VOLTAGE REGULATOR

BACKLIT 8X2 LCD nrog 16 tus PIN MALE HEADER

Kauj ruam 3: Schematic

Schematic
Schematic

Kauj ruam 4: Layout

Txheej txheem
Txheej txheem

Kauj ruam 5: CODE

; LED tester, muab los ntawm Robot Room project; thawj qhov haujlwm los ntawm

; Siv 2 xaim teeb rau LCD

; siv PIC 12F683

; Txij li xav tau 3 cov tswv yim analog, yuav siv An0, AN1, AN2, thiab

; yuav siv GP4 & GP5 rau 2 xaim tso tawm rau LCD.

;-----------------------------------------------------------------------

; Kho vajtse teeb:

; INPUTS - LED siab los ntawm Circuit mus rau AN0 (pin7)

; LED qis los ntawm Circuit mus rau

AN1 (tus pin 6); qhov no yog qhov kev nkag siab tam sim no

; 10K Lub hom phiaj voltage lauj kaub

wiper rau AN2 (tus pin 5), xaus rau +5V & GND

; GP3 (tus pin 4) rau +5V li ntawd

tsis ntab.

; OUTPUTS - GP4 (tus pin 3) rau LCD DAT

; GP5 (tus pin 2) rau LCD

NYEM

;-----------------------------------------------------------------------

; Chip Chaw

#txiv 12F683, 8

#config MCLRE = OFF; tsis muaj

sab nrauv pib dua

2 teeb LCD teeb teeb

#txhais LCD_IO 2

#define LCD_DB GPIO.4; hloov cov ntaub ntawv sau npe rau

GP4, pin 3

#define LCD_CB GPIO.5; hloov teev npe rau

GP 5, pin 2

; Txoj Haujlwm Tseem Ceeb

Dim ledhigh, ledlow, Vtarget ntev li

Dim Vled, Iled, Rled raws li lo lus

tswv yim;

#define siab AN0

ib AN0 in

#define qis AN1

ua AN1 in

#txhais lub hom phiaj AN2

AN2 nyob rau hauv

; Txheeb cais cov cim kev cai ("ma" thiab "ohm")

dim index as byte

; kev cai cim bytes

lcdcmd6 4

; mus rau lub hauv paus chaw nyob ntawm tus ua cim 0 hauv CGRAM,; sau ntawv txuas ntxiv rau

cim tom ntej

Dim AA (8)

AA () = 0x0A, 0x15, 0x11, 0x04, 0x0A, 0x0E, 0x11, 0x00

; "mav"

cim, sau rau hauv CG RAM chaw nyob 64 (= ASCII 0)

gosub sau

AA () = 0x00, 0x00, 0x0E, 0x11, 0x11, 0x0A, 0x1B, 0x00

; "hmo"

cim, sau rau hauv CG RAM chaw nyob 72 (= ASCII 1)

gosub sau

tau txais resume

; Sau txhua tus cim rau hauv CGRAM ntawm LCD Circuitry ----------------------

sau:

Teeb LCD_RS Rau

rau qhov ntsuas = 1 txog 8

LCD2_NIBBLEOUT Swap4 (AA (qhov ntsuas))

LCD2_NIBBLEOUT AA (qhov ntsuas)

tom ntej no

rov qab

rov pib dua:

; Qhov kev pab cuam loj

ua

; ----- teev cov tswv yim

ledhigh = ReadAD10 (siab)

lwd = ledhigh * 5000

ledhigh = ledhigh / 1023

ledlow = ReadAD10 (tsawg)

lwd = ledlow * 5000

ledlow = coj / 1023

Vtarget = ReadAD10 (phiaj)

VTarget = Vtarget * 9000

Cov ntsiab lus = Vtarget / 1023

; ----- xam cov txiaj ntsig:

Vled = (ledhigh - ledlow) * 2

Iled = ledlow/47

lwd = ledlow * 10

ledlow = ledlow/47

Yog (ledlow % 10)> = 5 ces Iled ++

ledlow = coj * 47

ledlow = ledlow / 10

Rled = (Vtarget - Vled) / Iled

; Luam tawm los tso saib:

Yog Vled/1000 = 0 ces

nrhiav 0, 0: luam "SHORTED"

nrhiav 1, 0: luam "CONTACTS"

tau txais resume

Xaus yog

Yog hais tias ledlow <50 ces

nrhiav 0, 0: luam "Kov"

nrhiav 1, 0: luam tawm "LED"

tau txais resume

Xaus yog

Nrhiav 0, 0

Luam Vled/1000: Luam "."

Luam tawm (Vled % 1000)/100: Luam "V"

npe 0, 6

Yog tias Iled <10 ces

nrhiav 0, 4: print "": print

Iled

lwm tus

nrhiav 0, 4: print "": print Iled

Xaus yog

nrhiav 0, 7: LCDWriteChar 0

Nrhiav 1,0

Luam Vtarget/1000: Luam "."

Luam (Vtarget % 1000)/100: Luam ""

Nrhiav 1, 5

Yog tias Rled <100 ces

nrhiav 1, 4: print "": print Rled

lwm tus

nrhiav 1, 4: Luam Rled

Xaus yog

Nrhiav 1, 7: LCDWriteChar 1

voj

Kauj Ruam 6: Screen Shot

Tshuaj ntsuam
Tshuaj ntsuam

Kauj Ruam 7: Cov Ntawv Tsim Kho

Kev tsim kho sau tseg:

Þ Muab cov hlau txuas sib txuas (liab, daj, thiab paj yeeb hauv qhov teeb tsa) ua ntej, tom qab ntawd cov khoom uas yuav npog los ntawm LCD (saib duab).

Þ 2 daim ntawv tooj liab yog ib qho ntawm PCB nrog qhov ua kom zoo tshaj hauv txheej tooj liab kom cais lawv hluav taws xob. Cov ntaub qhwv los ntawm cov xov hlau mus rau hauv qab PCB cov cim. Cov ntaub qhwv kuj tseem siv tshuab txuas nrog lub hauv paus los ntawm 2 tus ntsia hlau; qhov no tso cai rau hloov yog tias cov ntaub qhwv tawm los ntawm kev siv rov ua dua.

Þ Nco ntsoov 16 tus pin poj niam header lees paub LCD nrog presoldered 16 tus pin txiv neej header.

Þ 6 tus pin poj niam lub taub hau nruab nrab ntawm cov ntaub rau ntsuas LEDs ntawm cov xov hlau yog xav tau.

Kauj Ruam 8: Cov Lus Cim Txog Roj Teeb

- Lub roj teeb 9V yuav ua haujlwm rau feem ntau LEDs kom txog thaum nws poob qis dua ~ 6.5V.

- Siv lub roj teeb tshiab rau LED xiav; yuav tsis ua haujlwm yog tias poob qis dua ~ 8.2V.

- Xav tau lub roj teeb tshiab yog tias tsis tuaj yeem nce tam sim no mus rau qib uas xav tau nrog kev hloov pauv ntawm iLED lauj kaub, lossis txo qis tam sim no thaum ntsuas ib qho LED xiav.

Pom zoo: