Transcription of HC-12WirelessSerialPortCommunicationModule …
1 HC-12 WirelessSerialPortCommunicationModuleUse rManualProductApplication Wirelesssensor Communitybuildingsecurity Robotwirelesscontrol Industrialremotecontrolandtelemetering Automaticdataacquisition Containerinformationmanagement POSsystem Wirelessacquisitionofgasmeterdata Vehiclekeylessentrysystem : 2012/10 ProductFeatures Long-distancewirelesstransmission(1,000m inopenspace/baudrate5,000bpsintheair) Workingfrequencyrange( ,upto100communicationchannels) Maximum100mW(20dBm)transmittingpower(8ge arsofpowercanbeset) Threeworkingmodes,adaptingtodifferentapp licationsituations Built-inMCU,performingcommunicationwithe xternaldevicethroughserialport Thenumberofbytestransmittedunlimitedtoon etime ,multiplechannelscanbeset,withthesteppin gof400 KHz, (20dBm),thereceivingsensitivityis-117dBm atbaudrateof5,000bpsintheair,andthecommu nicationdistanceis1, ,canadoptpatchwelding, 4mm(includingantennacap,excludingspringa ntenna), ,andusercanuseexternalantennaof433 Mfrequencybandthroughcoaxialcable.
2 ThereisalsoanantennasoldereyeANT2inthemo dule, ,anduserdon tneedtoprogramthemoduleseparately,andall transparenttransmissionmodeisonlyrespons ibleforreceivingandsendingserialportdata , , ,FU2andFU3inidlestateis80 a, ,andthemaximumworkingcurrentis100mA(intr ansmittingstate). , , ,anddirectlyinsertitontouser ,andtheirdefinitionsareasshowninthetable below:PinDefinitionI/OdirectionNote1 VCCP owersupplyinput, ,withloadcapacitynotlessthan200mA.(Note: Ifthemoduleisworkingintransmittingstatef oralongtime, ,toavoidheatingofbuilt-inLDOofmodule.)2 GNDC ommonground3 RXDI nput,weakpull-upURAT inputport,TTLlevel;1kresistancehasbeenco nnectedinseriesinside4 TXDO utputURAT outputport,TTLlevel;1kresistancehasbeenc onnectedinseriesinside5 SETI nput,internal10kpull-upresistanceParamet ersettingcontrolpin,validforlowlevel;1kr esistancehasbeenconnectedinseriesinside6 ANTI nput/output433 MHzantennapin7 GNDC ommonground8 GNDC ommonground9 NCNoconnection,usedinfixing,compatiblewi thHC-11modulepinpositionANT1 ANTI nput/outputIPEX20279-001E-03antennasocke tANT2 ANTI nput/output433 MHzspringantennasoldereyePints1-6havetwo bondingpadsrespectively, , ,andcanbedirectlyinsertedontouser (1)Simpleintroductionofworkingpprinciple Asshownintheabovefigure, ,andafterRXDportofleftmodulereceivesthes erialportdata, ,andrestore,fromTXD, ,andtheycannotreceiveandsenddataatthesam etime.
3 (2)SerialporttransparenttransmissionHC-1 2modulehasthreeserialporttransparenttran smissionmodes,expressedwithFU1, , ,andinthismode,thebaudrateinthisaircanbe automaticallyadjustedaccordingtobaudrate ofserialport, , , ,thetransparenttransmissionmode,serialpo rtbaudrate, ,9,600bps(8-dibitdata,nocheck,onestopbit ),CH001( ). ,consideringambientinterferenceandotherf actors,ifthousandsofdatasizeissentcontin uouslyatatime, ,theuppercomputershallhaveresponseandres endingmechanism,toavoidinformationloss.( 3)Threeserialporttransparenttransmission modesWhenHC-12moduleleavesthefactory, ,andtheidlecurrentisaboutMCU,PCandotherd eviceWiredMCU,PCandotherdeviceMCU,PCando therdeviceMCU, ,themodulecanautomaticallyadjustthebaudr ateofwirelesstransmissionintheairaccordi ngtoserialportbaudrate,andthecorrespondi ngrelationshipisasshowninthetablebelow:S erialportbaudrate1,200bps2,400bps4,800bp s9,600bps19,200bps38,400bps57,600bps115, 200bpsBaudrateintheair5,000bps15,000bps5 8,000bps236,000bpsTogetthefarthestcommun icationdistance, ,settheserialportbaudratetobehigh, :Baudrateintheair5,000bps15,000bps58,000 bps236,000bpsWirelessreceivingsensitivit y-117dBm-112dBm-107dBm-100dBmGenerally,e verytimethereceivingsensitivityisreduced by6dB, SET pinofmoduleisatlowlevel,theserialporttra nsparenttransmissionmodecanbesetthroughA Tcommand(seetheintroductioninthefollowin gchapterfordetails).
4 FU1modeisrelativelypowersavingmode, ,themodulecanalsoseteighttypesofserialpo rtbaudrateasshownintheabovetable,buttheb audrateintheairisuniform,250, ,andtheidleworkingcurrentofthismodeisabo ut80 ,themoduleonlysupportsbaudratesof1,200bp s,2,400bpsand4,800bps,andthebaudrateinth eairisuniform,250, , ,whenthemoduleissettobeFU2modeinFU1andFU 3mode,thebaudrateexceeding4,800bpswillbe automaticallyreducedtobe4, ,thesendingtimeintervalofdatapackagecann otbetooshort;otherwise, A16mAAveragevalueTransmissiontimedelay15 -25mS500mS4-80mSSendingonebyteLoopbackte sttimedelay131mSSerialportbaudrate9,600, sendingonebyteLoopbacktesttimedelay231mS Serialportbaudrate9,600,sendingtenbytesN ote:Loopbacktesttimedelaymeanstheduratio nfromthetimeof,afterconductingshortcircu itonTXandRXpinsofonemoduleandsendingseri alportdatatotheothermodule, ,andaftersetting, ,modificationofparametersandfunctionswil lnotbelostincaseofpowerfailure.
5 (1)CommandmodeenteringThefirstwaytoenter :innormaluse(energized),putPin5 SET inlowlevel;Thesecondwaytoenter:disconnec tpowersupply,firstputPin5 Set inlowlevel,andthenenergizeit;Eitherofthe abovetwowayscanmakethemoduleenterATcomma ndmode;releaseit(notputpin SET inlowlevel), , ,themoduleentersATintheserialportformato f9,600,N,1constantly.(2)Commandinstructi on . :Send AT commandtomodule,andthemodulereturns OK . AT+ ,200bps,2,400bps,4,800bps,9,600bps,19,20 0bps,38,400bps,57,600bps,and115, , :Tosetserialportbaudrateofmoduletobe19,2 00bps,firstsend AT+B19200 commandtomodule,andthemodulereturns OK+B19200 . AT+CxxxxChangewirelesscommunicationchann el,optionalfrom001to127(forthewirelessch annelexceeding100,thecommunicationdistan cecannotbeensured).Thedefaultvalueofwire lesschannelis001, , :TosetthemoduletoworkatChannel21,firstse nd AT+C021 commandtothemodule,andthemodulereturns COK+C021.
6 Afterexitingfromthecommandmode,themodule willworkatChannel21, :AsthewirelessreceivingsensitivityofHC-1 2moduleisrelativelyhigh,whentheserialpor tbaudrateisgreaterthan9,600bps, ,600bps,inshort-distance(within10m)commu nication,alsofiveadjacentchannelsshallbe staggeredtouse. AT+FUxChangeserialporttransparenttransmi ssionmodeofmoduleandthreemodesareavailab le,namely,FU1, ,andonlywhenserialporttransparenttransmi ssionmodeoftwomodulesissettobethesame, ,pleaseseetheabove wirelessserialporttransparenttransmissio n . :Send AT+FU1 tomodule,andthemodulereturns AT+0K . AT+PxSettransmittingpowerofmodule,xisopt ionalfrom1to8,andthecorrespondingtransmi ttingpowerofmoduleisasshownbelow:xvalue1 2345678 Transmittingpowerofmodule(dBm)-125811141 720 Thedefaultvalueis8,andthehigherthetransm ittingpoweris, , ,everytimethetransmittingpowerisreducedb y6dB, :Send AT+P5 commandtomodule,andthemodulereturns OK+P5.
7 Afterexitingfromthecommandcode,thetransm ittingpowerofmoduleis+11dBm. AT+RyObtainsingleparameterofmodule,yisan yletteramongB,C,FandP,respectivelyrepres enting:baudrate,communicationchannel,ser ialporttransparenttransmissionmode, :Send AT+RB tomodule,andifthemodulereturns OK+B9600 ,itisinquiredthattheserialportbaudrateof moduleis9, :Send AT+RC commandtomodule,andifthemodulereturns OK+RC001 , :Send AT+RF commandtomodule,andifthemodulereturns OK+FU3 , :Send AT+RP commandtomodule,andifthemodulereturns OK+RP:+20dBm ,itisinquiredthatthetransmittingpowerofm oduleis+20dBm. AT+ ,serialportbaudrate,communicationchannel , :Send AT+RX commandtomodule,andthemodulereturns OK+FU3\r\nOK+B9600\r\nOK+C001\r\nOK+RP:+ 20dBm\r\n .( \r\n meansreturn\newline) AT+UxxxSetdatabits, ,Nmeansnocheck,Omeansoddcheck, ,1meansonestopbit,2meanstwostopbits, :Tosendserialportformattobeeightdatabits ,oddcheck,andonestopbit,pleaseSend AT+U8O1 tomodule,andthemodulereturns OK+U8O1.
8 AT+ :Send AT+V commandtomodule,andthemodulereturns . AT+SLEEPA fterreceivingthecommand,themoduleenterss leepmodeafterexitingfromAT,theworkingcur rentisabout22 A,andthismodedoesn , :Whenwirelessdatatransmissionisnotneeded ,tosavepower,send AT+SLEEP commandtomodule,andthemodulereturns OK+SLEEP .(11)AT+DEFAULTS etserialportbaudrate,communicationchanne l, :Send AT+DEFAULT tomodule,andthemodulereturns OK+DEFAULT , ,600bps,communicationchannelisC001,andse rialporttransparenttransmissionmodeisFU3 .(12)AT+ ,themodulewillnotrespondtocommandanymore , ,pleaseclosetheserialportassistant, ,pleaserefertothefollowing softwareupdate introduction.