Cov txheej txheem:

Ua Nkauj Nrog Arduino Siv ADC rau PWM ntawm Flyback Transformer lossis Hais Lus: 4 Cov Kauj Ruam
Ua Nkauj Nrog Arduino Siv ADC rau PWM ntawm Flyback Transformer lossis Hais Lus: 4 Cov Kauj Ruam

Video: Ua Nkauj Nrog Arduino Siv ADC rau PWM ntawm Flyback Transformer lossis Hais Lus: 4 Cov Kauj Ruam

Video: Ua Nkauj Nrog Arduino Siv ADC rau PWM ntawm Flyback Transformer lossis Hais Lus: 4 Cov Kauj Ruam
Video: Saw Lauj - Hluas Nkauj Tiam Tshiab Tsi Ntshai F. A. Nkauj Hmoob Viet, nkauj tawm tshiab 2020 2024, Kaum ib hlis
Anonim
Ua Nkauj Nrog Arduino Siv ADC rau PWM ntawm Flyback Transformer lossis Hais Lus
Ua Nkauj Nrog Arduino Siv ADC rau PWM ntawm Flyback Transformer lossis Hais Lus
Ua Nkauj Nrog Arduino Siv ADC rau PWM ntawm Flyback Transformer lossis Hais Lus
Ua Nkauj Nrog Arduino Siv ADC rau PWM ntawm Flyback Transformer lossis Hais Lus
Ua Nkauj Nrog Arduino Siv ADC rau PWM ntawm Flyback Transformer lossis Hais Lus
Ua Nkauj Nrog Arduino Siv ADC rau PWM ntawm Flyback Transformer lossis Hais Lus
Ua Nkauj Nrog Arduino Siv ADC rau PWM ntawm Flyback Transformer lossis Hais Lus
Ua Nkauj Nrog Arduino Siv ADC rau PWM ntawm Flyback Transformer lossis Hais Lus

Nyob Zoo Cov Menyuam, Qhov no yog ntu thib ob ntawm kuv lwm qhov kev qhia (uas nyuaj heev), Hauv paus, Hauv Qhov Haujlwm no, Kuv tau siv ADC thiab TIMERS ntawm kuv Arduino los hloov Suab Lub Suab rau hauv PWM Teeb liab.

Qhov no yooj yim dua li kuv tau qhia yav dhau los, Ntawm no yog qhov txuas ntawm kuv thawj Kev Qhia Yog tias koj xav pom. txuas

Txhawm rau nkag siab txoj kev xav ntawm Lub Teeb Suab, Bitrate, Qhov tob me ntsis, Kev ntsuas tus lej, Koj tuaj yeem nyeem txoj kev xav hauv kuv qhov kev qhia zaum kawg ntawm Kev Qhia. Qhov txuas yog saum toj no.

Kauj Ruam 1: Yam Peb Xav Tau rau Txoj Haujlwm no (Yuav Tsum Muaj)

1. Arduino Board (peb tuaj yeem siv ib lub Rooj Tswjhwm Saib (328, 2560) piv txwv li Mega, Uno, Mini, thiab lwm yam tab sis muaj cov pins sib txawv tshwj xeeb)

2. PC nrog Arduino Studio.

3. Breadboard lossis Perfboard

4. Txuas Cov Xov Tooj

5. TC4420 (Mosfet tsav tsheb lossis lwm yam)

6. Lub Hwj Chim Mosfet (N lossis P channel, thov xaim xov tooj kom haum) (Kuv tau siv N-channel)

7. Hais lus lossis Flyback Transformer (Yog koj nyeem nws raug !!)

8. Cov Khoom Siv Hluav Taws Xob Tsim Nyog (0-12V) (Kuv tau siv kuv tus kheej ATX Fais Fab Khoom)

9. Kub Kub (Kuv tau khaws los ntawm kuv lub PC qub).

10. Ib qho Amplifier (Music Amplifier) lossis Amplifier Circuit.

Kauj Ruam 2: Kev xav ntawm ADC rau PWM

Theory of ADC to PWM
Theory of ADC to PWM
Theory of ADC to PWM
Theory of ADC to PWM

Yog li hauv Txoj Haujlwm no, Kuv tau siv los tsim ADC ntawm Arduino los ua cov ntaub ntawv piv txwv ntawm Lub Teeb Suab.

ADC (Analog-To-Digital Converter) raws li lub npe txhais, ADC hloov pauv Analog teeb liab mus rau Digital kuaj. Thiab rau Arduino nrog qhov siab tshaj ntawm 10-ntsis qhov tob. Tab sis rau Txoj Haujlwm no, peb yuav siv 8-ntsis Sampling.

Thaum siv ADC ntawm Arduino, peb yuav tsum nco ntsoov ADC_reference Voltage.

Arduino Uno muab 1.1V, 5V (Kev siv sab hauv, uas tuaj yeem tsim teeb tsa hauv cov cai) lossis kev siv sab nraud (uas peb yuav tsum tau thov sab nrauv rau tus pin AREF).

Raws li kuv qhov kev paub, yam tsawg kawg ntawm 2.0V yuav tsum tau siv ua qhov ntsuas hluav taws xob kom tau txais txiaj ntsig zoo los ntawm ADC. Raws li 1.1V tsis mus yam tsawg kawg rau kuv. (Kev Paub Tus Kheej)

*TSEEM CEEB**TSEEM CEEB ** TSEEM CEEB ** TSEEM CEEB ** TSEEM CEEB*TSEEM CEEB*

Peb yuav tsum tau siv lub suab nrov los ntawm Amplifier lossis Amplifier Circuit nrog qhov siab tshaj (Max. Voltage) ntawm 5V

Vim tias kuv tau teeb tsa Sab Hauv Kev Siv Hluav Taws Xob ntawm 5V, rau peb Txoj Haujlwm. Thiab kuv tab tom siv Lub Teeb Pom Kev Zoo siv lub Amplifier (Music Amplifier) ib txwm, uas feem ntau muaj nyob hauv peb tsev neeg lossis koj tuaj yeem tsim ib qho rau koj tus kheej.

Yog li tam sim no qhov tseem ceeb. Tus Nqi Sampling, uas yog qhov piv txwv ntau npaum li cas peb cov ADC siv sijhawm ib pliag, ntau dua yog qhov hloov pauv, zoo dua yuav yog cov txiaj ntsig tshwm sim, zoo sib xws ntau dua yuav tso tawm yoj raws li piv rau cov tswv yim.

Yog li, peb yuav siv tus qauv piv txwv ntawm 33.33Khz hauv Txoj Haujlwm no, los ntawm kev teeb tsa ADC moos ntawm 500Khz. Txhawm rau nkag siab tias nws yog li cas, peb yuav tsum pom ADC Sijhawm Nplooj Ntawv hauv cov ntawv ntawm Atmega (328p) nti.

Peb tuaj yeem pom qhov ntawd, peb xav tau 13.5 ADC moos hloov pauv kom ua tiav ib qho piv txwv nrog kev pib ua piv txwv. Nrog qhov zaus ntawm 500Khz, nws txhais tau tias 1/500Khz = 2uS rau ib qho ADC voj voog, uas txhais tau tias 13.5*2uS = 27uS xav tau kom ua tiav cov qauv thaum pib siv tus qauv. Los ntawm muab 3uS ntau ntxiv rau Microcontroller (rau sab nyab xeeb), Ua kom tag nrho ntawm 30uS tag nrho rau ib qho qauv.

Yog li 1 Qauv ntawm 30uS txhais tau tias 1/30uS = 33.33 KSamples/S.

Txhawm rau teeb tsa Tus Qauv Piv Txwv, uas yog nyob ntawm TIMER0 ntawm Arduino, vim tias ADC pib ntsuas kev ntsuas yog nyob ntawm qhov ntawd hauv peb qhov xwm txheej, raws li koj tuaj yeem pom hauv cov cai thiab cov ntawv teev tseg, peb tau ua tus nqi ntawm OCR0A = 60 (Vim li cas thiaj li ???)

Vim tias raws li cov mis muab hauv cov ntawv teev npe.

zaus (lossis ntawm no Tus Qauv Piv Txwv) = Lub moos zaus ntawm Arduino/Prescaler*Tus nqi ntawm OCR0A (hauv peb qhov xwm txheej)

Zaus lossis Tus Qauv Qauv peb xav tau = 33.33KHz

Moos zaus = 16MHz

Prescaler tus nqi = 8 (hauv peb kis)

Tus nqi ntawm OCR0A = peb xav nrhiav ??

uas yooj yim muab OCR0A = 60, kuj nyob hauv peb Arduino code.

TIMER1 yog siv rau cov neeg nqa khoom nthwv dej ntawm lub teeb liab, Thiab Kuv yuav tsis mus rau hauv ntau cov ntsiab lus ntawm qhov ntawd.

Yog li, qhov ntawd yog txoj kev xav luv ntawm lub tswv yim ntawm ADC rau PWM nrog Arduino.

Kauj ruam 3: Schematic

Schematic
Schematic

Txuas txhua lub Cheeb Tsam raws li qhia hauv schematic. Yog li koj muaj ntawm no ob txoj kev xaiv:-

1. Txuas Tus Hais Lus (Txuas nrog 5V)

2. Txuas Flyback Transformer (Txuas nrog 12V)

Kuv tau sim ob qho tib si. Thiab ob leeg ua haujlwm zoo heev.

*TSEEM CEEB**TSEEM CEEB ** TSEEM CEEB ** TSEEM CEEB ** TSEEM CEEB*Peb yuav tsum siv lub suab nrov nrov los ntawm Amplifier lossis Amplifier Circuit nrog lub zog siab tshaj (Max. Voltage) ntawm 5V

Tsis lees paub:-

*Kuv pom zoo siv Flyback Transformer nrog Kev Ceeb Toom vim tias nws tuaj yeem ua rau muaj kev phom sij vim tias nws tsim hluav taws xob siab. Thiab kuv yuav tsis lav rau ib qho kev puas tsuaj.*

Kauj Ruam 4: Xeem Kawg

Yog li upload cov lej muab rau koj Arduino, Thiab txuas lub teeb liab Amplified rau A0 tus pin.

Thiab tsis txhob hnov qab txuas txhua tus pin hauv av rau hauv av.

Thiab Tsuas yog Txaus siab mloog nkauj.

Pom zoo: