Cov txheej txheem:

Portable Function Generator ntawm WiFi thiab Android: 10 Kauj Ruam
Portable Function Generator ntawm WiFi thiab Android: 10 Kauj Ruam

Video: Portable Function Generator ntawm WiFi thiab Android: 10 Kauj Ruam

Video: Portable Function Generator ntawm WiFi thiab Android: 10 Kauj Ruam
Video: 10 AI Tools To Run Your Business from A to Z 2024, Kaum ib hlis
Anonim
Portable Function Generator ntawm WiFi thiab Android
Portable Function Generator ntawm WiFi thiab Android
Portable Function Generator ntawm WiFi thiab Android
Portable Function Generator ntawm WiFi thiab Android
Portable Function Generator ntawm WiFi thiab Android
Portable Function Generator ntawm WiFi thiab Android
Portable Function Generator ntawm WiFi thiab Android
Portable Function Generator ntawm WiFi thiab Android

Nyob ze rau qhov kawg ntawm xyoo pua 20th, ntau yam kev hloov pauv thev naus laus zis tau tshwm sim, tshwj xeeb hauv kev sib txuas lus; tab sis tsis yog xwb. Rau peb, cov neeg siv, cov neeg siv khoom thiab cov kws tsim txuj ci tuaj rau teeb pom kev txhim kho cov khoom siv hluav taws xob sai, uas tuaj yeem ua rau peb lub neej yooj yim dua: saib ntse, tsev ntse, smartphones thiab lwm yam.

Txij li txhua yam tuaj yeem yog "ntse" niaj hnub no, Kuv tau txiav txim siab tsim lub cuab yeej muaj txiaj ntsig zoo los ua ib feem ntawm cov cuab yeej siv hluav taws xob tseem ceeb - Portable Function Generator, tswj tau los ntawm Android OS raws li smartphone ntawm WiFi ncaj qha lossis WiFi Local Area Network (WLAN)).

Vim li cas peb thiaj tsim tau lub cuab yeej no?

Feem ntau ntawm cov cuab yeej ntsuas tau zoo nkauj npaum li niaj hnub no. Thiab qee zaum, cov cuab yeej no tsis nqa tau. Raws li kev daws teeb meem rau tus nqi siab, tsis muaj kev nqa tau thiab tsis muaj kev nkag mus rau lub cuab yeej siv, cov cuab yeej muab lub tshuab hluav taws xob dual channel waveform generator, uas yog qhov tseeb nqa tau thiab muaj kev txwv tsis pub nkag mus rau lub network - internet lossis hauv ib qho.

Thiab ntawm chav kawm, lub cuab yeej yuav tsum tau tsim vim muaj kev mob siab rau, ua raws li DIY cov hauv paus ntsiab lus - Qee zaum peb tsuas yog yuav tsum ua qee yam ntawm peb tus kheej thiaj li ua tau zoo:)

Nta Tseem Ceeb

Hwj chim Mov

  • USB Hom-A txuas, rau ob lub tshuab hluav taws xob thiab cov phiaj xwm
  • Ua kom tiav Li -Ion roj teeb kev tswj hwm qhov system - Them nqi thiab ruaj khov
  • Kev hloov pauv ntse - tsis xav tau lub zog hloov pauv
  • Kev siv hluav taws xob ob: +3.3V thiab -3.3V rau kev ua kom muaj hluav taws xob zoo sib xws

Waveform tiam

  • Kev ua tiav ntawm DC qib ntawm qhov tso tawm cascade - kev cuam tshuam tsis zoo ntawm cov kab hluav taws xob
  • DDS raws li 4 -hom kev hloov pauv - Sine, daim duab peb sab, square thiab DC
  • Mus txog 10MHz zaus txhawb
  • Tso zis tam sim no txog 80mA nrog 500mW lub zog muaj peev xwm tshaj plaws
  • Cov kev sib cais sib cais rau cov qauv siv hluav taws xob - faib AD9834 raws cov kab hluav taws xob

Kev sib txuas lus

  • Kev siv ESP32 - Muaj peev xwm siv tau WiFi
  • Ua tiav TCP/IP kev txhawb nqa los ntawm lub tshuab hluav taws xob thiab Android smartphone
  • Muaj peev xwm khaws cov neeg siv tsis tau rau txhua lub tshuab ntaus ntawv
  • Kev saib xyuas hauv Xeev - ob qho tib si tau paub txog ib lub xeev: FuncGen (cia peb hu nws li no txij tam sim no) thiab smartphone.

Neeg siv interface

  • 20 x 4 Cim LCD nrog cov ntaub ntawv yooj yim 4-ntsis interface
  • Android daim ntawv thov - ua tiav cov neeg siv tswj hwm FuncGen ntaus ntawv
  • Buzzer Circuit - lub suab tawm tswv yim rau cov neeg siv

Kauj Ruam 1: Thaiv Duab - Kho vajtse

Thaiv Duab - Kho vajtse
Thaiv Duab - Kho vajtse
Thaiv Duab - Kho vajtse
Thaiv Duab - Kho vajtse

Microcontroller Unit - ATMEGA32L

Microcontroller yog lub programmable nti uas suav nrog txhua lub khoos phis tawj ua haujlwm uas nyob hauv ib lub tshuab hluav taws xob ib leeg. Hauv peb qhov xwm txheej, nws yog "lub hlwb" thiab lub hauv paus tseem ceeb ntawm cov kab ke. Lub hom phiaj ntawm MCU yog txhawm rau tswj hwm txhua lub tshuab hluav taws xob ib sab, tswj kev sib txuas lus ntawm cov kab ke no, tswj kev ua haujlwm kho vajtse thiab muab kev txhawb nqa tiav rau cov neeg siv interface thiab nws cuam tshuam nrog tus neeg siv tiag. Txoj haujlwm no raws ATMEGA32L MCU, uas tuaj yeem ua haujlwm ntawm 3.3V thiab zaus ntawm 8MHz.

Kev Sib Txuas Lus SoC - ESP32

Qhov SoC (System ntawm Chip) muab kev sib txuas lus txhawb nqa rau FuncGen - Nkag mus rau WiFi muaj peev xwm suav nrog kev sib txuas lus ncaj qha, hauv zos lossis hauv internet. Lub hom phiaj ntawm lub cuab yeej yog:

  • Ua haujlwm xa cov ntaub ntawv ntawm Android app thiab FuncGen ntaus ntawv
  • Kev tswj hwm kev tswj hwm/cov ntaub ntawv xov xwm
  • Kev txhawb nqa txuas ntxiv TCP/IP Client-Server teeb tsa

Hauv peb txoj haujlwm SoC yog espressif ESP32, uas yog nrov heev los nthuav rau nws ntxiv mus ntxiv:)

Li-Ion Kev Tswj Xyuas Roj Teeb

Txhawm rau hloov pauv peb lub cuab yeej rau hauv ib qho nqa tau, cov cuab yeej muaj tsim Li-Ion roj teeb them hluav taws xob. Circuit Court yog ua raws MC73831 IC, nrog kev tswj tau them tam sim no los ntawm kev kho tus nqi ntawm ib qho kev tiv thaiv ib puag ncig (Peb yuav npog cov ncauj lus no hauv kauj ruam). Cov cuab yeej siv hluav taws xob nkag yog USB Hom-A txuas.

Ntse Hloov Circuit

Ntse hloov cov cuab yeej siv hluav taws xob tswj hluav taws xob muab kev ua tiav software tswj cov cuab yeej kaw ntu thiab tsis xav tau sab nraud toggle hloov rau cov cuab yeej roj teeb hluav taws xob txiav tawm. Txhua lub zog ua haujlwm tau ua tiav los ntawm nias lub pob nyem thiab MCU lub software. Hauv qee kis, yuav tsum tau kaw lub kaw lus: Cov roj teeb hluav taws xob qis, cov khoom siv hluav taws xob siab, kev sib txuas lus yuam kev thiab lwm yam. Kev hloov pauv ntse yog ua raws STM6601 ntse hloov IC, uas yog pheej yig thiab zoo heev ua si ib puag ncig nrog.

Lub Hwj Huam Lub Hwj Huam Loj

Chav tsev no suav nrog ob lub roj teeb uas siv hluav taws xob xa hluav taws xob - +3.3V rau txhua qhov digital / analog muab cov khoom siv hluav taws xob thiab -3.3V rau FunGen kev sib xyaw ua ke sib piv rau 0V lub peev xwm (piv txwv li tsim cov qauv hluav taws xob tuaj yeem teeb tsa hauv [-3.3V: 3.3V)] cheeb tsam

  • Cov khoom siv hluav taws xob tseem ceeb yog ua raws LP3875-3.3 LDO (qis qis) 1A txoj kab hluav taws xob tawm hluav taws xob.
  • Cov khoom siv hluav taws xob thib ob yog ua raws LM2262MX IC, uas ua rau DC-DC qhov tsis zoo hloov pauv ntawm lub tshuab hluav taws xob-them-twj-qhov system uas IC ua raws.

Waveform Generators System

Lub kaw lus tau tsim nrog kev tsom mus rau cais DDS (ncaj qha digital synthesis) kev sib txuas ua ke, uas tso cai ua kom tiav kev hloov pauv kev hloov pauv los ntawm MCU's SPI (txuas txuas ib ntus sib txuas). Cov kab hluav taws xob uas tau siv hauv kev tsim qauv yog cov khoom siv sib piv AD9834 uas tuaj yeem muab ntau hom kev sib txawv. Cov teeb meem peb yuav tsum tau ntsib thaum ua haujlwm nrog AD9834 yog:

  • Tsau waveform amplitude: Waveform amplitude yog tswj los ntawm sab nraud DAC module
  • Tsis hais txog qib offset DC: Kev siv cov lej sib txuas nrog qhov xav tau DC offset qhov tseem ceeb
  • Sib cais cov txiaj ntsig rau cov xwm txheej yoj thiab daim duab peb sab/sine yoj: Kev hloov pauv ntawm qhov hloov pauv ntau zaus yog li txhua cov channel ib leeg tso tawm tuaj yeem muab tag nrho cov kev xav tau waveforma: sine, triangle, square thiab DC.

Ua kua Crystal Display

LCD yog ib feem ntawm UI (tus neeg siv cuam tshuam), thiab nws lub hom phiaj yog kom cov neeg siv nkag siab tias lub cuab yeej ua dab tsi hauv lub sijhawm tiag. Nws cuam tshuam nrog cov neeg siv ntawm txhua lub xeev ntaus ntawv.

Buzzer

Yooj yim suab hluav taws xob tsim hluav taws xob rau kev tawm tswv yim ntxiv los ntawm lub cuab yeej rau tus neeg siv.

Kev koom ua ke ISP Programmer

Muaj qhov teeb meem tsis tu ncua rau txhua tus kws tshaj lij thaum nws los txog rau txheej txheem txheej txheem: Ib txwm muaj qhov phem tshaj xav tau kom tshem tawm cov khoom lag luam txhawm rau rov ua dua nws nrog lub khoos phis tawj tshiab. Txhawm rau kov yeej qhov tsis yooj yim no, AVR ISP programmer tau txuas nrog lub cuab yeej los ntawm sab hauv, qhov USB cov ntaub ntawv thiab cov kab hluav taws xob tau txuas rau lub cuab yeej 'USB Hom-A txuas. Hauv qhov teeb tsa no, peb tsuas yog xav tau ntsaws peb FuncGen ntawm USB cable rau kev ua haujlwm lossis them nqi!

Kauj Ruam 2: Thaiv Duab - Networking

Thaiv Duab - Networking
Thaiv Duab - Networking

Dual Channel Function Generator

Cov cuab yeej tseem ceeb. Qhov peb tau tshuaj xyuas hauv cov kauj ruam dhau los

ESP-WROOM-32

Integrated System-on-Chip nrog WiFi thiab BLE lub peev xwm. SoC tau txuas nrog lub rooj tsav xwm tseem ceeb (Peb yuav npog qhov no hauv cov lej lej) ntawm UART module thiab ua raws li cov lus xa tawm ntawm cov cuab yeej tseem ceeb thiab Android smartphone.

WiFi Local Network

Lub xov tooj ntawm tes thiab ntaus ntawv yuav sib tham ntawm WiFi ncaj qha lossis hauv cheeb tsam network, raws TCP server/tus neeg siv khoom teeb tsa. Thaum cov cuab yeej lees paub ib leeg ntawm WiFi, cov cuab yeej tseem ceeb tsim TCP server nrog cov yam ntxwv tsim nyog thiab tuaj yeem xa/tau txais cov lus. Cov cuab yeej ua haujlwm thib ob rau lub xov tooj smartphone. Hauv lwm lub cuab yeej, txuas rau TCP server raws li cov neeg siv khoom siv sib txuas, tab sis raug suav hais tias yog thawj qhov kev xa xov - smartphone yog tus uas pib ua tiav kev sib txuas lus: xa xov - tau txais kev teb.

Android Smartphone

Android OS raws cov cuab yeej siv smartphone uas ua haujlwm ntawm FuncGen daim ntawv thov

Kauj Ruam 3: Qhov Chaw, Cov Cuab Yeej, IDE thiab Cov Nqi Ntawm Cov Khoom

Qhov Chaw, Cov Cuab Yeej, IDE thiab Cov Nqi Khoom
Qhov Chaw, Cov Cuab Yeej, IDE thiab Cov Nqi Khoom
Qhov Chaw, Cov Cuab Yeej, IDE thiab Cov Nqi Khoom
Qhov Chaw, Cov Cuab Yeej, IDE thiab Cov Nqi Khoom
Qhov Chaw, Cov Cuab Yeej, IDE thiab Cov Nqi Khoom
Qhov Chaw, Cov Cuab Yeej, IDE thiab Cov Nqi Khoom

Cov Nqi Ntawm Cov Khoom (Saib daim ntawv XLS txuas nrog)

UI thiab Kev Sib Txuas System

  • 1 x 2004A Char-LCD 20x4 Xiav
  • 1 x USB Hom B Txuas
  • 1 x 10 Teeb Mini Micro JST XH 2.54mm 4 Pin
  • 1 x 6pcs Momentary SW

Kev Txiav Txim PCB (Raws Li Pom Pom Studio)

Khoom siv FR-4

Tsis muaj txheej 2 txheej

PCB Quantity 10

Tsis muaj Cov Qauv Sib Txawv 1

PCB Thickness 1.6 hli

PCB Xim Xiav

Nto Ua tiav HASL

Yam tsawg kawg Solder Mask Dam 0.4mm ↑

Tooj Luj 1oz

Yam tsawg kawg Qhov Qhov Loj 0.3mm

Kab Tsuag Dav / Qhov Ncauj 6/6 mil

Plated Ib nrab-qhov / Castellated Qhov No

Impedance Control Tsis

Cov cuab yeej

  • Kub kua nplaum phom
  • Tweezers
  • Cutter
  • ~ 22AWG xaim rau lub hom phiaj ua haujlwm tsis raug
  • Soldering hlau/chaw nres tsheb
  • Soldering tin
  • Chaw nres tsheb SMD rov ua haujlwm (yeem)
  • 3D tshuab luam ntawv (Tsis teb los tau)
  • Extruding cov ntaub ntawv
  • AVR ISP Programmer
  • USB rau Serial Converter (Yeem, rau kev debugging lub hom phiaj)

Ib puag ncig kev txhim kho ib puag ncig (IDE) thiab Software

  • Autodesk EAGLE lossis Cadence Schematic Editor / Allegro PCB Editor
  • OpenSCAD (Tsis teb los tau)
  • Ultimaker Cura (Tsis teb los tau)
  • Saleae Logic (Rau kev daws teeb meem)
  • Atmel Studio 6.3 lossis siab dua
  • Android Studio lossis Eclipse IDE
  • Docklight Serial Monitor / Lwm COM chaw nres nkoj saib xyuas software
  • ProgISP rau AVR ATMEGA32L flash programming

Kauj Ruam 4: Tsim Kho Vaj Huam Sib Luag - Pawg Thawj Coj

Kho vajtse Tsim - Pawg Thawj Coj
Kho vajtse Tsim - Pawg Thawj Coj
Kho vajtse Tsim - Pawg Thawj Coj
Kho vajtse Tsim - Pawg Thawj Coj
Kho vajtse Tsim - Pawg Thawj Coj
Kho vajtse Tsim - Pawg Thawj Coj

Roj teeb Tswj Circuit

Roj teeb them hluav taws xob raws li MCP7383 IC, uas tso cai rau peb xaiv qhov xav tau them tam sim no rau Li -Ion roj teeb - 3.7V nrog lub peev xwm ntawm 850mAh. Kev them nqi tam sim no tau teeb tsa los ntawm tus txheej txheem tiv thaiv tus nqi (R1) hauv peb kis

R1 = 3KOhm, Kuv (them) = 400mA

USB qhov hluav taws xob VBUS tau lim los ntawm π-lim (C1, L3, C3) thiab ua raws li lub zog siv rau kev them nqi hluav taws xob.

Kev faib hluav taws xob faib hluav taws xob (R2, R3) tso cai rau MCU los qhia seb lub zog USB sab nraud txuas nrog lossis tsis yog, los ntawm kev muab cov hluav taws xob txuas mus rau MCU A/D channel:

V (qhov taw qhia) ~ (2/3) V (BUS)

Txij li peb A/D ntawm ATMEGA32L yog 12-ntsis, peb tuaj yeem suav qhov digital ntau:

A / D (thaj tsam) = 4095V (qhov taw qhia) / V (REF).

A/D ∈ [14AH: FFFH]

Ntse Hloov Fais Fab Chav

Circuit Circuit tso cai rau tswj lub zog siv hluav taws xob rau txhua qhov tsim thaiv ob qho tib si los ntawm kev thawb-khawm thiab software ntawm MCU thiab yog ua raws STM6601 Ntse-Hloov nrog POWER xaiv tsis yog RESET. Cov dav hlau uas peb xav xav txog yog cov no:

  • PSHOLD - Cov kab tawm tswv yim, uas txhais lub xeev cov cuab yeej: yog rub qis, cov cuab yeej siv tsis tau tag nrho cov khoom siv hluav taws xob thib ob (+3.3V thiab -3.3V). Yog tias HIGH - ntaus ntawv tuav ON lub xeev.
  • nSR thiab nPB - Cov kab tawm tswv yim. Laub khawm terminals. Thaum ntog ntug raug kuaj pom ntawm cov pins, ntaus ntawv sim nkag lub zog nce / nqis hom
  • nINT - Cov kab tawm. Rub LOW txhua zaus thaum nias lub pob nyem
  • EN - Cov kab hluav taws xob tso tawm, tau siv los ua lub zog ua haujlwm rau cov khoom siv hluav taws xob thib ob. Thaum tseem muaj LOW, ob qho khoom siv hluav taws xob thib ob yog neeg xiam oob khab

Muaj qee cov ntawv tseem ceeb ua ntej peb mus rau qhov tsim qauv zaum kawg:

  • PSHOLD yuav tsum tau rub mus txog 3.3V, vim tias muaj qee kis thaum MCUs raug yuam kom tag nrho I/Os nyob hauv xeev HIGH-Z. Hauv qhov no, lub xeev PSHOLD los ntawm MCU tsis paub thiab yuav cuam tshuam loj heev rau cov txheej txheem txheej txheem cuab yeej.
  • STM6601 yuav tsum tau xaj nrog EN kho qhov kev xaiv ntawm nias ntev, tsis yog RESET xaiv (Kuv tau poob rau qhov ntawd).

Cov Khoom Siv Hluav Taws Xob: +3.3V

Lub hwj chim tseem ceeb rau txhua lub tshuab hauv peb tes num. Thaum txoj kab +3.3V tau tuav ntawm GND qib (piv txwv li tsis muaj qhov ntsuas hluav taws xob), txhua tus IC tshwj tsis yog lub ntse hloov pauv. Lub Circuit Court yog ua raws li LDO LP-3875-3.3 IC, nrog lub peev xwm tswj tau ntawm EN lub davhlau ya nyob twg thiab muab tam sim no txog 1A.

Lub zog siv hluav taws xob rau lub xov tooj hluav taws xob no yog lub roj teeb hluav taws xob, txuas nrog A/D qhov taw qhia rau kev nkag siab VBAT hauv kev teeb tsa, zoo ib yam li VBUS kev nkag siab Circuit Court. Hauv qhov no, cov lus teb sib txawv me ntsis;

V (Roj teeb-rau-A/D) = 0.59V (Roj teeb); A/D (thaj tsam) ∈ [000H: C03H]

Cov Khoom Siv Hluav Taws Xob: -3.3V

Qhov tsis zoo ntawm cov khoom siv hluav taws xob tso cai rau peb los tsim cov duab sib thooj nrog DC qhov tseem ceeb ntawm 0V (piv txwv li cov txiaj ntsig nruab nrab waveform tuaj yeem yog 0V). Lub voj voog no yog ua raws LM2662MX IC - DC/DC hloov pauv uas ua haujlwm ntawm "them nqi twj". Qhov siab tshaj plaws tam sim no ntawm Circuit yog 200mA uas txaus rau peb qhov xav tau tsim - peb raug txwv nrog 80mA tso tawm tam sim no los ntawm txhua lub cuab yeej 'channel.

IC ua txhua txoj haujlwm xav tau, yog li tsuas yog qee qhov peb xav tau txuas yog ob lub tshuab hluav taws xob: C33 rau kev hloov pauv thiab C34 rau -3.3V kab hla (kev txiav txim siab txo suab nrov). Qhov zaus ntawm kev hloov pauv yog qhov tsis tsim nyog hauv kev tsim qauv yog tias peb tso lub Circuit Court kom deb txaus los ntawm qhov tsim tawm ntu ntu (Peb yuav tham txog nws ntawm PCB Layout step).

Microcontroller Unit - MCU

Nov yog tus thawj tswj hwm thiab tus thawj coj ntawm peb lub kaw lus - tswj hwm, tswj hwm network, xa xov thiab txhawb nqa UI - txhua yam yog los ntawm MCU.

MCU uas tau xaiv yog Atmel ATMEGA32L, qhov twg L sawv rau kev txhawb zog ua haujlwm ∈ [2.7V: 5.5V]. Hauv peb qhov xwm txheej, qhov ua haujlwm voltage yog +3.3V.

Cia peb xav txog lub luag haujlwm tseem ceeb, uas yuav tsum tau nkag siab, ua haujlwm nrog MCU hauv peb qhov kev tsim:

  • Sab Nraud Oscillator - Yog ib qho khoom siv xaiv, txij li peb txaus siab rau 8MHz kev khiav hauj lwm zaus
  • Kev Tswj Sab Nraud, SPI Network - Txhua lub cuab yeej sib txuas (tsis suav nrog ESP32) tab tom sib tham nrog MCU ntawm SPI. Muaj peb txoj kab sib koom rau txhua lub cuab yeej (SCK, MOSI, MISO) thiab txhua lub tshuab hluav taws xob ib leeg muaj nws kab ke CS (Chip Xaiv). Cov cuab yeej SPI uas yog ib feem ntawm cov cuab yeej:

    1. D/A rau kev tswj hwm qhov dav - Channel A.
    2. D/A rau kev tswj hwm qhov dav - Channel B
    3. AD9834 ntaus ntawv - Channel A.
    4. AD9834 ntaus ntawv - Channel B
    5. D/A rau kev tswj hwm qhov tsis ncaj ncees - Channel A.
    6. D/A rau kev tswj hwm qhov tsis ncaj ncees - Channel B
    7. Digital Potentiometer rau LCD teeb ci/teeb tsa sib txawv
  • Kev Txhawb Nqa LCD - Txij li LCD yog cov cim 20 x 4 cim, peb siv 4 -ntsis interface (Kab D7: D4), tswj tus pin (Kab RS, E) thiab ci ci/sib piv tswj (Kab V0 thiab Anode)
  • RGB LED txhawb nqa - Cov qauv no yog nyob ntawm yeem, tab sis muaj ib qho cathode RGB LED txuas nrog cov tiv thaiv tsim nyog, txuas nrog MCU.
  • Kev Tswj Lub Hwj Chim - MCU ua lub zog saib xyuas hauv lub sijhawm tiag tiag, thiab saib xyuas txhua qhov xwm txheej xav tau fais fab:

    1. VBAT_ADC - Kev ntsuas lub roj teeb thiab txiav txim siab nws lub xeev (ADC0 Channel)
    2. PWR_IND - Qhia txog kev txuas hluav taws xob sab nraud (ADC1 Channel)
    3. PS_HOLD - Thawj lub zog ua kom muaj kab rau txhua qhov ntawm cov kab ke. Thaum raug rub qis los ntawm MCU, cov cuab yeej siv zog
    4. Cuam tshuam lub davhlau ya nyob twg ntawm kev hloov pauv ntse - Laub khawm lub xeev saib xyuas
  • WiFi Network Management - ESP32: MCU sib tham nrog ESP32 ntawm UART interface. Txij li 8MHz tso cai rau peb siv tus nqi baud ntawm 115200 nrog qhov yuam kev me me, peb tuaj yeem siv ESP32 hauv Circuit Court yam tsis tau txiav txim ua ntej ntawm baud tus nqi hloov pauv.

AVR ISP Programmer

Peb MCU tau npaj los ntawm SPI nrog rov pib dua kab (/RST) yuav tsum tau rub siab rau kev ua haujlwm kom raug (yog tias tsis yog - MCU yuav pom nws tus kheej nyob rau hauv lub xeev pib dua mus ib txhis).

Txhawm rau tso cai ntaus ntawv ob qho program thiab them nyiaj ntawm USB, Kuv tau txuas AVR ISP programmer (Cov khoom me me, yuav los ntawm eBay). Txhawm rau tswj hwm lub cuab yeej ua tiav USB kev txhawb nqa, yuav tsum tau khi USB Hom-A (D+, D-, VBUS thiab GND) cov dav hlau nrog AVR ISP ntaus ntawv.

Waveform Generation Circuit

Lub hauv paus ntawm cov cuab yeej yog cov kab hluav taws xob no. AD9834 yog lub cuab yeej DDS uas tsis muaj zog uas muab rau peb txhua yam ntawm cov nthwv dej uas peb xav tau los ntawm lub kaw lus. Cov khoom siv hluav taws xob muaj ob txoj kev ywj pheej AD9834 ICs nrog sib cais sab nraud 50MHz oscillators (raws li nws tuaj yeem pom hauv cov duab). Qhov laj thawj rau kev sib cais oscillator yog kev txiav txim siab lub suab nrov digital txo qis kev txiav txim siab, yog li qhov kev txiav txim siab yuav tsum ua kom raug 50MHz kab nrog oscillators tso rau ib sab AD9834.

Tam sim no cia saib qee qhov lej:

Txij li DDS ntaus ntawv ua haujlwm ntawm Phase Log thev naus laus zis nrog cov txiaj ntsig tso tawm hauv 28-ntsis rau npe, peb tuaj yeem piav qhia cov txheej txheem ua lej raws lej:

dP (theem) = ωdt; P = P '= 2πf; f (AD9834) = ΔP * f (clk) / 2^28; ∈P ∈ [0: 2^28 - 1]

Thiab raws li AD9834 cov ntawv teev tseg, suav nrog tus lej siab tshaj plaws, kev daws teeb meem zaus tuaj yeem tau txais:

=f = k * f (oscillator) / f (siab tshaj) = 0.28 * 50M / 28M = 0.187 [Hz]

AD9834 ICs muab cov khoom sib piv tam sim no rau daim duab peb sab/sine wave (IOUT davhlau ya nyob twg) thiab tso tawm digital rau square yoj (SIGN_OUT davhlau ya nyob twg). Kev siv cov cim me me yog qhov nyuaj me ntsis tab sis peb muaj peev xwm los daws nws - Txhua lub sijhawm DDS dhau qhov pib ntawm kev sib piv tus nqi, SIGN_OUT coj tus yam ntxwv. 200Ohm resistor tau txuas rau txhua qhov channel tso tawm, yog li qhov hluav taws xob tso tawm yuav muaj txiaj ntsig zoo:

Kuv (ib channel) = V (tso tawm) / R (xaiv qhov hluav taws xob); V (tso tawm) = R (VS)*Kuv (SS) = 200I (SS) [A]

Amplitude Control (D/A) Cov Kev Siv Hluav Taws Xob

Raws li cov ntaub ntawv ntawm AD9834, nws qhov dav tuaj yeem hloov kho los ntawm kev muab tam sim no rau DDS qhov ntsuas tag nrho, yog li nrog kev pab ntawm dual D/A IC, peb tuaj yeem tswj cov teeb liab tso tawm kom pom los ntawm kev kho tam sim no. Ib zaug ntxiv, qee qhov lej:

Kuv (puv nplai) = 18 * (V_REF - V_DAC) / R_SET [A]

Raws li schematics thiab muab qee tus lej los ua zauv:

Kuv (puv nplai) = 3.86 - 1.17 * V_DAC [A]

D/A tus qauv siv hauv kev tsim yog 12-ntsis MCP4922, thaum tam sim no nyob hauv thaj tsam ntawm [0mA: 3.86mA] thiab qhov ua haujlwm dav dav yog:

V (xaiv qhov dav) = 1 - [V (D / A) / (2^12 - 1)]

Waveform Multiplexing Circuit

Square nthwv dej thiab sine/daim duab peb sab yoj tsim tawm tau sib cais ntawm AD9834 li no peb yuav tsum siv lub nrawm nrawm sib txuas rau ob qhov kev tso tawm kom tso cai rov qab tau txais txhua qhov kev xav tau ntawm ib kab sib cais. Multiplexer IC yog ADG836L analog hloov nrog qhov tsis tshua muaj kev tiv thaiv (~ 0.5Ohm).

Cov lus xaiv uas MCU tab tom siv rau cov txiaj ntsig raws li nws yog:

Xaiv Hom [D2: D1] | Tso Tawm Channel A | Tso Tawm Channel B

00 | Xuv Sine/Daim duab peb sab | Sine/Daim duab peb sab 01 | Sine/Daim duab peb sab | Plaub Hlis 10 | Duab plaub | Sine/Daim duab peb sab 11 | Duab plaub | Square

Kev Nyuaj Siab Tsis Txaus Siab (D/A) cov hluav taws xob

Ib qho ntawm lub tshuab hluav taws xob tsim hluav taws xob lub ntsiab tseem ceeb yog tswj hwm nws tus nqi DC. Hauv qhov kev tsim qauv no nws ua tiav los ntawm kev teeb tsa qhov xav tau D/A qhov hluav taws xob ntawm txhua lub channel, thiab cov kev tsis ncaj ncees no suav nrog cov txiaj ntsig sib npaug uas peb tau tham me ntsis ua ntej.

Qhov hluav taws xob tau txais los ntawm D/A lus dag hauv thaj tsam [0V: +3.3V] yog li muaj op-amp raws li Circuit Court uas qhia D/A ntau rau [-3.3V: +3.3V], tso cai rau ntaus ntawv kom muab ntau yam ntawm qhov xav tau DC tivthaiv. Peb yuav hla qhov kev txheeb xyuas qhov tsis txaus siab, thiab tsuas yog tsom mus rau qhov txiaj ntsig kawg:

V_OUT (channel B) = V_BIAS_B (+) - V_BIAS_B (-); V_OUT (channel A) = V_BIAS_A (+) - V_BIAS_A (-)

Tam sim no, DC tivthaiv ntau nyob hauv ntau [-3.3V: +3.3V].

Summing Circuits - DC Components thiab Waveform Outputs

Txog tam sim no peb muaj txhua yam peb xav tau rau cov cuab yeej tsim nyog tsim nyog - Kev Nyiam Voltage (DC tivthaiv) hauv qhov ntau qhov hluav taws xob, thiab ua haujlwm sib npaug AD9834. Peb yuav ua qhov ntawd tshwm sim los ntawm kev siv cov lus sib txuas ua ke - op -amp teeb tsa

Cia peb hla lej ib zaug ntxiv (Peb tau npog ntau qhov kev ua lej zauv twb tau ua lawm) thiab sau qhov kawg ntawm kev suav cov amplifier suav nrog:

V (ntaus ntawv tso tawm) = V (qhov tsis zoo) - V (qhov tsis zoo) - V (tso zis sib npaug) [V]

Li no:

V_OUT = ΔV_BIAS - V_AD9834 [V]

Cov khoom sib txuas ntawm BNC hom txuas nrog kev xaiv tiv thaiv (R54, R55; R56, R57). Qhov laj thawj rau qhov ntawd yog nyob rau hauv rooj plaub uas tsim qauv tuaj yeem ua haujlwm tsis zoo, peb tseem tuaj yeem xaiv yog tias peb xav siv cov lus sib txuas ntxiv.

Lus Cim Tseem Ceeb: Cov tes hauj lwm sib txuas ntawm qhov kawg suav nrog lub tshuab raj tuaj yeem hloov kho los ntawm tus tsim qauv, txhawm rau hloov pauv qhov siab tshaj plaws uas tuaj yeem khaws tau los ntawm lub cuab yeej. Hauv kuv qhov xwm txheej, txhua qhov amps sib koom ua tau zoo ib yam = 1, yog li qhov siab tshaj plaws tsis pub tshaj yog 0.7Vpp rau daim duab peb sab/sine yoj thiab 3.3Vpp rau square yoj. Txoj hauv kev ua lej tshwj xeeb tuaj yeem pom ntawm cov duab txuas nrog.

ESP32 Raws Li Sab Nraud Cov Qauv

MCU sib tham nrog ESP32 ntawm UART interface. Txij li thaum kuv xav tau kuv tus kheej PCB rau ESP32, muaj 4 lub dav hlau muaj los txuas: VCC, RX, TX, GND. J7 yog kev sib txuas sib txuas ntawm PCBs, thiab ESP32 yuav raug faib ua cov qauv sab hauv sab hauv lub cuab yeej.

Tus neeg siv interface - LCD thiab hais lus

LCD uas tau siv yog cov cim 20 x 4 cim nrog 4 -ntsis interface, Raws li nws tuaj yeem pom los ntawm kev tsim muaj SPI digital potentiometer txuas rau lub dav hlau LCD "A" thiab "V0" - nws lub hom phiaj yog txhawm rau kho ci ntsa iab thiab sib piv ntawm LCD module programmatically.

Tus neeg hais lus muab lub suab tso tawm rau tus neeg siv los ntawm cov xwm txheej yooj yim yoj tsim los ntawm MCU. BJT T1 tswj hwm qhov tam sim no los ntawm tus hais lus uas tuaj yeem tsuas yog hauv ob lub xeev - ON / OFF.

Kauj Ruam 5: Tsim Kho Vajtse - ESP32 Module

Kho vajtse Tsim - ESP32 Module
Kho vajtse Tsim - ESP32 Module

ESP32 tau siv los ua tus qauv sab nrauv rau lub ntsiab PCB. Kev sib txuas lus ntawm lub cuab yeej yog ua raws AT cov lus txib, uas muaj nyob ntawm cov khoom siv sib xws 'firmware.

Tsis muaj ntau los nthuav dav rau qhov tsim qauv no, tab sis muaj qee cov ntawv sau rau tsim:

  • Txog qhov ua tsis tiav ntawm kev siv UART tus qauv tsim nyog ntawm ESP32, Kuv tau txuas peb qhov kev xaiv tiv thaiv rau ob qho TX thiab RX kab. (0Ohm rau txhua tus). Rau kev teeb tsa tus qauv, UART2 tus qauv siv rau AT cov lus txib (R4, R7 yuav tsum tau muab muag)
  • Cov cuab yeej muaj 4 -kab tso tawm - VCC, GND, TX, RX.
  • IO0 thiab EN pins ntsuam xyuas kev ua haujlwm ntawm lub cuab yeej thiab yuav tsum raug tsim raws li nws tau muab hauv kab lus

Tag nrho cov yam ntxwv PCB peb yuav npog hauv cov kauj ruam hauv qab no.

Kauj Ruam 6: PCB Txheej Txheem

PCB txheej txheem
PCB txheej txheem
PCB txheej txheem
PCB txheej txheem
PCB txheej txheem
PCB txheej txheem

Lub hom phiaj ntawm kev tsim PCB

  1. Tsim cov txheej txheem teeb tsa rau txhua qhov kev sib koom ua ke ntawm tib lub rooj tsavxwm
  2. Txhim kho cov cuab yeej ua tau zoo los ntawm kev tsim ib qho PCB tseem ceeb
  3. Kev txo tus nqi - yog tias koj xav saib tus nqi, tus qauv tsim tus nqi qis tiag tiag tus nqi qis
  4. Txo qhov loj ntawm pawg thawj coj saib hluav taws xob
  5. Yooj yim los daws teeb meem - Peb tuaj yeem siv TPs (Cov ntawv xeem) rau txhua kab uas tuaj yeem ua haujlwm tsis tau.

Cov Kev Ntsuas

Ob qho PCBs: lub hauv paus tseem ceeb thiab ESP32 pawg thawj coj qhia cov yam ntxwv zoo ib yam rau cov txheej txheem tsim khoom - tus nqi qis thiab ua haujlwm rau peb lub hom phiaj. Cia peb pom lawv:

A - Pawg Thawj Coj Loj

  • Loj: 10cm x 5.8cm
  • Cov Naj Npawb: 2
  • PCB tuab: 1.6 hli
  • Tsawg qhov chaw seem/dav: 6/6mil
  • Yam tsawg kawg ntawm qhov taub: 0.3mm
  • Tooj liab mus rau ntug ntawm PCB qhov tsawg kawg nkaus nrug: 20mil
  • Kev ua tiav saum npoo: HASL (Zoo nkauj zoo saib cov xim xim pheej yig hom)

B - Pawg Thawj Coj Loj

  • Loj: 3cm x 4cm
  • Cov Naj Npawb: 2
  • PCB tuab: 1.6 hli
  • Tsawg qhov chaw seem/dav: 6/6mil
  • Yam tsawg kawg ntawm qhov taub: 0.3mm
  • Tooj liab mus rau ntug ntawm PCB qhov tsawg kawg nkaus nrug: 20mil
  • Kev ua tiav saum npoo: HASL

Kauj ruam 7: 3D Enclosure

3D Enclosure
3D Enclosure

Kuv tsis tau tsim nws los ntawm kuv tus kheej, vim tias thaum lub sijhawm kuv tau yaum cov cuab yeej no ua haujlwm, yog li kuv tsis paub txog txhua qhov 3D luam ntawv pib txhua. Yog li kuv tau siv SCAD qhov project los ntawm Thingiverse, thiab txuas qhov sib txawv apertures rau ciam teb, raws li kuv lub cuab yeej tshwj xeeb.

  1. Luam Ntawv Ntaus: Creality Ender-3
  2. Hom txaj: iav, tuab 5 hli
  3. Filament txoj kab uas hla: 1.75mm
  4. Hom ntsiab lus: PLA+
  5. Nozzle taub: 0.4mm
  6. Thawj Ceev: 20mm/Sec
  7. Qhov Nruab Nrab Ceev: 65mm/Sec
  8. Kev them nyiaj yug: N/A
  9. Tus nqi: 25%
  10. Kub:

    • Lub txaj: 60 (oC)
    • Nozzle: 215 (oC)
  11. Filament Xim: Dub
  12. Tag Nrho Cov Apertures: 5
  13. Cov Naj Npawb Ntawm Cov Ntaub Ntawv: 4

    • TOP Plhaub
    • Plhaub hauv qab
    • Pem Hauv Ntej Vaj Huam Sib Luag
    • Rov Qab Vaj Huam Sib Luag

Kauj Ruam 8: Kev Siv Software - MCU

Kev Siv Software - MCU
Kev Siv Software - MCU
Kev Siv Software - MCU
Kev Siv Software - MCU
Kev Siv Software - MCU
Kev Siv Software - MCU

GitHub Txuas rau Android thiab Atmega32 Code

Software Algorithm

Txhua txoj haujlwm uas tau ua los ntawm MCU, tau piav qhia hauv cov ntawv sib dhos. Ntxiv rau qhov ntawd, muaj cov lej txuas rau txoj haujlwm. Cia peb npog cov software tshwj xeeb:

Fais fab tuag

Hauv theem no, MCU ua tiav txhua qhov pib ua ntu zus nrog rau kev txiav txim siab ntawm hom kev sib txuas lus nrog Android ntaus ntawv: Ncaj WiFi lossis WLAN kev sib txuas lus network - cov ntaub ntawv no tau khaws cia hauv EEPROM. Tus neeg siv tuaj yeem rov txhais dua Android ntaus ntawv ua khub ntawm hom no.

Ncaj Ncees Android Ntaus Pairing

Hom kev ua khub no yog tsim los ntawm WiFi network tsim los ntawm FuncGen ntaus ntawv. Nws yuav tsim AP (Access Point) thiab TCP server ntawm cov cuab yeej hauv IP nrog rau SSID tshwj xeeb (WiFi lub npe network) thiab tus lej tshwj xeeb chaw nres nkoj. Cov cuab yeej yuav tsum tuav lub xeev - qhib rau kev sib txuas.

Thaum Android ntaus ntawv txuas nrog FuncGen, MCU nkag mus rau hauv ACTIVE mode, thiab teb raws li cov neeg siv qhia los ntawm Android ntaus ntawv.

WLAN kev sib txuas

Txhawm rau sib txuas lus ntawm lub network WiFi hauv ib cheeb tsam, MCU yuav tsum muab lus txib rau ESP32 los tsim AP, sib tham nrog Android ntaus ntawv thiab pauv cov ntaub ntawv tseem ceeb hauv network:

  • Android ntaus ntawv tau txais los ntawm FuncGen nws MAC chaw nyob, khaws nws hauv lub cim xeeb.
  • FuncGen ntaus ntawv tau txais daim ntawv Android ntaus ntawv xaiv WLAN tsis: SSID, hom kev ruaj ntseg thiab Lo lus zais thiab khaws nws hauv EEPROM.

