Invisible Canvas Digital Pen - University Of Illinois ? Invisible Canvas Digital Pen ECE 445 Fall

Download Invisible Canvas Digital Pen - University Of Illinois ? Invisible Canvas Digital Pen ECE 445 Fall

Post on 16-Jun-2018

212 views

Category:

Documents

0 download

TRANSCRIPT

  • InvisibleCanvasDigitalPenECE445Fall2015DesignReview

    PichamonMeteveravongPerutBoribalburephan

    TA:CaraYang

    September29,2015

    -4 Need more details on R/V table, see comments there

    Otherwise, excellent job!56/60

  • TableofContents1Introduction....................................................................................31.1StatementofPurpose....................................................................................31.2Objectives................................................................................................3

    1.2.1Goals&Benefits...............................................................................31.2.2Functions&Features.........................................................................3

    2Design..........................................................................................42.1BlockDiagrams..........................................................................................4

    2.1.1SystemOverview...............................................................................42.1.2Device..........................................................................................42.1.3HostSoftware..................................................................................4

    2.2BlockDescriptions.......................................................................................52.2.1Microcontroller.................................................................................52.2.2PressureSensor...............................................................................62.2.3MotionSensingUnit:Accelerometer&Gyroscope............................................72.2.4Button/Switch................................................................................82.2.5PowerSupplyUnit.............................................................................92.2.6BluetoothTransceiver........................................................................112.2.7StatusLEDs..................................................................................11

    2.3SchematicsofOverallSystem..........................................................................122.4SoftwareFlowchart.....................................................................................13

    2.4.1DeviceSoftware...............................................................................132.4.2DeviceSoftwareFiniteStateMachine.......................................................142.4.3HostServiceSoftware........................................................................142.4.4Front-EndApplication........................................................................15

    2.5SimulationsandCalculations..........................................................................152.5.1SensorResolution............................................................................152.5.2PowerConsumption.........................................................................162.5.3PlaneofWriting,PositionandOrientationDetermination..................................172.5.4ForceCalculation............................................................................20

    3RequirementsandVerification................................................................223.1Requirements&Verifications..........................................................................22

    3.1.1Microcontroller................................................................................223.1.2PressureSensor..............................................................................223.1.3MotionSensingUnit:Accelerometer&Gyroscope...........................................223.1.4Button/Switch...............................................................................233.1.5PowerSupplyUnit............................................................................233.1.6BluetoothTransceiver.......................................................................243.1.7StatusLEDs..................................................................................24

    3.2ToleranceAnalysis.....................................................................................243.3Safety...................................................................................................253.4EthicalIssues...........................................................................................26

    1

  • 4CostandSchedule.............................................................................274.1CostAnalysis............................................................................................27

    4.1.1Labor..........................................................................................274.1.2Parts..........................................................................................274.1.3GrandTotal...................................................................................27

    4.2Schedule...............................................................................................28

    5References....................................................................................29

    2

  • 1Introduction

    1.1StatementofPurpose

    Theprojectgoalistodevelopadigitalpenthatcandefineanyflatsurfaceofarbitrarysizeasacanvasanddigitallydrawonit.Thiseffectivelyturnsaspatialspaceintoatemporarydigitalworkspacewithminimaldependency.

    Thestylusallowsusertodefinethesizeofthecanvasandisabletorecorddrawingsessionsevenunconnectedtohost.Pencilleadwillalsobeappendedtothetipofstylustodisplaythedrawingandprovideuserfeedbackonthecanvaschosen.Thecalculationsforposition,pressure,errorcompensation,andcanvasspacedefinitionwillbedonein-house.Weexpecttoprovidepowerusinghard-wiredvoltagesupply,andthenchangetomicro-USBrechargeablebatterylater.Theplug-and-play,draw-on-any-surfacedesignallowsformanycreativeuses,suchasinalectureroomwherelecturersandstudentscancollaborateinagraphicaldiscussionwithouthavingtowalkuptotheblackboard.

    Ourprojectfixestheproblemofhavingascreentoosmalltodrawonortoachievedesiredlevelofdetail.Additionally,usingastylusorafingerfordrawingmayblocktheviewofthewholeimage,butusingthispen,youwillbeabletocollaboratewithothersonatouchscreenwithoutunexpectedtouchtriggersandblocking.Hence,theinvisiblecanvasdigitalpencanbeavaluableplatformforapplicationsthatrequiresharinginteractionamongusers.1.2Objectives

    1.2.1Goals&Benefits:

    Eliminatestheneedofreceiving-endhardware Setupofcanvasdimensionistransparenttothehost Allowscollaborativesharingofinformation/drawings Minimaldependency

    1.2.2Functions&Features:

    (x,y,z,r,p,y)locationsensor Userfeedbackoncanvasshownbyattachedpencillead Buttonsforcanvasdefinition Switchforturningon/offcircuit Pressuresensor Lightweight Auto-Calibration Balanceddesignforportability Bluetoothmoduleforintercommunications Micro-USBrechargeablebattery

    3

  • 2Design2.1BlockDiagrams2.1.1SystemOverview

    Figure1.Top-LevelSystemBlockDiagram

    2.1.2Device

    Figure2 .DeviceBlockDiagram2.1.3HostSoftware

    Figure3 .BlockDiagramforHost-SideSystemSetup

    4

  • 2.2BlockDescriptions

    2.2.1Microcontroller(ATmega328P-PU)Input:1.8-5.5Vpowerinput,3-axisaccelerationandangularvelocitydata,voltagemeasurementforforce,buttonsandswitchstatusbitsOutput:Commandstoread/write3-axisdata,commandstotransmitpositionandpressureoverserialbluetoothdataThisunitpollstheaccelerationandorientationdatafromMPU-60503-AxisAccelerometerthroughI2Cinterface(SCLandSDApins),measuresanalogvoltagefromananalogGPIOpinconnectedtoaForceSensitiveResistor(FSR),andreadsfromdigitalGPIOpinsforswitchandbuttonstates.Theacquiredmeasurementsarethenprocessedtoyieldappropriatevaluestobesentwirelesslytothehost(HC-05bluetoothmodule).DataprocessingmodelsarediscussedfurtherinSimulationsandCalculationssection.TheATmega328microcontrollerwillbepoweredbya+3Vsourceregulatedbya+3.7Vbatteryandintegratedwiththeaccelerator,FSR,switches,andbluetoothmoduleonaPCB.ApinlayoutsummaryoftheseinterfacesisshowninFigure4:

    Figure4 .ATmega328interfacestoothercomponents

    5

  • Pin Function Connection

    1 RESETsignal,activehigh toresetbutton

    2 RXD,serialreceive toTXDofHC-05BTmodule

    3 TXD,serialsend toRXDofHC-05BTmodule

    7,20 VCC/AVCC,digital/analogvoltagesupply toregulatedsupply(+3V)

    8,22 GND,ground togroundsupply

    9 XTAL1,externalclockinput1 tooscillator

    10 XTAL2,externalclockinput2 tooscillator

    15 PB1,digitalGPIOpin todebugbutton

    18 PB4,digitalGPIOpin topencontrolbutton

    21 AREF,analogreferencevoltage(topofinputvoltagerange)

    toregulatedsupply(+3V)

    23 ADC0,analogpin toforcesensorcircuit

    27 SDA,I2Cdataline toSDAofMC3410

    28 SCL,I2Cclockline toSCLofMC3410

    Table1.PinconnectionfortheATmega328toothercomponents

    2.2.2PressureSensor(ForceSensitiveResistor)Input:PhysicalforceonsensorOutput:ResistancechangeofthesensorcomponentThepressuresensorisaForceSensitiveResistor(FSR)whoseresistancechangesbasedonappliedpressure.Thecomponentwillbeconnectedseriallytoa10kresistortotheground,allowingtheresistanceoftheFSRtobecalculatedbasedonthevoltagemeasuredfromthejunctionusingthevoltagedividerrule.ThedebugandpencontrolbuttonswillbeimplementedalongwiththeFSRcircuit,asshowninFigure5.ForcecalculationfromjunctionvoltagewillbefurtherdiscussedinSimulationsandCalculationssection.

    Figure5 .FSRcircuitandpushbuttonsschematic

    6

  • 2.2.3Accelerometer(MPU-6050Module3-AxisGyroscope+Accelerometer)Input:PhysicalmovementandorientationofthesensorchipOutput:DigitalaccelerationandorientationdatathroughI2CdatalineTheMPU-6050isalow-noise,integrateddigitaloutput3-axisgyroscope+accelerometer.ThisunitwillbeassembledonPCBwithmicrocontroller,wirelesstransmitter,andpowersupply.Inthisproject,wewillneedtodetectthesufficientrangesof2gforaccelerometer.Theavailablerangeofgyroscopeisfrom250-2000degree/sec.Thesampleratecanbesetto1024samples/secondandthelowpassfilterisprogrammablefrom8to512Hzbandwidth.Theoutputdatawillbedigitizedinto16bitsandfeedintomicrocontrollerviaI2Ccommunicationprotocol.ApinfunctionandconnectionsummaryisshownbelowinTable2.

    Pin Function Connection

    6 AUX_DA(I2CMasterserialdata) Toexternalsensors

    7 AUX_CL(I2CMasterserialclock) Toexternalsensors

    8 VLOGIC 1.71VtoVDD

    9 AD0 I2CSlaveaddressLSB

    12 INT(Interruptdigitaloutput) Totempoleoropen-drain

    13 VDD Topowersupply

    18 GND ToGround

    23 SCL TomicrocontrollerSCL

    24 SDA TomicrocontrollerSDA

    Table2.PinconnectionfortheMPU-6050

    Figure6.MotionSensingUnit

    7

  • Figure7 .MPU-60503-Axisgyroscope+accelerometerschematic

    2.2.4Buttons/Switch

    Input:PhysicalbuttonandswitchtriggersOutput:DigitalsignaltoATmega328GPIOpinsonthemicrocontroller

    Buttonsandswitchcomponentsserveasactiveuserinputofthisdevice.SwitchTheswitchisanon/offswitchofthewholecircuit.Whentheswitchisheldforafewseconds,the

    circuitwillpoweroff.

    ResetButton(toATmega328pin1)TheresetbuttonresetsATmega328microcontrollerthroughanactive-highresetpin.

    PenFunctionButton(toATmega328pin15)Eachpressonthisbuttontogglesoperationmodeofthedevice,consistingofcanvasdefinitionmode

    anddrawingmode.Whenondrawingmode,themovementofthedevicewillbeprocessedandsentto

    thehost.Whileincanvasmode,thedevicewillappearasstationarytothehost(i.e.themostrecent

    datawhileondrawingmodeisrepeatedlysenttothehostwithpressuredataoverwrittento0).

    DebugButton(toATmega328pin16)Thedebugbuttontriggersasoftwareroutineimplementedinamicrocontroller.Thiswillbeusedto

    triggerusefulblinkpatternsfordebugging,andisdesignedtobeanoptionalbutton.

    8

  • 2.2.5PowerSupplyUnitInput:Rechargeable+3.7VLi-PolyBatteryOutput:+3.3V5%forMPU-60503-AxisGyroscope+Accelerometer

    +3.3V 5%forATmega328Microcontroller+3.3V 5%forHC-05WirelessBluetoothmodule

    Ourpenreceivespowerinputfromthe+3.7Vbattery.However,+3.7Vishigherthanthevoltageneededforsomemodules,soresistorswillbeincludedinthepowermoduletopulldown+3.7Vtootherusefulvoltages,inordertosupplypowertothemicrocontroller,wirelesstransceiver,andaccelerometer.Additionally,moreresistorswillbeaddedasneededtoensurethecurrentthroughtheFSRdoesnotexceed+1mA.ThepowerrequirementsforallthecomponentsfromthedeviceareshownbelowinTable3:

    Devices Voltage/CurrentRequirements

    MPU-60503-AxisGyroscope+Accelerometer VDD:2.375-3.46VVLOGIC:1.8VorVDD

    ATmega328P-PUMicrocontroller MaxVoltage:+3.3Vor+5V

    30ftWirelessRFTransceiverBluetooth MaxVoltage:+3.3Vinput

    RoundForce-SensitiveResistor(FSR)-Interlink402 MaxCurrentDensity:1mA/cm2MiniPushButtonSwitch Max:50mA,24VDC

    LP2953Low-DropoutVoltageRegulator InputVoltage)Max:+30V,Min:-20VOutputVoltage)Max:+29V,Min:+1.23VFixedOutput)Options:+3.3V,+5V

    LithiumIonPolymer(Li-Poly)Battery OutputVoltage:+3.7V

    Table3.PowerRequirementsforallcomponentsfromthedeviceTherechargeablebatteryrequires+3.7Vtocharge.Alinearregulatorwillbeusedtoprovidethereferencevoltageat+3.3V,asshownbelowinFigure8.

    Figure8.PowerModuleBlockDiagram

    9

  • Thelinearregulatorforcesafixedvoltagetoappearattheregulatoroutputterminal.Theoutput

    voltageiscontrolledbyafeedbackloop.LDO(Low-Dropout)regulatorischosenspecificallyforour

    projectduetoitscompatibilitywithbattery-poweredapplications.NotonlythatLDOregulatorsutilize

    availableinputvoltagemorefully,buttheyalsoreducepowerdissipationandhenceimprovecost

    savings.

    LP2953isamicropowervoltageregulatorsthatgiveverylowdropoutvoltage.Ithastwofixedoutput

    options,+3.3Vand+5V,which+3.3Vwillbeusedforourcircuitdesign.Alongwiththepowersupply,

    thelinearregulatorwillbesufficienttosupply+3.3Vforothercomponents,suchastheBluetooth

    moduleandmicrocontroller.

    Figure9.LP2952LinearRegulatorschematic

    Pin Function Connection

    1,8,9,16 GND,Ground togroundsupply

    2,7,10,11 NC,noconnections -

    3 OUT,regulatedoutputvoltage toothercomponentsasVCC,

    connecttoSENSEandcapacitor

    toground

    4 SENSE,feedbackvoltagesenseinput connecttoOUTandcapacitorto

    ground

    13 VTAP,internalresistordividerinput shorttoFEE

    14 FB,erroramplifiernoninvertinginput shorttoVTAP

    15 IN,regulatorpowerinput tobattery

    Table4.Pinconnectionfor LP2952LinearRegulator

    10

  • 2.2.6BluetoothTransceiverInput:+1.8V5%powersupply,pre-processedcanvaspositionandactionsfromthemicrocontrollerOutput:datatransmittedtohostdevice(bluetoothprotocol)TheserialportBluetoothmodulates3Mbpsenhanceddataratewithcomplete2.4GHzradiotransceiverandbaseband.

    PINName PIN PadType Description

    GND 13,21,22 VSS Groundpot

    3.3VCC 12 3.3VCC Integrated3.3Vsupplywithon-chiplinearregulatoroutputwithin3.15-3.3V

    AIO0,AIO1 9,10 Bi-Directional Programmableinput/outputline

    PIO0,PIO1 23,24 Bi-DirectionalRXEN(23)/TXEN(24)

    Programmableinput/outputline,controloutputforLNA(23)/PA(24)(iffitted)

    Table5.PinconnectionsforHC-05bluetoothtransceiver

    Figure10 .HC-05BluetoothTransceiverschematic

    2.2.7StatusLEDs

    Input:Signalsfrombutton/switchOutput:TwoLEDlights,DigitalsignalstoATmega328microcontrollerGreenLED(LEDG,toATmega328pin12)ThisLEDindicatesthatthedataissuccessfullybeingtransmittedtothehostdeviceviaBluetooth.IneachtransmissioneventtheLEDwillblinkonce.OrangeLED(LEDO,toATmega328pin13)ThisLEDindicatesthattheuserisactivatingthepentobeinadrawingmode.Thisiscontrolleddirectlybythemicrocontrollerandthebutton/switchintegratedintothecircuit.

    11

  • 2.3SchematicsofOverallSystem

    Figure11 .CircuitSchematic

    12

  • 2.4SoftwareFlowchart2.4.1.DeviceSoftware

    Figure12 .Top-LevelDeviceSoftwareAlgorithm

    13

  • 2.4.2DeviceSoftwareFiniteStateMachine

    ThisfiguredemonstratesthelogicintheActionblockshowninFigure12.

    Figure13 .FiniteStateMachineofthedevice

    2.4.3HostServiceSoftware

    Figure14 .HostServiceSoftwareFlowchart

    14

  • 2.4.4Front-EndApplication

    Figure15 .Front-EndApplicationflowchart

    2.5SimulationsandCalculations 2.5.1SensorResolution

    AccelerationTheaccelerometersensorprovides16-bitresolutionfor2g,4g,8greadingranges.Therange2gischosenasthemagnituderangeissufficientforstylususageanditalsoprovidesthesmallest

    granularityamongallpossibleranges.

    ForceTheforce-sensitiveresistorprovidescontinuousandsmoothanalogjunctionvoltage.However,

    informationislostduetoconversiontodigitalrange.Themicrocontrollerconvertsthevoltagefrom

    range0toVreftounsignedintegerfrom0to1023,sinceVref is3.3V,thefinestvoltageunitthatcanbe

    measuredis

    3.3/1024=3.22mVperunit

    Sincetherelationshipbetweenvoltageandforceappliedisnonlinear,asdiscussedinsection2.5.4,

    eachvoltageincrementcorrespondstoalargerforceincrementthethepreviousincrement.

    Thediscretesamplingofdataleadstoanotherdesigndecision.Theforcevaluescanbestoredinflash

    memoryasatablewith1024entriesofpre-calculatedvalues,usingtheunsignedintegerrangeas

    tableindex.ThissimplifiesarelativelylongcalculationtoamemoryloadandsavesSRAMspaceatan

    expenseofflashmemory.Additionally,themicrocontrollerhasmorelimitedSRAMspace(2KB)flash

    memoryspace(32KB,with2KBusedforbootloader).

    15

  • 2.5.2PowerConsumptionBattery:Nominalvoltageprovides3.75V

    PowerCapacity[Wh]:VoltagethatbatteryprovidesxCurrentitprovidesduringthetimeitisproviding

    Capacity:1.2Ahxnominalvoltage=1.2x3.75=4.5Wh PowerCapability[C]:A-hr/1hr ForLi-Polybattery,1200mAh=1.2Ah,henceC=1.2A

    Battery Power

    Li-PolyBattery +1200mAh

    Load Voltage Current(ActiveMode)

    Current(SleepMode)

    PowerConsumption(ActiveMode)

    PowerConsumption(SleepMode)

    Microcontroller(15

    pins)

    +1.8V +0.2mA +0.1uA +0.2mA*15=+3mA +0.1uA*15=

    +1.5uA

    LED(2) +1.8-2.2V +18mA/part +0mA +18mA*2=+36mA +0mA

    Force-Sensitive

    Resistor

    about+1.8V

    assuming

    0.25Nforce,

    25Kresistance

    +1mA/cm2(max)

    +0.18mAthrough

    FSR+R

    +0mA/cm2 +1mAperpress

    (max)

    +0.18mAassuming

    0.25Nforce,25 Kresistance

    +0mA

    EIOButton +24V(max) +50mA(max) +0mA +50mA(max) +0mA

    LDORegulator +3.3V +19mA +170uA +19mA +170uA

    BluetoothModule +1.8V +30mA +0mA +30mA +0mA

    Accelerometer+

    Gyroscope

    +1.8V +500uA+3.6mA +10uA+5uA +4.1mA +15uA

    Total +143.1mA +186.5uA

    Table6.Batteryandloadpowersummary.

    Totalpowerinput(OneLi-PolyBattery):+1200mAh

    Assumingworstcasepossible,totalloadcurrent:

    ActiveMode:(3+36+1+50+19+30+4.1)mA=+143.1mA SleepMode:(1.5+0+0+0+170+0+15)uA=+186.5uA 30:70Mode(assuming30%activestate70%sleepstateasanestimatedtypicalusage):

    (+143.1mA)*0.3+(+186.5*10^-3)*0.7=+43.06mA

    Calculationshaveshownthatthebatterystillprovidessufficientpowerforthecircuitdespite

    assumingmaximumpossiblepowerconsumedbycomponents.

    Standarddischargecurrent:0.5C5A=0.6A=+600mA1200mAh/600mA=2hoursStandardchargecurrent:0.2C5A=0.24A=+240mA1200mAh/240mA=5hoursTimeforUsage :1200mAh/(143.1mA+600mA)=1.61hoursTimeforStandby:1200mAh/(186.5uA+600mA)=2hours

    16

  • 2.5.3PlaneofWriting,PositionandOrientationDetermination

    PlaneofWriting

    Theplaneofwritingisdefinedtobeaflatrectangularsurfacewithfrontsideandbackside.The

    styluswillonlyregisterwritegesturestothefrontside.Tobeabletouniquelyidentifytheplaneofwriting,weneed:

    DuringCalibration

    a. Threepointsofreferencewhichwilllieonthesameplane.Thisistheminimumnumberof

    pointsrequiredtouniquelyidentifyaplane.

    b. Theorientationofthestylusatthetimethethreepointsofreferencearedefined.Thisisused

    todeterminewhethertheplaneshouldbewrittenfromunderoroverthesurface.Thesurface

    normalwillbesetduringcalibrationtobeperpendiculartothesurface,so s=v1xv 2.Thesign

    forthecalculationwillbechosensothatsTp

  • PositionandOrientationCalculation

    Figure16.Stylusorientation

    WithorientationasshowninFigure16,wehavethatanaccelerometerexperiencesbothgravitational

    accelerationandnetlinearaccelerationdonebytheenvironment.Thevalueofgdoesnotfluctuatequicklycomparedtolinearaccelerationa,thereforewecanextractlinearaccelerationfromgravitationalaccelerationusingahigh-passfilter[9](andconverselyextractgravitational

    accelerationusinglow-passfilter)e.g.

    wherexn=g n+anisasampledaccelerationvectorthatcombinesbothgravityandlinearcomponents.

    Oncewehavethepredictedacceleration,wesenditthroughthecorrectionunitalongwithabsolute

    positionthemicrocontrollerhastrackedsofar.

    Correction

    Measuredvaluesforpositionandorientationdependontheabsolutepositionitself,theorientation,

    therateofchangeofthosetwoparameters,andhigherderivatives,andsoon.Samplingthedatainto

    digitalformisthemainsourceoftheerrorasittruncatestheprecisionofthemeasurements(or,

    fromanotherpointofview,generatesalias).Extendeduseofthemeasurementswithouterror

    correctionwillaccumulatetheerrorupsignificantly.B.Deepaketal.[3]hasapproachedthisproblem

    usingasupporterrormachine(SVM)asamodelforerrorcompensationcharacterization.Thework

    achievedhighercorrectionaccuracycomparedtotheconventionalerrormodelingapproach.

    Inthissystem,theerrorcorrectionalgorithmwillbeimplementedusingasubsetofartificialneural

    network(ANN),calledperceptron.Perceptronisafeedforwardneuralnetwork;therearenofeedback

    connectionsandtheactivationsignalsalwayspropagateforwardtodeeperlayers.Theaccumulation

    ofsignalswillbetestedagainstathreshold(orbiasvalue,denoted b),togenerateanoutputaccordingtoacertainkernelfunction f .Inmostneurons,asigmoidfunctionisused.

    18

  • Figure17 .Thecalculationofoutputvalueofoneneuroninaneuralnetwork

    Aneuralnetworksoutputcanbethoughtofasatransformationoffeature(input)vector,whichisa

    memberoffeaturespace,intoamemberofoutputspace.Afterthesystemhasbeentestedwitha

    trainingset(asetofpairsofinputandexpectedoutput),theweightparameters(w)canbeadjusted

    accordinglyusingtrainingalgorithmssuchasbackpropagation[10]coupledwithgradientdescentor

    geneticevolutionsothatfutureoutputsofthesystemwillmatchmorecloselytotheexpectedoutput.

    Inthisapplication,wepreparethetrainingdatabyattachingcarbonpiecerigidlytotheaccelerometer

    andtestonpapersothatthetrajectoryofthedrawingisleftonthepaper.Thephysicalmeasurement

    ofthedisplacementcanbedoneeasilyfromthecarbontrace.Then,thephysicaldata(expected

    output)ispairedmanuallytotheinstantaneousparameterestimates(x,y,z,roll,pitch,yaw)collected

    digitallywhilethecarbontracewasbeingdrawn.Thenetworkwillhaveoneinputlayerforthedigital

    measurementsandtheirdifferentialchange,onehiddenlayer,andoutputscorrectionsforthe

    differentialchanges.Theinitiallayersizeswillbe12x6x3 ,frominputlayertooutputlayerrespectively.However,theresultsofthisstructuremaypresentunderfitoroverfitproblems,whichsuggeststhe

    restructuringoftheneuralnetworklayersandparameterspacefortheinputvalues.

    19

  • 2.5.4ForceCalculation

    Figure18.ResistanceofForceSensitiveResistor(FSR)withrespecttoforceapplied

    Figure19 .FSRconfigurationFromFigure18,thecorrelationbetweenappliedforceandFSRsresistanceispiecewiseexponential,

    thatisforeachintervalofresistance [a,b] ,andforceapplied F,FSRfollowstherelationship

    FromtheconfigurationshowninFigure19,thevoltagedividerruleonFSRandR(10kOhm)gives

    sowecanapproximatetheforceappliedonthesensor;thelogarithmicvalueoftheforceissufficient

    forthispurpose:

    20

  • Force(N) FSRResistance (FSR+R) CurrentthruFSR+R(mA) VoltageacrossR(V)None Infinite Infinite 0 0

    0.2 30K 40K 0.0825 0.861 6K 16K 0.2062 2.0510 1K 11K 0.2999 2.99100 250 10.25K 0.3252 3.23

    Table6.ExampleVoltageoutputatknownFSRforceandresistance

    ConstantsforF-FSRRelationship

    a(k) b(k) A B0.1 30 -0.78377 2.1397

    30 infinity -5.1918 -4.9546

    Table7.Regressionresultsforln(F)-ln(FSR)relationship

    Figure20.FSRVoltagetoForcetranslation

    21

  • 3RequirementsandVerification3.1Requirements&Verification3.1.1Microcontroller[20Points]

    Requirements Verifications

    1) WhenmountedtoPCB,themicrocontrollershouldprogramtheBluetoothmoduletotransmitdataatabaudrateof115200.

    2) Thedataformatshouldbedefinedas:byte0:STXbyte1:commandcharacterbyte2to2+(N-1):commandparametersbyte2+N:ETX

    1) Runtwocodes:ArduinoISPandPen27(codecontainingactualfunctionsofmicrocontroller),viaArduinoontomicrocontrollerandburnbootloader.ConnectthemicrocontrollertothesolderedPCB.Thehostprogramshouldbeabletoreadthedataatarateof115200(canbedisplayedonhostprogram).

    2) Verifywithhostprogrambyexaminingwhethertheformatofdatapacketarrivesaccordinglytotheformatdefined.

    3.1.2PressureSensor [15Points]

    Requirements Verifications

    1) Pressurelevelmustbeshownonscreentovaryaccordinglywithdifferentamountofforceapplied.Pressuremeasurementsmustbealignedwithforcemeasuredbydifferentdisplacementsofanelasticspringwithanaccuracyof10%.

    1) PlaceawoodblockbetweenFSRandelasticspringtomeasuredisplacementvs.force(hencepressure).MeasurethevoltageateachlevelofforcethenplotagraphofForcevs.Voltagefromdataobtained.AtrendsimilartographshowninFigure20shouldbepresent,witherrorvalueslessthan5%.

    3.1.3MotionSensingUnit:Accelerometer&Gyroscope[15Points]

    Requirements Verifications

    1) Detectsthemotionaccordingtothemovementofthepen.Canvasmustbedisplayedwithsoftwareandthestylusshouldbeassignedto(x,y,z)coordinates,whichdependontherelativepositionoftheuser-controlledpenlocationwithanaccuracyof10%.

    2) Detectsrotationalmovementwithatmost360degreepersecondwithanaccuracyof10%

    3) Detectslinearaccelerationof2gwithanaccuracyof10%.

    1) Motionofthepentipshouldbedisplayedonsoftwareprogramtoseeifitmovescorrespondinglytotheactualmovement.Comparethedisplayedcoordinatesofthewholepenrelativetomovement.Thecornersofcanvasmustbecorrectlydefinedaccordingto3buttonspressed.

    2) Comparemeasurementsobtainedfromsoftwarerelativetosensordataacquiredandanglesmeasuredusingaprotractor.

    3) Comparemeasurementsobtainedfromsoftwarerelativetosensordataacquired.

    22

    Break out ALL verification blocks into much more detail, as if you were writing instructions for someone else to do the testing, i.e. "...probe at __, measure width of square pulse at __V crossings with oscilloscope."

    More Reqs needed for micro. What about processing delay? What maximum latency will you tolerate before the user notices? How much onboard memory do you need? How much external mem?

    How do you know the "right" pressure level and how accurate your pressure sensor readings are?

  • 3.1.4Buttons [10Points]Requirements Verifications

    Button :1) Buttonsshouldbedebouncedandallows

    onlyoneregisterinputperpress.

    2) Checktomakesurethatpenfunctionbuttonpressestriggersmicrocontrollerfinitestatemachinetransitions.

    Button:1) Voltagemeasuredfromthepinconnected

    tothebuttonbehavesasdigitalactive-lowsignalwhenbuttonsarepressedorreleased(pressed=LOW,released=HIGH).

    2) CheckonthehostdevicedisplaywhetheralineisbeingdrawnaccordinglywhenthepenfunctionbuttonispresseduptotheCollectstate(3times).

    3.1.5PowerSupplyUnit [15Points]

    Requirements Verifications

    Li-PolyBattery:1) Supply+3.7V5%powerat200uAdrawon

    thePCB.

    2) Lifetimeofthepenshouldbeapproximately1hour37minutesassumingfull-timeusageand2hoursduringstandby.

    LinearRegulator :

    1) Voltagemustberegulatedto+3.3V5%at170uAdrawasrequiredforspecificcomponents.

    Li-PolyBattery:1) Amultimeterwillbeusedtocheckifthe

    voltageandcurrentoutputsareequaltospecifiedvalues.Useanoscilloscopetocheckifthevoltagesignalissteady.

    2) Measurethelifetimeofthependuringactiveusageandduringstandby.Seeifthemeasurementsarecloseorlastlongerthanthecalculatedvalues.(Thelongeritlasts,thebetter).

    LinearRegulator :

    1) Connectmultimeterandoscilloscopeacrossthelinearregulatortomeasureifthepotentialdifferenceiswithinspecifiedrange.Itisalsoagoodpracticetocheckthecurrentwhetheritiscloseto170uAaswell.

    3.1.6BluetoothTransceiver[15Points]

    Requirements Verifications

    1) ModuleneedstobeimplementedwithorangeLEDasanindicator.

    2) Usethealgorithmswesetuptotransferdatatothehostdevice.

    1) Ifdataissuccessfullybeingtransmittedtothehostdevice,theorangeLEDclosetocrystaloscillatoriscorrectlylitup.

    2) Thereceivingendreceivesdatainthecorrectformat.

    23

    Should be verifying debounced signal vs. jumpy input signal with a oscope.

  • 3.1.7StatusLEDs [10Points]Requirements Verifications

    Indicatesapressedbutton :1) Microcontroller,button,switch,andFSR

    mustallbeintegratedinordertoenable

    functionalityofstatusLEDs.

    IndicatesBluetoothon:2) Microcontroller,button,switch,and

    Bluetoothmustallbeintegratedinorder

    toenablefunctionalityofstatusLEDs.

    Indicatesapressedbutton:1) OrangeLED(right)islitupwhenthebutton

    ispressedbyauser.

    IndicatesBluetoothon:2) AnotherorangeLED(left-closertocrystal

    oscillator)islitupwhenthedatais

    successfullybeingtransferredviaBluetooth.

    3.2ToleranceAnalysisThecriticalpartofthedesignistheaccelerometersensormodule.IftheI2Caccelerometersensor

    failstostoreimmediatedatatotheregisterinterfacecorrectlyforthemicrocontrollertofetch,then

    errorswillpropagatetotheerrorcorrectionalgorithm.Let pbetheprobabilitythattherewillbeabiterrorinasinglebit,thenP,theprobabilitythatthe14-bitx3accelerationvalueswillcontainerrorwillbe(frompacketerrorratiocalculation[11]withn=42)

    P=1-(1-p)42

    Figure21.dataerrorofonedatasetTheprobability Pgrowsinhighorderwithrespectto p,butpinrealityisverylow,thereforeat p ~0wecanestimatethat

    P=42p

    ThereforetheexpectedvaluefornumberoferrorspersecondisKP-1whereK isthenumberofsamplestakenpersecond.Theerrormayoccurinanyofthe14bitsofeachaxis,sotheexpectedvalueofthe

    erroronceitoccursis,assumingindependenceofthebits,

    E[ax,err]=E[ay,err]=E[az,err]=sum(2i,i=0to13)/14=(214-1)/14=1170%E[a]=1170/214~7%error

    24

  • SincethenumberoferrorsthatcannotbeavoidedbycorrectionsoftwareisKP-1persecond,theaveragedriftduetoerroris0.07KP-1persecondatandthemaximumaccumulatederrorafterTsecondsisexpectedtobe[(1+0.07KP-1)T/ln(T)]-1.Fromthedesign,weexpectthisvaluetobewithin5%bound(0.05).Aftersometime kTthepercenterrorwillexceed5%assumingweusethedatafromabigtimewindowtocorrectcurrentdata,thereforeatimeoutisneededforanydatausedforprocessing

    andshouldbediscardedasthetimeexpires.Notethattheactualspatialerrorislowerthanthestated

    boundsbecausetheinterpretedvaluefortheaccelerationreadingsaresignedvalues,notunsigned,

    meaningthatthenetdrifterroraccumulatedoverausageonthesamesurfaceofarandomuserwith

    randommovementwouldresultinaverysmallaccumulatederror(accumulatederroramplifyfuture

    errorislow,buterrorstillexistsasderivedinthissection).

    3.3SafetyTheinvisiblecanvasdigitalpenhaslowpowerconsumptionoverall,hencethereareonlyfewparts

    thatcanbeharmful.However,ourprojectreliesheavilyonLi-Polybatteryandwewillbe

    charging/dischargingthebatterymanytimes.Therefore,thosefollowingfactorsareimportantand

    mustbeconsideredatalltimes:

    Donotchargebatteriesabovetheirmaximumsafevoltage(+4.2V) Donotdischargebatteriesbelowtheirminimumsafevoltage(+3.0V) Donotdrawmorecurrentthanthebatterycanprovide(1-2C) Donotchargethemwithmorecurrentthanthebatterycantake(~1C) Donotchargebatteriesaboveorbelowcertaintemperatures(usually0-50degreesC) Donotshortcircuitthebattery(avoidconnectingpositiveandnegativeterminalstoeach

    otherwithconductivematerials)

    Donotimmersethebatteryinwaterorliquids.Keeporstoreitinacoolanddryplace Makesurethebatteryisnotinstalledinreversepolarity Donotleavebatteryinahightemperatureenvironment.Itcouldleadtooverheatingofbattery

    and/orexplosionorfire.

    Donotusebatteryinanenvironmentwithhighstatic-electricityormagneticfields Priortousage,thebatteriesshouldbeinspectedfordeformitiesandpotentialfailure NiMH/NiCad/lead-acidchargershouldnotbeused

    Furthermore,allmembersoftheteamhavecompletedthelabsafetytrainingbeforeengagingwith

    anylabwork.Thetrainingscompletedincludebothgenerallaboratorysafetytrainingandelectrical

    safetytraining.

    25

  • 3.4EthicalIssuesOurprojectfollowsIEEEcodesofethicsasfollowing:

    [1]Toacceptresponsibilityinmakingdecisionsconsistentwiththesafety,health,andwelfare

    ofthepublic,andtodisclosepromptlyfactorsthatmightendangerthepublicortheenvironment.

    [3]Tobehonestandrealisticinstatingclaimsorestimatesbasedonavailabledata.

    [5]Toimprovetheunderstandingoftechnology;itsappropriateapplication,andpotential

    consequences.

    [6]Tomaintainandimproveourtechnicalcompetenceandtoundertaketechnologicaltasks

    forothersonlyifqualifiedbytrainingorexperience,orafterfulldisclosureofpertinentlimitations.

    [7]Toseek,accept,andofferhonestcriticismoftechnicalwork,toacknowledgeandcorrect

    errors,andtocreditproperlythecontributionsofothers.

    [9]Toavoidinjuringothers,theirproperty,reputation,oremploymentbyfalseormalicious

    action.

    [10]Toassistcolleaguesandco-workersintheirprofessionaldevelopmentandtosupport

    theminfollowingthiscodeofethics.

    26

  • 4CostandSchedule

    4.1CostAnalysis

    4.1.1Labor

    Name HourlyRate Hours Total Totalx2.5

    PichamonMeteveravong $30 300 $9000 $22500

    PerutBoribalburephan $30 300 $9000 $22500

    Total $45000

    Table8.LaborCosts

    4.1.2Parts

    Description Quantity Manufacturer Vendor Cost/unit TotalCost

    ATmega328P-PUwitharduinobootloader

    2 Atmel Amazon $6.35 $12.70

    USBLiPolyCharger 1 Microchip Adafruit $6.95 $6.95

    Li-PolyBatterywithJST-PHCable 1 HunanSounddonNewEnergyCo.Ltd.

    Adafruit $9.95 $9.95

    30ftWirelessBluetoothRFTransceiverModuleSerialRS232TTLHC-05forArduino

    1 Sunkey Amazon $8.89 $8.89

    MPU-60503-AxisGyroscope+Accelerometer

    1 InvenSense Amazon $5.00 $5.00

    RoundForce-SensitiveResistor(FSR)-Interlink402

    2 InterlinkElectronics

    Adafruit $7.00 $14.00

    StylusHardwareContainer 1 $10.00

    MiniPushButtonSwitch 2 TEConnectivity SparkFun $0.35 $0.70

    LP2953AdjustableMicropowerLow-DropoutVoltageRegulator

    1 TexasInstruments TexasInstruments

    $11.58 $11.58

    CrystalOscillator 3 VishayDale Mouser $0.49 $0.49

    Total $70.16

    Table9.ComponentCosts

    4.1.3GrandTotal

    Section Total

    Labor $45000

    Parts $70.16

    GrandTotal $45070.16

    Table10.GrandTotalCost(Labor+Parts)

    27

  • 4.2Schedule

    Week Task Responsibility

    09/14/15 ProjectProposalsDue All

    Finalizeprojectproposal Pichamon

    Preparemockdesignreview Perut

    09/21/15 MockDesignReview(Wed)EagleAssignment(Fri) All

    Researchandselectallhardwaremodules Pichamon

    Preparedesignreview Perut

    09/28/15 DesignReviews&CompleteSafetyTraining(Wed) All

    Purchasehardware&allparts,researchonneuralnetwork Pichamon

    Collectpreliminarysensordataforneuralnetworktraining Perut

    10/5/15 SolderingAssignment(Fri) All

    Studydatasheetforsensor,microcontroller,bluetoothmodules Pichamon

    Programmicrocontroller Perut

    10/12/15 Assemblelocationandpressuresensorsmodule Pichamon

    Testmicrocontroller Perut

    10/19/15 TestsensoraccuracyanddesignPCB Pichamon

    Setuphostservice Perut

    10/26/15 IndividualProgressReportsDue All

    TestPCB Pichamon

    Testhostserviceandimplementfront-endapplication Perut

    11/2/15 MockDemo All

    Preparemockdemonstration Pichamon

    Black-boxtestingonindividualcomponents Perut

    11/9/15 Assembleallcomponents Pichamon

    Runtestsonfinalprojectasawhole Perut

    11/16/15 Ensurefunctionality Pichamon

    Fixremainingissues Perut

    11/23/15 Preparepresentation Pichamon

    Preparedemonstration Perut

    11/30/15 Preparefinalpaper Pichamon

    Finalizeprojectdemonstration Perut

    12/7/15 FinalPapersDue All

    Finalizepresentation Pichamon

    Labcheckoutandfinalizefinalpaper Perut

    Table11.ProjectScheduleandTaskAllocation

    28

  • 5References[1]IEEECodeofEthics.RetrievedFebruary,2015.Available:http://www.ieee.org/about/corporate/governance/p7-8.html[2]PolymerLithium-IonBatteryProductSpecification[Online].Available:http://www.adafruit.com/datasheets/503562%201200mah.pdf[3]Biterrorrate[Online].Available:https://en.wikipedia.org/wiki/Bit_error_rate[4]Li-IonandLiPolyBatteries[Online].Available:https://learn.adafruit.com/li-ion-and-lipoly-batteries/conclusion[5]DatasheetBluetoothtoSerialPortModuleHC-05 [Online].Available:http://www.electronica60norte.com/mwfls/pdf/newBluetooth.pdf[6]LinearandSwitchingVoltageRegulatorFundamentalPart1 [Online].Available:http://www.ti.com/lit/an/snva558/snva558.pdf[7] PerfBoardHackduino [Online].Available:http://www.instructables.com/id/Perfboard-Hackduino-Arduino-compatible-circuit/[8]Atmel8-BitMicrocontrollerwith4/8/16/32KBytesIn-SystemProgrammableFlashDatasheetSummary[Online].Available:http://www.atmel.com/Images/Atmel-8271-8-bit-AVR-Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-328P_datasheet_Summary.pdf[9]SensorEvent [Online].Available:http://developer.android.com/reference/android/hardware/SensorEvent.html#values[10]FastLearningAlgorithms[Online].Available:http://page.mi.fu-berlin.de/rojas/neural/chapter/K8.pdf

    29

Recommended

View more >