Sie sind auf Seite 1von 4

SimpleArduinoMessagingSystem

Why:Iwanttolearnhowtousesimpleintegertostringtypeconversionsandtransmit
thisinformationoveranRF(radiofrequency)linkusingtheopensourceArduino
platform.ThisisimportantbecauseusingRFfordatatransmission,andlearninghowto
convertdatatypesisimportantwhenlearninghowtocodeinC++.Theminimumviable
productwillbeasimplemessagingsystem.TheminimumviableproductiscodethatI
canuploadtotheArduino,andencodedintothecode,therewillbeamessagethatwill
appearontotheLCDscreen.OnceIhavetheminimumviableproductcompleted,Imay
usetheArduinotointerfacetheArduinoserialmonitor,andtransmittingbytes,makingit
easiertouse.IfIcompletethat.IwillmoveontointerfacingaPS/2stylekeyboard,and
transmitwhatItypeonthat,makingitmoreportable.

Who:Iamtheonlypersonthatwillbeneededforthisproject,althoughArduinoisopen
sourceandImayuselibrariesfromtheArduinoplayground(acollectionoflibraries
createdbyotherarduinousers).FortheminimumviableproductIwillbeusingtheLCD
library,whichwasnotcreatedbyanotheruser,butbythecreatorsoftheArduino
themselves.DavidCuartielles,GianlucaMartino,TomIgoe,DavidMellis,andMassimo
BanziarethecreatorsoftheArduino,soIneedtoincludethembecausetheywrotethe
librariesthatIneedtouse.TheyalsocreatedtheopensourceplatformthatIwillbe
using,whichisextremelyimportant.

What:ForthisprojectIwillneedtouse:

AnLCDscreen
TwoArduinoUnoboards
jumpercables
25ohmpotentiometer
Normalsizebreadboard
433MhzRFtransmitterandreceiver
Two12vpowersupplies
Mycomputer

TheLCDscreenisextremelyimportantbecausetheLCDscreendisplaysthemessage
thatIamsendingtothearduino.IwillbeusingatextualLCDscreenbecausethe
graphicalkindofLCDisusedfordisplayingshapes,andforthisprojectIwillbeusing
lettersandnumbers.

ThetwoArduinoUnoboardsarealsoimportantbecausetheArduinoistheobjectthat
willbecommandingothercomponentstotransmitorreceive,orevendisplaydata.I
chosetheUnotypeboardsbecausetheyhavethirteendigitalinputsandoutputs,and
havesixanaloginputs.TheArduinoUnosclockspeedissixteenMhz,whichisgreat
fordatatransmissionbecauseitisreallyfast.

TheMaletomalejumpercablesareimportanttothisprojectbecausetheywillbeused
towireallofthecomponentstothebreadboard.TheLCDscreenwilldependonthe
wiresbecausetheLCDisnotashieldtype.Thetransmitterandreceiverneedhookup
wirestomakedigitalconnectionsandtobepowered.

The25Ohmpotentiometerisimportanttotheprojectbecauseitcreatesvariable
contrastontheLCDscreen,withoutthecontrastknob,thescreenwouldbedarkallof
thetime,nomatterwhatlettersareonthescreen.

Thebreadboardisveryimportanttotheprojectbecausethatletsmeplacecomponents
whereIwantthemtobeplaced,butIdonotneedtosolderanythingwhichletsmesave
sometime.Iamusinganormalsizedbreadboard,becausetheLCDscreenfitsona
normalsizewithroomtospare,also,thelargersizedbreadboardwouldnotbeas
portableasthenormalsizedbreadboard.

The433MhzRFlinkisvitaltotheprojectbecauseitletsmecommunicatethrough
Arduinoswithoutwires.Alsoitteachesmehowtoconvertdatatypessothattheycan
betransmitted.Ichosetousethe433Mhztypeoftransmitterandreceiverpairs,
becausetheycanbecheaperthantheotherversionsofRFlinks,andbecausetheyget
considerablygooddistanceandarerelativelyefficient.

Thetwo12vpowersuppliesareneededinthisprojectbecauseIneedtopowerthe
receiverandtransmittermodules.Thetransmitterhasthemostrangeat12v.The
Arduinosalsoneedapowersupply,buttheycanrunanywherefrom5vto12v,soIwill
beusingbatterypacksforthem.

Mycomputerisnecessaryforthisprojectbecausethatwillbethecomponentthattells
theArduinowhattosendtothereceiver.Mycomputerwillbethecomponentthatwill
holdallofmycode,andwillstoreothervariablesthatwillbeneededforthisproject.

When:IstartedthisprojectJuly10,2014.Iwouldliketobefinishedwiththeminimum
viableproductbyJuly18,2014.WhenIfinishwiththeminimumviableproduct,Iwill

workontheSerialmonitorpartoftheproject.IwanttobefinishedwiththatpartbyJuly
21,2014.
Aftertheserialmonitorpartoftheproject,IwillmoveontothePS/2keyboardpartof
theproject.IwouldliketofinishedwiththatpartoftheprojectbytheendofJuly.

Where:Ineedtwolocationstocompletethisproject.Onelocationisforthetransmitter,
andtheotherlocationisforthereceiver.Iwillusethelivingroomforthereceiver,and
thebasementforthetransmitter,becausethatisareasonabledistanceandelevation
changeforthecorrecttestingofthisproject.

How:IwillbeusingRFtransmissionstosendbytesofdataacrossahouse.Iwilluse
theArduinomicrocontrollersystem,andIwilluseanlcddisplaytoshowthedata.
1. Compiledresearch
a. Informationaboutthereceivermodule
http://vanceance.blogspot.com/2014/01/xymk5varduino.html
b. Compiledresearchonhowcodeshouldbeconstructedwith
VirtualWirelibrary
c. Researchedhowtousethe1602alcdscreen,suchaswiring.
http://www.dreamdealer.nl/tutorials/connecting_a_1602a_lcd_displa
y_and_a_light_sensor_to_arduino_uno.html

2.GatherAllMaterials
IhadtheLCDscreenonhandandtheRFlinksfromthearduinostarterkitfrom
oddwires.Ihadtheusbcablesonhand,andIhadthepowersuppliesalsoon
hand.Ididnthavetopurchaseanythingforthisproject.

3.DocumentADraftDesign
ThedraftdesignforthisprojectistheArduinowithwiressendingandreceiving
datatoeachmodule.TheLCDscreenislocatedonabreadboardwithnormal
spacing,andthespeakerandreceiverwerenotsolidlypinneddown.

4.CodeWritten
//finalversionoftransmitterforthesimplemessagingsystem

#include<VirtualWire.h>

char*controller

voidsetup(){

pinMode(13,OUTPUT)
vw_set_ptt_inverted(true)//
vw_set_tx_pin(12)
vw_setup(4000)//speedofdatatransferbits/sec

controller="hello"
//sendthemessagehello

vw_send((uint8_t*)controller,strlen(controller))
vw_wait_tx()//Waituntilthewholemessageisgone
//sendthemessage

digitalWrite(13,1)
delay(200)
//turnontheled

voidloop(){
digitalWrite(13,0)
//nothingintheloop
//theblankledshowsthatthemessagehasbeensent
}//programend

TestedResults:
Thedeviceworkedwonderfully.Iwasabletosendamessageacrossthehallor
thehousewithmyinvention.Iamexcitedthatitworks,howeveritcandefinitely
beimprovedupon.

Das könnte Ihnen auch gefallen