Thaum cov cuab yeej tau txuas nrog tib WLAN, Android ntaus ntawv yuav tshawb rau FuncGen los ntawm kev txheeb xyuas tag nrho MAC chaw nyob ntawm cov khoom siv, txuas nrog WLAN. Thaum Android ntaus ntawv txiav txim siab MAC sib xws, nws sim sib txuas lus.

Kev Sib Txuas thiab Kev Xeem Hauv Xeev - MCU

Thaum cov cuab yeej sib txuas lus nrog ib leeg, cov txheej txheem (Saib ua ntej cov kauj ruam kawg) nyob zoo ib yam, thiab daim phiaj ntws zoo ib yam.

Lub Xeev Saib Xyuas Ntaus Ntawv

Lub sijhawm cuam tshuam muab rau MCU cov ntsiab lus tsim nyog rau lub xeev tuav. Txhua lub voj voos ntawm timer cuam tshuam, cov npe hauv qab no tsis tau hloov kho:

  • Lub hwj chim sab nraud - On/Off
  • Roj teeb lub xeev
  • UI hloov tshiab rau txhua qhov kev hloov kho
  • Push-Button: Nias/Tsis Nias

Kauj Ruam 9: Kev Siv Software - Android App

Kev Siv Software - Android App
Kev Siv Software - Android App
Kev Siv Software - Android App
Kev Siv Software - Android App
Kev Siv Software - Android App
Kev Siv Software - Android App
Kev Siv Software - Android App
Kev Siv Software - Android App

Android app tau sau ua Java-Android style. Kuv yuav sim piav qhia nws ib yam nkaus li cov kauj ruam dhau los - los ntawm kev faib cov txheej txheem cais ua cais cov lej thaiv.

Lub Hwj Huam Ua Ntej

Thawj ntu ntawm lub cuab yeej. Nov yog lub logo app tau nthuav tawm nrog rau kev qhib GPS thiab WiFi cov qauv ntawm Android ntaus ntawv (Tsis txhob txhawj xeeb, GPS xav tau rau WiFi kom raug network sib txuas nkaus xwb).

Ntawv qhia zaub mov tseem ceeb

Tom qab qhib lub app, plaub lub khawm yuav tshwm ntawm qhov screen. Khawm ua:

  1. Kev sib txuas ncaj qha: Pib kev sib txuas rau FuncGen's AP los ntawm SSID ntawm IOT_FUNCGEN. Yog tias kev sib txuas ua tiav, ntaus ntawv nkag mus rau hauv hom UI tseem ceeb.
  2. Kev Sib Txuas WIFI: Cov cuab yeej tshuaj xyuas yog tias muaj cov ntaub ntawv khaws tseg hauv lub cim xeeb: wifi.txt, mac.txt. Yog tias tsis muaj cov ntaub ntawv khaws cia, lub cuab yeej yuav tsis lees txais cov neeg thov thiab muab cov lus pop-up uas WLAN kev sib txuas yuav tsum tau ua ua ntej.
  3. PAIRING: Sib txuas lus nrog FuncGen ib yam nkaus li DIRECT CONNECTION, tab sis hloov pauv cov lus sib txuas tas li, muaj kev sib tuav tes nkaus xwb. Android ntaus ntawv yog tias nws twb txuas nrog lub network WiFi, thiab thov kom cov neeg siv nkag mus rau tus lej nkag. Yog tias kev rov txuas tau ua tiav, Android ntaus ntawv khaws SSID thiab tus lej cim hauv wifi.txt cov ntaub ntawv. Tom qab ua tiav kev sib txuas lus nrog FuncGen, nws tau txais MAC chaw nyob hauv mac.txt file.
  4. Tawm: Txaus hais tias:)

WiFi Scanning Manager

Kuv xav kom daim ntawv thov ua tiav txhua yam thiab tsis muaj kev hloov kho app los ua. Yog li, kuv tau tsim WiFi Scanner, uas ua tiav txhua qhov haujlwm xav tau los txuas rau WiFi network nrog tus lej paub thiab SSID.

Kev Xa Cov Ntaub Ntawv thiab Kev Sib Txuas TCP

Nov yog lub ntsiab cai thaiv hauv app. Rau txhua lub UI chav nyob muaj cov lus piav qhia nyob rau hauv ib hom ntawv tshwj xeeb (Pre-final step), uas yuam FuncGen los muab cov txiaj ntsig xav tau rau cov channel. Muaj peb hom UI cov haujlwm hauv kev ua haujlwm:

  1. Nrhiav Bars: Ntawm no peb txhais qhov tseeb-ntau ntawm FuncGen cov txiaj ntsig tso tawm

    1. Amplitude
    2. DC Offset
    3. LCD Brightness
    4. LCD Zoo
  2. Hloov Kho Ntawv: Txhawm rau ua kom cov lej muaj nuj nqis tau teev tseg zoo thiab raug, cov lej nkag tau ua tiav los ntawm cov lej tsuas yog cov thawv ntawv
  3. Khawm: Xaiv cov tsis los ntawm cov npe muaj:

    1. Waveform Hom

      1. Sine
      2. Daim duab peb sab
      3. DC
      4. Square
      5. OFF
    2. Tau Info

      1. Roj teeb xwm txheej (Feem pua)
      2. AC xwm txheej (Lub Hwj Huam Sab Nraud)
    3. Kev xaiv khau raj (Rau FuncGen MCU)

      1. Chaw Teeb
      2. Rov pib dua
      3. Kaw
      4. Ncaj - Rov pib dua nrog hom kev sib txuas ncaj qha
      5. WLAN - Rov pib dua nrog WLAN kev sib txuas hom
    4. Tawm mus rau Cov Ntawv Qhia Tseem Ceeb: Txaus Hais:)

Kauj ruam 10: Xeem

Pom zoo: