បៀបធ្វើ POV Display Using LEDs and Arduino
បៀបធ្វើ POV Display Using LEDs and Arduino
១.តើវាដំណើរការយ៉ាងដូចម្តេច?
១.១ តើPOV (Persistence of Vision) ជាអ្វី?
POV
វាអាចត្រូវបានកំណត់នៅក្នុងពាក្យសាមញ្ញ។ នៅពេលដែលមនុស្សម្នាក់មើលឃើញវត្ថុមួយរូបរបស់វានៅតែស្ថិតក្នុងរីទីណានៃភ្នែកសម្រាប់ចន្លោះពេលនៃ
1/16th នៃវិនាទី។
បាតុភូតនេះត្រូវបានគេស្គាល់ថាជា Persistence of Vision បាតុភូតនេះត្រូវបានប្រើនៅក្នុងPOV
displayដើម្បីបង្កើតរូបភាព។ យើងនឹងត្រូវបានគូរអក្សរនៅក្នុងវិមាត្ររបស់
LED ចំនួនពីរដោយប្រើប្រាស់ 8 ជាមួយអ័ក្ស Y យើងបានដឹកនាំនិងជួរដេកត្រូវបានអ័ក្ស X ផ្លាស់ប្តូរដូច្នេះដោយលោតភ្លឹបភ្លេត
LED នេះគឺអក្សរលំនាំមួយជាក់លាក់និងពាក្យនឹងបង្ហាញ។
Formation
of letter “E” with 5 LEDs
1
2 3 <– Time
1
1 1 <– Bulb 1
1
0 0 <– Bulb 2
1
1 1 <– Bulb 3
1
0 0 <– Bulb 4
1
1 1 <– Bulb 5
ជួរដេកនីមួយតំណាងឱ្យអំពូល
LED 5 យើងប្រើដើម្បីធ្វើឱ្យ Arduino POV displayនិងជួរឈរនីមួយៗគឺចន្លោះពេលមួយ។
ធាតុនីមួយនៅក្នុងជួរដេកដែលតំណាងអោយ State LED នៅពេលដែលបានផ្តល់ឱ្យនោះ។
At
t = 1 Bulbs 1,2,3,4,5 are ON
At
t = 2 Bulbs 1,3,5 are ON
វិធីដែលអាចមើលឃើញ letter E បានបង្គើតទ្បើងដោយអំពូលLEDនេះប៉ុន្តែចន្លោះពេលឃើញតូចបំផុតគិតជាមីលីវិនាទី។ដោយសារតែចន្លោះពេលខ្លីនិងសមត្ថភាពរបស់អំពូល
LED ដើម្បីបើកនិងបិទយ៉ាងឆាប់រហ័សយើងអាចមើលឃើញថាletter E ទាំងអស់ 3 រូបភាពរួមបញ្ចូលគ្នា។ Motor វិលនិងឆ្លងកាត់ពេលវេលា LEDនីមួយៗដំណើរការមួយៗជាបន្តបន្ទប់
ដូច្នេះរូបភាពទាំងអស់នេះបញ្ចូលគ្នាជាមួយគ្នា។
២.សម្ភារៈដែលត្រូវការ
២.១-Tools
២.១-សម្ភារៈelectronic
|
||||||||||||
| ||||||||||||
|
||||||||||||
|
||||||||||||
|
||||||||||||
|
||||||||||||
|
|
- Strip board
- Arduino NANO
- LED’s
- 470Ω resistors
- Battery 9V and battery connector
- Some wires
- Adapter 12V
- Boost converter or Regulator(7805)
២.៣-Mechanical Parts
|
||||
|
||||
៣.របៀបដំទ្បើងគ្រឿង
៣.១-ការដំទ្បើងជើងស្នាប់
ការដំទ្បើងេជើងស្នាប់សម្រាប់ដោតជើងរបស់Aduinoដែលជា IC សម្រាប់បញ្ជាលើProject ដែលមានជើងចំនួន៣២
៣.២-ការដំទ្បើងឌីយ៉ូតLED
ឌីយ៉ូតគឺជាអង្គធាតុពាក់កណ្ដាលចម្លង
យើងដាក់LEDប្រាំបីគ្រប់នៅលើBoard តំរៀបជាជួរដោយពាត់ជើងទៅម្ខាងដោយAnode(+)ម្ខាងCathode(-)ម្ខាង។រួចធ្វើការផ្សាជើងLEDភ្ជាប់boardដោយគៀបជើងLEDអោយជាប់ងាយស្រួលក្នុងការផ្សាជើងLED។
៣.៣-ប្លុកដ្យាក្រាមនៃ POV Disply
ប្លុកដ្យាក្រាមគឺជាប្លុកមួយដែលបង្ហាញពីដំណើរការរបស់ឧបករណ៍ធ្វើអោយយើងងាយស្រួលយល់ពីដំណើរការ។នេះគឺជាប្លុកដ្យាក្រាមរបស់POV Display ដែលមានថ្ម 9V ភ្ជាប់ជាមួយ IC Microcontroller បញ្ចូនទៅអោយLEDx8ប្រាំបីគ្រាប់ធ្វើអោយដំណើរការ។
ហើយមានម៉ូទ័រDC12vទ្រូពីក្រោមដើម្បីអោយដំណើរការវិលដែលបានតង់ស្យុងពីAdaptor 12vចូលbossconvertorជាអ្នកមូលដំរូវតង់ស្យុងបញ្ជាល្បឿនម៉ូទ័រ។ដូចរូបខាងក្រោម
៣.៤-ធ្វើការបញ្ចូលកូដ programming
ការបញ្ចូលកូដដោយប្រើប្រាស់កម្មវិធីមួយនៅក្នុងកុំព្យូទ័រហៅថាArduinoគឺជាកម្មវិធីសម្រាប់សរសេរកូដដើម្បីបញ្ចូលកូដទៅក្នុងMCU(Arduino Nano atmega 128)
កូដ
int NUMBER9[]={1,1,1,1,0,0,0,1, 1,0,0,1,0,0,0,1,
1,0,0,1,0,0,0,1, 1,0,0,1,0,0,0,1, 1,1,1,1,1,1,1,1};
int
NUMBER8[]={0,1,1,0,1,1,1,0, 1,0,0,1,0,0,0,1, 1,0,0,1,0,0,0,1, 1,0,0,1,0,0,0,1,
0,1,1,0,1,1,1,0};
int
NUMBER7[]={1,0,0,0,0,0,0,0, 1,0,0,0,1,0,0,0, 1,0,0,0,1,0,0,0, 1,0,0,1,1,1,1,1,
1,1,1,0,1,0,0,0};
int
NUMBER6[]={1,1,1,1,1,1,1,1, 1,0,0,0,1,0,0,1, 1,0,0,0,1,0,0,1, 1,0,0,0,1,0,0,1,
1,0,0,0,1,1,1,1};
int
NUMBER5[]={1,1,1,1,1,0,0,1, 1,0,0,0,1,0,0,1, 1,0,0,0,1,0,0,1, 1,0,0,0,1,0,0,1,
1,0,0,0,1,1,1,1};
int NUMBER2[]=
{1,0,0,0,0,0,1,1, 1,0,0,0,0,1,0,1, 1,0,0,0,1,0,0,1, 1,0,0,1,0,0,0,1,
0,1,1,0,0,0,0,1};
int NUMBER1[]=
{0,0,1,0,0,0,0,0, 0,1,0,0,0,0,0,0, 1,1,1,1,1,1,1,1, 0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0};
int NUMBER0[]=
{1,1,1,1,1,1,1,1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,0,0,0,0,1, 0,0,0,0,0,0,0,1,
1,1,1,1,1,1,1,0};
int V[] =
{1,1,1,1,1,1,0,0, 0,0,0,0,0,0,1,0, 0,0,0,0,0,0,0,1, 0,0,0,0,0,0,1,0,
1,1,1,1,1,1,0,0};
int W[] =
{1,1,1,1,1,1,1,1, 0,0,0,0,0,0,1,0, 0,0,0,0,0,1,0,0, 0,0,0,0,0,0,1,0,
1,1,1,1,1,1,1,1};
int X[] =
{1,1,0,0,0,0,1,1, 0,0,1,0,0,1,0,0, 0,0,0,1,1,0,0,0, 0,0,1,0,0,1,0,0,
1,1,0,0,0,0,1,1};
int Y[] =
{1,1,0,0,0,0,0,0, 0,0,1,0,0,0,0,0, 0,0,0,1,1,1,1,1, 0,0,1,0,0,0,0,0,
1,1,0,0,0,0,0,0};
int Z[] =
{1,0,0,0,0,1,1,1, 1,0,0,0,1,0,0,1, 1,0,0,1,0,0,0,1, 1,0,1,0,0,0,0,1,
1,1,0,0,0,0,0,1};
int* alpha[]=
{A,B,C,D,E,F,G,H,I,J,K,L,M,N};//,T,U,V,W,X,Y,Z};
int letterSpace;
int dotTime;
void setup()
{ Serial.begin(9600);
// setting the ports of the leds to OUTPUT
for( int i = 2;
i<10 ;i++ )
{ pinMode(i, OUTPUT);
}
// defining the space between the letters (ms)
letterSpace = 2;
// defining the time
dots appear (ms)
dotTime =1;
}
void printLetter(int
letter[])
{
int y;
// printing the first y row of the letter
for (y=0; y<8;
y++)
{
digitalWrite(y+2,
letter[y]);
}
delay(dotTime);
// printing the second y row of the letter
for (y=0; y<8;
y++)
{
digitalWrite(y+2,
letter[y+8]);
}
delay(dotTime);
// printing the third y row of the letter
for (y=0; y<8;
y++)
{
digitalWrite(y+2,
letter[y+16]);
}
delay(dotTime);
for(y = 0; y<8;
y++) {
digitalWrite(y+2,
letter[y+24]);
}
delay(dotTime);
for(y = 0; y<8; y++) {
digitalWrite(y+2,
letter[y+32]);
}
delay(dotTime);
// printing the
sspace between the letters
for (y=0; y<8;
y++)
{
digitalWrite(y+2, 0);
}
delay(letterSpace);
}
void loop()//write
here =) enjoy subscribe to my channel if you like the project
{
printLetter (C);
printLetter (A);
printLetter (M);
printLetter (B);
printLetter (O);
printLetter (D);
printLetter (I);
printLetter (A);
printLetter (_);
}
៣.៥តារាងតម្លៃសម្ភារៈ
ឈ្មោះសម្ភារៈ
|
ចំនួន
|
ឯកត្តា
|
តម្លៃមួយឯកតា
|
តម្លៃសរុប
|
Arduino
|
1
|
បន្ទះ
|
60000រ
|
60000រ
|
Female Connector Pin
|
1
|
បន្ទះ
|
2400រ
|
2400រ
|
9v Battery
|
1
|
គ្រាប់
|
1000រ
|
1000រ
|
LED
|
8
|
គ្រាប់
|
200រ
|
1600រ
|
Dotted board
|
1
|
បន្ទះ
|
8000រ
|
8000រ
|
Motor DC 9V
|
1
|
គ្រឿង
|
20000រ
|
20000រ
|
220 ohm resistor
|
8
|
គ្រាប់
|
200រ
|
1600រ
|
Adapter 12V
|
1
|
គ្រឿង
|
24000រ
|
24000រ
|
Battery Connector
|
1
|
បន្ទះ
|
1000រ
|
1000រ
|
Boost Converter
|
1
|
បន្ទះ
|
10000រ
|
10000រ
|
Total
|
129600រ
|
No comments: