embedded internet systems

44
SUPERMARKET CUSTOMER SURVEY/MONITERING AIM & OBJECTIVE: The number of customers coming in and going out of a supermarket needs to be monitored.The system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one time.The data needs to be reduced.Both the recorded and instantaneous data should be made available to the store manager’s Pc. INTRODUCTION: The main object of the project is to monitor and conduct a survey ,i.e; to calculate the number of customers comming into supermarket ( count ++) , number of customers going out of supermarket ( count - - ) and to compute the total number of customers at a particular time of instance.The customer flow ,that is increment ++ and decrement – should be stored and updated in the manager’s pc at the supermarket by using RABBIT BL2000 MICROPROCESSOR board and its web-server application.

Upload: sasanknizampatnam

Post on 18-Nov-2014

125 views

Category:

Documents


8 download

DESCRIPTION

sasank nizampatnam

TRANSCRIPT

SUPERMARKET CUSTOMER SURVEYMONITERING

AIM amp OBJECTIVE

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

INTRODUCTION

The main object of the project is to monitor and conduct a survey ie to calculate the number of customers comming into supermarket ( count ++) number of customers going out of supermarket ( count - - ) and to compute the total number of customers at a particular time of instanceThe customer flow that is increment ++ and decrement ndash should be stored and updated in the managerrsquos pc at the supermarket by using RABBIT BL2000 MICROPROCESSOR board and its web-server application

As we know that a rabbit board can be assigned to an TCPIP ie assigning an internet protocol address it is easy to make it into web-server by simple manul programming At the graphical user end the user can see the objective clearly as a form of result The Dynamic C coded program output of BL2000 is interfaced with the web-server program such that the updated values are in perfect

POSSIBLE SOLUTIONS

The major part of the project is its possibilities which depends on the input and output devices ( optical sensor and light source ) chosen to connect with rabbit boardIn clear there should be a signal receiver and signal transmitter such that to provide continoues loopIf the loop connection is faild or disconnected the count increment ( logical 1 ) or decriment ( logical 0 ) should be happened via rabbit BL2000 mother board

Case 1

Considering different possibilities we can use a potentiometer to generate logic 0logic 1 In practical we use two potentiometer such that one is for customers who comes in and another is for customers who goes outConnecting the two potentiometers to bl 2000 power supply screw terminals and ground terminal and when a customer places his foot on potentiometer one the dynamic c program counts as count ++ shows an increment at web-server of the manager if the customer places his foot on potentiometer two the dynamic c program counts as count -- This is one of the simple possible ways to generate logical one and logical zero via potentiometer

Case 2

Considering different possibilities we can use a optical sensor to generate logical 0 logical 1 In practical we use two sensors and two light sourceswe supply power from rabbit bl2000 mother board to the optical receiver and light source ie transmitter and connet it out put as an input for the rabbit board

Letrsquos say Optical sensor O1Optical sensor O2light source L1 and light source L2optical sensor O1 and light source L1 are placed at the way ldquoentrancerdquo of the supermarket if an obstacle disturbs the signal the between O1 and L1 then dynamic c code takes it as increasing the count( i ++ )

Lets say optical sensor O2 and light source L2 are placed at the way ldquoexitrdquo of the supermarket if an obstacle disturbs the signal the between O2 and L2 then dynamic c code takes it as decreasing the count( i -- )

Case 3

Considering different possibilities we can use a ldquoONrdquo and ldquoOFFrdquo mechanical switch as a rabbit board analog input In practical we can take two switches S1 and S2 connecting it with dynamic c and taking the on and off values as logic 1 and logic 0This is one of the simple possible ways of dealing this project

CHOSEN SOLUTION

Note 1

From all the above three cases case 2 where the optical sensors are used is a better way to deal with the objective because there are many good reasons like low power consumption accuracy and high operating frequency including with BL2000 compatability so iam conducting the objective with optical sensors and light source devices

Note 2

The requirements for the aim to be done is a BL2000 rabbit boardphoto sensors and system to make BL2000 as a web-server such that to show customer count incrementation and decrementation The circuit will be in active state when there is any obstacle between the reciver and transmitter of an reflective optical sensorActive state is nothing but ldquological off ldquo BL2000 have an ip address and we made it into web server and the result of Dynamic c program is always updated on the minitor All the input voltages for the sensor are taken from the rabbit board inputsSensors were embedded with rabbit board RJ-45 pin is used to get the updated information from the programm through the rabbit board

HARDWARE DESIGN

I have chosen case 2 that is optical sensor and the light source to connect with the bl 2000 mother board The connections and the optical sensor are as follows

Sensors

Specifications

Integral Visible Light Cutoff Filter Monolithic Silicon IC Containing Photodiode Operational Amplifier and Feedback Components Converts Light Intensity to a Voltage High Irradiance Responsivity Typically 111 mV( Wcm2) at p = 940 nm (TSL260R)Compact 3-Lead Plastic Package Single Voltage Supply Operation Low Dark (Offset) Voltage10mV Max Low Supply Current11 mA Typical Wide Supply-Voltage Range 27 V to 55 V Replacements for TSL260 TSL261 and TSL262 RoHS Compliant (minusLF Package Only)

PACKAGE S

SIDELOOKER

(FRONT VIEW)

1 2 3

VDD GND OUT

PACKAGE Sm SURFACE MOUNTSIDELOOKER

(FRONT VIEW)

1 2 3

VDD GND OUT

There are three connecting pins for the optical sensor they are

1 Vdd voltage input pin2 GND ground pin3 OUT analog out put pin

We have to connect the voltage input pin indicated as number 1 to the RABBIT BL2000 voltage supply terminal or power supply ie screw terminal J2 pin 12The ground pin indicated as number 2 is connected manually to screw terminal J9 pin 12 of RABBIT BL2000 The output pin indicated as number 3 shown in above diagram is connected to RABBIT BL2000 ADC channel 0 input screw terminal J4 pin1ADC is nothing but analog to digital converter it converts the analog input from the optical sensor into digital output either logical one or logical zero its nothing but circuit ldquoonrdquo and ldquooffrdquoIf the sensor is detecting the signal from the transmitter it shows no activity if the sensor dosnt detect the signal its count is incremented or decremented which is i++ or imdashin the dynamic c programIn this project iam using a low input and output sensors such as TSL260R TSL261R and TSL262R are infrared light-to-

voltage optical sensorseach combining a photodiode and a transimpedance amplifier(feedback resistor = 16M^8M^and 28M^ respectively) on a single monolithic ICoutput voltage is directly proportional to the light intensity (irradiance) on the photodiode as rabbit board supports the specified voltage and current input and output specificationsThe optical sensor range or light intensity is measured in nanometers ie ldquonmrdquo

Pin connections diagram

Description of sensor

The TSL260RTSL261R and TSL262R are infrared light-to-voltage optical sensorseach combining a photodiode and a transimpedance amplifier(feedback resistor = 16M^8M^and 28M^ respectively) on a single monolithic ICoutput voltage is directly proportional to the light intensity (irradiance) on the photodiode

These devices have improved amplifier offset-voltage stability and low power consumption and are supplied in a 3-lead plastic siderlooker package with an integral visible light cutoff filter and lensewhen supplied in the lead (Pb) free packagethe device is RoHS compliant

Functional diagram of sensor logic

Terminal functions

GND 1 Ground (substrate) All voltages are referenced to GND

OUT 2 output voltage

VDD 3 supply voltage

Absolute Maximum Rating over operating free-air temperature range (unless otherwise noted)

Supply voltage VDDhelliphelliphelliphelliphelliphelliphelliphelliphelliphellip6V

Output current Iohelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip+ -10mA

Duration of shortest-circuit current at (or below ) 25ordmchelliphelliphelliphelliphelliphelliphelliphelliphelliphellip5s

Operating free-air temperature range TAhelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip-25ordmC to 85ordmC

Storage temperature rangeTstghelliphelliphelliphelliphelliphelliphelliphellip -25ordmC to -85ordmC

Lead temperature 16mm(16 inch) from case for 10 seconds ( s package ) helliphelliphelliphelliphellip260ordmC

Reflow solderin accordance with j-std -020c or j-std-020d (SM package)helliphelliphelliphelliphelliphelliphellip260ordmC

Note

stresses beyondthose listed under absolute maximum ratings may cause permanent damage to the device

These are stress ratings only and functional operation of the device at these or any other conditions beyond those indicated under recommended operating conditions is not implied

Exposure to absolute-maximum-rated conditions for extended periods may affect device relaiability

All the voltages are with respect to the GND

Output may be shorted to supply

Recommended operating conditions

Supply voltage VDD helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipmin 27 volts and max 55 volts

Operating free-air temperatureTAhelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipmin 0ordmchelliphelliphelliphellipmax 70ordmc

The device operates at a minimum of 27 v and maximum of 55 v at proper conditions these are the the best specification values that made me to choose these type of sensor and moreover these are compatable with the advanced computing single module rabbit BL2000 motherboardThese temperature values also give a good result of output

Electrical characteristics at VDD = 5v TA = 25ordmcLp =940 nm RL =10K^

VD dark voltage min and max values are same for all models of devices TSL260RTSL261RTSL262R that is min 0 max 10 and type is 4 in mv

DATA SHEET

Electrical characteristic chart

V output voltage

Ee=18(Wcmsup2Ee=46(Wcmsup2Ee=220(Wcmsup2

min1 typ 2 max3

vMin1 typ2 max 3

Min1 typ2 max3

IDD supply current

Ee=18(Wcmsup2 Typ 11 max 17

mA

Ee=46(Wcmsup2 Typ11 max17

Ee=220(Wcmsup2 Typ11 max 17

Ne irradiance

Typ 111 435 91 mV(Wcmsup2)

VoM max output voltage

VDD = 45V min3 typ 33 Min3 typ 33 Min3 typ 33 v

Dynamic characteristics of the sensor at TA = 25ordm c

Parameter Testconditions TSL260R TSL261R TSL262RMin type max Min typ max Min typ

maxtr output pulse risetime

VDD=5v Lp= 940nm 260 70 7

Tr output falltime VDD=5v Lp=940nm 260 70 7Vn output noise voltage

VDD=5v Ee=0f=1000Hz

08 07 06(v0Hz

Depending on the purpose of client we can take any of the three models and these photo transistors were made by a company called TEXAS ADVANCED OPTO ELECTRONICS SOLUTIONSThere are varied range of opto devices to make our task done but by considering all the factors like response refresh rate and other atmospheric temperature and light conditionsSome time voltage flickers may cause irrelavent responcive signal and causes a bad output or missleneous output ranges which causes mismatch with the Dynamic c programresults to no functioning the device

Reference helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipwwwtaosincom

Typical characteristics

This is a graph taken at different temperature levels of the sensor

Circuit

LIGHT SOURCE

We can use a strong source of light tramission such as light emmiting diodes or laser light depending on the purpose if we use LEDrsquos that are low power consumption and low emission rates so some times signal may not be detected by the optical sensor and the program may leads to crash the BL2000so for this purpose we are using laser light source with an external input battery or powersupply

About BL2000

Description

The BL2000 gives OEM designers optional Ethernet connectivity in a low-cost high-

performance single-board computer These compact boards are rich with the digital IO AD

and DA designers need for embedded control and monitoring applications and the BL2000s

compact board size of 415 x 343 (105 mm x 87 mm) allows for easy integration Ethernet

models are ideal for remotely monitoring and supervising another programmable system or web-

enabling new or existing products

Features

10Base-T Ethernet with RJ-45

Up to 28 digital IO

Up to 11 AD and 2 DA

4 serial ports

Optional 512K Flash 512K SRAM

Onboard relay

The BL2000 models are available in four configurations-two with Ethernet two without-and

feature up to 28 digital IO (including 5 or 7 dual-purpose analog or digital inputs) 3 RS-

232485 serial ports (plus one programming port) Rabbitreg 2000 microprocessor at 221 MHz

128K SRAM and 256K Flash onboard SPDT relay LEDs 7 timers and battery-backed real-

time clock

For the most demanding applications the BL2000 and BL2020 models include 4 channels of 12-

bit resolution AD input 5 channels of dual-purpose input and 2 channels of 12-bit DA output

For applications not requiring high-resolution analog IO the BL2010 and BL2030 offer 4

channels of 10-bit resolution AD input and 7 channels of dual-purpose input The dual-purpose

inputs are software configurable as analog inputs or programmable-threshold digital inputs

All BL2000 models can be programmed and debugged over EthernetInternet using appropriate

accessory hardware Systems with built-in 10Base-T Ethernet can be directly controlled and

monitored across networks or the Internet and can also open sockets to remote devices serve

web pages or send E-mail

Programming the BL2000 Single-Board Computer

Programs are developed using Rabbits industry-proven Dynamic Creg software development

system An extensive library of drivers and sample programs is provided along with royalty-free

TCPIP stack with source All BL2000 models can be programmed and debugged over

EthernetInternet using appropriate accessory hardware

pin diagram of rabbit BL2000

Power Supply PinsInstead of connecting an AC adapter to the power supply jack J7 the input power supply(9 V to 40 V DC) may be connected to pins 12 and 11 on header J2 (see Figure 6(a) orFigure 6(b))Pin 12 on header J9 or J10 is normally GND by factory default but may be changed toVcc by removing resistor R161 and installing resistor R160power Supplyrdquo for more information on this configuration and for information on backupbattery options

About Dynamic c

overview

Dynamic C has been in use worldwide since 1989 It is specially designed for programming embedded systems and features quick compile and interactive debugging A complete reference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menu

The advantage of working in RAM is to save wear on the flash memory which is limited to about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAM

NOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memory

NOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizes

Developing software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

Dynamic C has a number of standard featuresbull Full-feature source andor assembly-level debugger no in-circuit emulator requiredbull Royalty-free TCPIP stack with source code and most common protocolsbull Hundreds of functions in source-code libraries and sample programs1048664 Exceptionally fast support for floating-point arithmetic and transcendental functions1048664 RS-232 and RS-485 serial communication1048664 Analog and digital IO drivers1048664 I2C SPI GPS file system1048664 LCD display and keypad driversbull Powerful language extensions for cooperative or preemptive multitaskingbull Loader utility program to load binary images into Rabbit-based targets in the absenceof Dynamic Cbull Provision for customers to create their own source code libraries and augment on-linehelp by creating ldquofunction descriptionrdquo block comments using a special format forlibrary functionsbull Standard debugging features1048664 BreakpointsmdashSet breakpoints that can disable interrupts1048664 Single-steppingmdashStep into or over functions at a source or machine code level μCOS-II aware1048664 Code disassemblymdashThe disassembly window displays addresses opcodes mnemonics andmachine cycle times Switch between debugging at machine-code level and source-code level bysimply opening or closing the disassembly window1048664 Watch expressionsmdashWatch expressions are compiled when defined so complex expressionsincluding function calls may be placed into watch expressions Watch expressions can be updatedwith or without stopping program execution

1048664 Register windowmdashAll processor registers and flags are displayed The contents of general registersmay be modified in the window by the user1048664 Stack windowmdashshows the contents of the top of the stack1048664 Hex memory dumpmdashdisplays the contents of memory at any address1048664 STDIO windowmdashprintf outputs to this window and keyboard input on the host PC can bedetected for debugging purposes printf output may also be sent to a serial port or file

Board InitializationCall this function at the beginning of your program This function initializes the system IO ports andloads all the AD and DAC calibration constants from flash memory into SRAM for use by your programThe ports are initialized as follows

void brdInit (void)Port IO Function Output FunctionStatePA0 Output OUT0RELAYLED_DS4 High-Current DriverOffPA1 Output OUT1LED_DS5 High-Current DriverOffPA2 Output OUT2LED_DS6 High-Current DriverOffPA3 Output OUT3LED_DS7 High-Current DriverOffPA4 Output OUT4 High-Current DriverOffPA5 Output OUT5 High-Current DriverOffPA6 Output OUT6 High-Current DriverOffPA7 Output OUT7 High-Current DriverOffPB0 Input IN6 NAPB1 Input CLKA NAPB2 Input IN7 NAPB3 Input IN8 NAPB4 Input IN9 NAPB5 Input IN10 NAPB6 Output RS485_EN OffPB7 Output UPGOOD Bad Indicator OffPC0 Output TXD RS-485 Inactive highPC1 Input RXD RS-485 NA

The light source or the change in the light range is taken as the input for the Dynamic c program and it is converted by the analog to digital converter ports processed and compiled by the rabbit processorThe voltage range variation makes the program to count the voltage in as addition and voltage out as the subtraction from the total customers It is menctioned as T in the program

SOFTWARE CODDING

PROGRAMM

void main()

int ijT

i=0

j=0

auto float voltageinvoltageout

brdInit()

voltagein = anaInVolts(pin number)

voltageout = anaInVolts(pin number)

for()

if (voltageinlt25)

i++

printf(total number of customers today d ni)

if (voltageoutlt25)

j++

T=i-j

printf(customers presence in the store= d nT)

some of the commands which were used to complete the task success are as follows

(1) kbhit

syntax int kbhit(void)

description detects keystrokes in the Dynamic C studio window

Return value 0 If a key has been pressed 0 otherwise

Library UTILLIB

(2) float anaInVolts(unsigned int channel) discription Reads the state of an AD converter input channel and uses the previously set calibration constants to convert it to volts

PARAMETER channel is the AD converter input channel (0ndash10)

RETURN VALUE A voltage value corresponding to the voltage on the analog input channel SEE ALSOanaIn anaInCalib brdInit

(3) void anaInCalib(int channel int value1float volts1 int value2 float volts2)

Calibrates the response of the AD converter channel as a linear function using the two conversion pointsprovided Gain and offset constants are calculated and placed into global table _adcInCalibPARAMETERSchannel is the AD converter input channel (0ndash10)value1 is the first AD converter channel valuevolts1 is the voltage corresponding to the first AD converter channel valuevalue2 is the second AD converter channel valuevolts2 is the voltage corresponding to the second AD converter channel valueRETURN VALUE0 if successful-1 if not able to make calibration constantsCommands used

anaIn anaInVolts brdInitReads the voltage of an analog input channel by serially clocking out an 8-bit command to the AD converterdevice of the following formats

TLC2543 commandsD7ndashD4Channel 0 - 10Channel 11 = (Vref+ - Vref-)2Channel 12 = Vref-

Channel 13 = Vref+

Channel 14 = software powerdownD3-D2Output data length01mdash8 bits00mdash12 bits (normally used as default)11mdash16 bits (not supported by driver)D1Output data format0mdashMSB first1mdashLSB first (not supported by driver)D0Mode of operation0mdashUnipolar (normally used as default)1mdashBipolar

Example Programms which pioneered for the main program

Sample server program

This sample program shows how to use the for loops in the Dynamic c programming language

server program

define TCPCONFIG1

use ldquodcrtcplibrdquo

use ldquohttplibrdquo

ximport ldquodworkhellowwwhtmlrdquohellowww_html

SSPEC_MIMETABLE_START

SSPEC_MIME(ldquohtmlrdquordquotexthtmlrdquo)

SSPEC_MIMETABLE_END

SSPEC_RESOURCETABLE_START

SSPEC_RESOURCE_XMEMFILE(ldquohellowwwhtmlrdquohellowww_html)

SSPEC_RESOURCETABLE_END

void main()

sock_init()

http_init()

for()

http_handler()

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

POSSIBLE SOLUTIONS

The major part of the project is its possibilities which depends on the input and output devices ( optical sensor and light source ) chosen to connect with rabbit boardIn clear there should be a signal receiver and signal transmitter such that to provide continoues loopIf the loop connection is faild or disconnected the count increment ( logical 1 ) or decriment ( logical 0 ) should be happened via rabbit BL2000 mother board

Case 1

Considering different possibilities we can use a potentiometer to generate logic 0logic 1 In practical we use two potentiometer such that one is for customers who comes in and another is for customers who goes outConnecting the two potentiometers to bl 2000 power supply screw terminals and ground terminal and when a customer places his foot on potentiometer one the dynamic c program counts as count ++ shows an increment at web-server of the manager if the customer places his foot on potentiometer two the dynamic c program counts as count -- This is one of the simple possible ways to generate logical one and logical zero via potentiometer

Case 2

Considering different possibilities we can use a optical sensor to generate logical 0 logical 1 In practical we use two sensors and two light sourceswe supply power from rabbit bl2000 mother board to the optical receiver and light source ie transmitter and connet it out put as an input for the rabbit board

Letrsquos say Optical sensor O1Optical sensor O2light source L1 and light source L2optical sensor O1 and light source L1 are placed at the way ldquoentrancerdquo of the supermarket if an obstacle disturbs the signal the between O1 and L1 then dynamic c code takes it as increasing the count( i ++ )

Lets say optical sensor O2 and light source L2 are placed at the way ldquoexitrdquo of the supermarket if an obstacle disturbs the signal the between O2 and L2 then dynamic c code takes it as decreasing the count( i -- )

Case 3

Considering different possibilities we can use a ldquoONrdquo and ldquoOFFrdquo mechanical switch as a rabbit board analog input In practical we can take two switches S1 and S2 connecting it with dynamic c and taking the on and off values as logic 1 and logic 0This is one of the simple possible ways of dealing this project

CHOSEN SOLUTION

Note 1

From all the above three cases case 2 where the optical sensors are used is a better way to deal with the objective because there are many good reasons like low power consumption accuracy and high operating frequency including with BL2000 compatability so iam conducting the objective with optical sensors and light source devices

Note 2

The requirements for the aim to be done is a BL2000 rabbit boardphoto sensors and system to make BL2000 as a web-server such that to show customer count incrementation and decrementation The circuit will be in active state when there is any obstacle between the reciver and transmitter of an reflective optical sensorActive state is nothing but ldquological off ldquo BL2000 have an ip address and we made it into web server and the result of Dynamic c program is always updated on the minitor All the input voltages for the sensor are taken from the rabbit board inputsSensors were embedded with rabbit board RJ-45 pin is used to get the updated information from the programm through the rabbit board

HARDWARE DESIGN

I have chosen case 2 that is optical sensor and the light source to connect with the bl 2000 mother board The connections and the optical sensor are as follows

Sensors

Specifications

Integral Visible Light Cutoff Filter Monolithic Silicon IC Containing Photodiode Operational Amplifier and Feedback Components Converts Light Intensity to a Voltage High Irradiance Responsivity Typically 111 mV( Wcm2) at p = 940 nm (TSL260R)Compact 3-Lead Plastic Package Single Voltage Supply Operation Low Dark (Offset) Voltage10mV Max Low Supply Current11 mA Typical Wide Supply-Voltage Range 27 V to 55 V Replacements for TSL260 TSL261 and TSL262 RoHS Compliant (minusLF Package Only)

PACKAGE S

SIDELOOKER

(FRONT VIEW)

1 2 3

VDD GND OUT

PACKAGE Sm SURFACE MOUNTSIDELOOKER

(FRONT VIEW)

1 2 3

VDD GND OUT

There are three connecting pins for the optical sensor they are

1 Vdd voltage input pin2 GND ground pin3 OUT analog out put pin

We have to connect the voltage input pin indicated as number 1 to the RABBIT BL2000 voltage supply terminal or power supply ie screw terminal J2 pin 12The ground pin indicated as number 2 is connected manually to screw terminal J9 pin 12 of RABBIT BL2000 The output pin indicated as number 3 shown in above diagram is connected to RABBIT BL2000 ADC channel 0 input screw terminal J4 pin1ADC is nothing but analog to digital converter it converts the analog input from the optical sensor into digital output either logical one or logical zero its nothing but circuit ldquoonrdquo and ldquooffrdquoIf the sensor is detecting the signal from the transmitter it shows no activity if the sensor dosnt detect the signal its count is incremented or decremented which is i++ or imdashin the dynamic c programIn this project iam using a low input and output sensors such as TSL260R TSL261R and TSL262R are infrared light-to-

voltage optical sensorseach combining a photodiode and a transimpedance amplifier(feedback resistor = 16M^8M^and 28M^ respectively) on a single monolithic ICoutput voltage is directly proportional to the light intensity (irradiance) on the photodiode as rabbit board supports the specified voltage and current input and output specificationsThe optical sensor range or light intensity is measured in nanometers ie ldquonmrdquo

Pin connections diagram

Description of sensor

The TSL260RTSL261R and TSL262R are infrared light-to-voltage optical sensorseach combining a photodiode and a transimpedance amplifier(feedback resistor = 16M^8M^and 28M^ respectively) on a single monolithic ICoutput voltage is directly proportional to the light intensity (irradiance) on the photodiode

These devices have improved amplifier offset-voltage stability and low power consumption and are supplied in a 3-lead plastic siderlooker package with an integral visible light cutoff filter and lensewhen supplied in the lead (Pb) free packagethe device is RoHS compliant

Functional diagram of sensor logic

Terminal functions

GND 1 Ground (substrate) All voltages are referenced to GND

OUT 2 output voltage

VDD 3 supply voltage

Absolute Maximum Rating over operating free-air temperature range (unless otherwise noted)

Supply voltage VDDhelliphelliphelliphelliphelliphelliphelliphelliphelliphellip6V

Output current Iohelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip+ -10mA

Duration of shortest-circuit current at (or below ) 25ordmchelliphelliphelliphelliphelliphelliphelliphelliphelliphellip5s

Operating free-air temperature range TAhelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip-25ordmC to 85ordmC

Storage temperature rangeTstghelliphelliphelliphelliphelliphelliphelliphellip -25ordmC to -85ordmC

Lead temperature 16mm(16 inch) from case for 10 seconds ( s package ) helliphelliphelliphelliphellip260ordmC

Reflow solderin accordance with j-std -020c or j-std-020d (SM package)helliphelliphelliphelliphelliphelliphellip260ordmC

Note

stresses beyondthose listed under absolute maximum ratings may cause permanent damage to the device

These are stress ratings only and functional operation of the device at these or any other conditions beyond those indicated under recommended operating conditions is not implied

Exposure to absolute-maximum-rated conditions for extended periods may affect device relaiability

All the voltages are with respect to the GND

Output may be shorted to supply

Recommended operating conditions

Supply voltage VDD helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipmin 27 volts and max 55 volts

Operating free-air temperatureTAhelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipmin 0ordmchelliphelliphelliphellipmax 70ordmc

The device operates at a minimum of 27 v and maximum of 55 v at proper conditions these are the the best specification values that made me to choose these type of sensor and moreover these are compatable with the advanced computing single module rabbit BL2000 motherboardThese temperature values also give a good result of output

Electrical characteristics at VDD = 5v TA = 25ordmcLp =940 nm RL =10K^

VD dark voltage min and max values are same for all models of devices TSL260RTSL261RTSL262R that is min 0 max 10 and type is 4 in mv

DATA SHEET

Electrical characteristic chart

V output voltage

Ee=18(Wcmsup2Ee=46(Wcmsup2Ee=220(Wcmsup2

min1 typ 2 max3

vMin1 typ2 max 3

Min1 typ2 max3

IDD supply current

Ee=18(Wcmsup2 Typ 11 max 17

mA

Ee=46(Wcmsup2 Typ11 max17

Ee=220(Wcmsup2 Typ11 max 17

Ne irradiance

Typ 111 435 91 mV(Wcmsup2)

VoM max output voltage

VDD = 45V min3 typ 33 Min3 typ 33 Min3 typ 33 v

Dynamic characteristics of the sensor at TA = 25ordm c

Parameter Testconditions TSL260R TSL261R TSL262RMin type max Min typ max Min typ

maxtr output pulse risetime

VDD=5v Lp= 940nm 260 70 7

Tr output falltime VDD=5v Lp=940nm 260 70 7Vn output noise voltage

VDD=5v Ee=0f=1000Hz

08 07 06(v0Hz

Depending on the purpose of client we can take any of the three models and these photo transistors were made by a company called TEXAS ADVANCED OPTO ELECTRONICS SOLUTIONSThere are varied range of opto devices to make our task done but by considering all the factors like response refresh rate and other atmospheric temperature and light conditionsSome time voltage flickers may cause irrelavent responcive signal and causes a bad output or missleneous output ranges which causes mismatch with the Dynamic c programresults to no functioning the device

Reference helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipwwwtaosincom

Typical characteristics

This is a graph taken at different temperature levels of the sensor

Circuit

LIGHT SOURCE

We can use a strong source of light tramission such as light emmiting diodes or laser light depending on the purpose if we use LEDrsquos that are low power consumption and low emission rates so some times signal may not be detected by the optical sensor and the program may leads to crash the BL2000so for this purpose we are using laser light source with an external input battery or powersupply

About BL2000

Description

The BL2000 gives OEM designers optional Ethernet connectivity in a low-cost high-

performance single-board computer These compact boards are rich with the digital IO AD

and DA designers need for embedded control and monitoring applications and the BL2000s

compact board size of 415 x 343 (105 mm x 87 mm) allows for easy integration Ethernet

models are ideal for remotely monitoring and supervising another programmable system or web-

enabling new or existing products

Features

10Base-T Ethernet with RJ-45

Up to 28 digital IO

Up to 11 AD and 2 DA

4 serial ports

Optional 512K Flash 512K SRAM

Onboard relay

The BL2000 models are available in four configurations-two with Ethernet two without-and

feature up to 28 digital IO (including 5 or 7 dual-purpose analog or digital inputs) 3 RS-

232485 serial ports (plus one programming port) Rabbitreg 2000 microprocessor at 221 MHz

128K SRAM and 256K Flash onboard SPDT relay LEDs 7 timers and battery-backed real-

time clock

For the most demanding applications the BL2000 and BL2020 models include 4 channels of 12-

bit resolution AD input 5 channels of dual-purpose input and 2 channels of 12-bit DA output

For applications not requiring high-resolution analog IO the BL2010 and BL2030 offer 4

channels of 10-bit resolution AD input and 7 channels of dual-purpose input The dual-purpose

inputs are software configurable as analog inputs or programmable-threshold digital inputs

All BL2000 models can be programmed and debugged over EthernetInternet using appropriate

accessory hardware Systems with built-in 10Base-T Ethernet can be directly controlled and

monitored across networks or the Internet and can also open sockets to remote devices serve

web pages or send E-mail

Programming the BL2000 Single-Board Computer

Programs are developed using Rabbits industry-proven Dynamic Creg software development

system An extensive library of drivers and sample programs is provided along with royalty-free

TCPIP stack with source All BL2000 models can be programmed and debugged over

EthernetInternet using appropriate accessory hardware

pin diagram of rabbit BL2000

Power Supply PinsInstead of connecting an AC adapter to the power supply jack J7 the input power supply(9 V to 40 V DC) may be connected to pins 12 and 11 on header J2 (see Figure 6(a) orFigure 6(b))Pin 12 on header J9 or J10 is normally GND by factory default but may be changed toVcc by removing resistor R161 and installing resistor R160power Supplyrdquo for more information on this configuration and for information on backupbattery options

About Dynamic c

overview

Dynamic C has been in use worldwide since 1989 It is specially designed for programming embedded systems and features quick compile and interactive debugging A complete reference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menu

The advantage of working in RAM is to save wear on the flash memory which is limited to about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAM

NOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memory

NOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizes

Developing software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

Dynamic C has a number of standard featuresbull Full-feature source andor assembly-level debugger no in-circuit emulator requiredbull Royalty-free TCPIP stack with source code and most common protocolsbull Hundreds of functions in source-code libraries and sample programs1048664 Exceptionally fast support for floating-point arithmetic and transcendental functions1048664 RS-232 and RS-485 serial communication1048664 Analog and digital IO drivers1048664 I2C SPI GPS file system1048664 LCD display and keypad driversbull Powerful language extensions for cooperative or preemptive multitaskingbull Loader utility program to load binary images into Rabbit-based targets in the absenceof Dynamic Cbull Provision for customers to create their own source code libraries and augment on-linehelp by creating ldquofunction descriptionrdquo block comments using a special format forlibrary functionsbull Standard debugging features1048664 BreakpointsmdashSet breakpoints that can disable interrupts1048664 Single-steppingmdashStep into or over functions at a source or machine code level μCOS-II aware1048664 Code disassemblymdashThe disassembly window displays addresses opcodes mnemonics andmachine cycle times Switch between debugging at machine-code level and source-code level bysimply opening or closing the disassembly window1048664 Watch expressionsmdashWatch expressions are compiled when defined so complex expressionsincluding function calls may be placed into watch expressions Watch expressions can be updatedwith or without stopping program execution

1048664 Register windowmdashAll processor registers and flags are displayed The contents of general registersmay be modified in the window by the user1048664 Stack windowmdashshows the contents of the top of the stack1048664 Hex memory dumpmdashdisplays the contents of memory at any address1048664 STDIO windowmdashprintf outputs to this window and keyboard input on the host PC can bedetected for debugging purposes printf output may also be sent to a serial port or file

Board InitializationCall this function at the beginning of your program This function initializes the system IO ports andloads all the AD and DAC calibration constants from flash memory into SRAM for use by your programThe ports are initialized as follows

void brdInit (void)Port IO Function Output FunctionStatePA0 Output OUT0RELAYLED_DS4 High-Current DriverOffPA1 Output OUT1LED_DS5 High-Current DriverOffPA2 Output OUT2LED_DS6 High-Current DriverOffPA3 Output OUT3LED_DS7 High-Current DriverOffPA4 Output OUT4 High-Current DriverOffPA5 Output OUT5 High-Current DriverOffPA6 Output OUT6 High-Current DriverOffPA7 Output OUT7 High-Current DriverOffPB0 Input IN6 NAPB1 Input CLKA NAPB2 Input IN7 NAPB3 Input IN8 NAPB4 Input IN9 NAPB5 Input IN10 NAPB6 Output RS485_EN OffPB7 Output UPGOOD Bad Indicator OffPC0 Output TXD RS-485 Inactive highPC1 Input RXD RS-485 NA

The light source or the change in the light range is taken as the input for the Dynamic c program and it is converted by the analog to digital converter ports processed and compiled by the rabbit processorThe voltage range variation makes the program to count the voltage in as addition and voltage out as the subtraction from the total customers It is menctioned as T in the program

SOFTWARE CODDING

PROGRAMM

void main()

int ijT

i=0

j=0

auto float voltageinvoltageout

brdInit()

voltagein = anaInVolts(pin number)

voltageout = anaInVolts(pin number)

for()

if (voltageinlt25)

i++

printf(total number of customers today d ni)

if (voltageoutlt25)

j++

T=i-j

printf(customers presence in the store= d nT)

some of the commands which were used to complete the task success are as follows

(1) kbhit

syntax int kbhit(void)

description detects keystrokes in the Dynamic C studio window

Return value 0 If a key has been pressed 0 otherwise

Library UTILLIB

(2) float anaInVolts(unsigned int channel) discription Reads the state of an AD converter input channel and uses the previously set calibration constants to convert it to volts

PARAMETER channel is the AD converter input channel (0ndash10)

RETURN VALUE A voltage value corresponding to the voltage on the analog input channel SEE ALSOanaIn anaInCalib brdInit

(3) void anaInCalib(int channel int value1float volts1 int value2 float volts2)

Calibrates the response of the AD converter channel as a linear function using the two conversion pointsprovided Gain and offset constants are calculated and placed into global table _adcInCalibPARAMETERSchannel is the AD converter input channel (0ndash10)value1 is the first AD converter channel valuevolts1 is the voltage corresponding to the first AD converter channel valuevalue2 is the second AD converter channel valuevolts2 is the voltage corresponding to the second AD converter channel valueRETURN VALUE0 if successful-1 if not able to make calibration constantsCommands used

anaIn anaInVolts brdInitReads the voltage of an analog input channel by serially clocking out an 8-bit command to the AD converterdevice of the following formats

TLC2543 commandsD7ndashD4Channel 0 - 10Channel 11 = (Vref+ - Vref-)2Channel 12 = Vref-

Channel 13 = Vref+

Channel 14 = software powerdownD3-D2Output data length01mdash8 bits00mdash12 bits (normally used as default)11mdash16 bits (not supported by driver)D1Output data format0mdashMSB first1mdashLSB first (not supported by driver)D0Mode of operation0mdashUnipolar (normally used as default)1mdashBipolar

Example Programms which pioneered for the main program

Sample server program

This sample program shows how to use the for loops in the Dynamic c programming language

server program

define TCPCONFIG1

use ldquodcrtcplibrdquo

use ldquohttplibrdquo

ximport ldquodworkhellowwwhtmlrdquohellowww_html

SSPEC_MIMETABLE_START

SSPEC_MIME(ldquohtmlrdquordquotexthtmlrdquo)

SSPEC_MIMETABLE_END

SSPEC_RESOURCETABLE_START

SSPEC_RESOURCE_XMEMFILE(ldquohellowwwhtmlrdquohellowww_html)

SSPEC_RESOURCETABLE_END

void main()

sock_init()

http_init()

for()

http_handler()

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

Case 2

Considering different possibilities we can use a optical sensor to generate logical 0 logical 1 In practical we use two sensors and two light sourceswe supply power from rabbit bl2000 mother board to the optical receiver and light source ie transmitter and connet it out put as an input for the rabbit board

Letrsquos say Optical sensor O1Optical sensor O2light source L1 and light source L2optical sensor O1 and light source L1 are placed at the way ldquoentrancerdquo of the supermarket if an obstacle disturbs the signal the between O1 and L1 then dynamic c code takes it as increasing the count( i ++ )

Lets say optical sensor O2 and light source L2 are placed at the way ldquoexitrdquo of the supermarket if an obstacle disturbs the signal the between O2 and L2 then dynamic c code takes it as decreasing the count( i -- )

Case 3

Considering different possibilities we can use a ldquoONrdquo and ldquoOFFrdquo mechanical switch as a rabbit board analog input In practical we can take two switches S1 and S2 connecting it with dynamic c and taking the on and off values as logic 1 and logic 0This is one of the simple possible ways of dealing this project

CHOSEN SOLUTION

Note 1

From all the above three cases case 2 where the optical sensors are used is a better way to deal with the objective because there are many good reasons like low power consumption accuracy and high operating frequency including with BL2000 compatability so iam conducting the objective with optical sensors and light source devices

Note 2

The requirements for the aim to be done is a BL2000 rabbit boardphoto sensors and system to make BL2000 as a web-server such that to show customer count incrementation and decrementation The circuit will be in active state when there is any obstacle between the reciver and transmitter of an reflective optical sensorActive state is nothing but ldquological off ldquo BL2000 have an ip address and we made it into web server and the result of Dynamic c program is always updated on the minitor All the input voltages for the sensor are taken from the rabbit board inputsSensors were embedded with rabbit board RJ-45 pin is used to get the updated information from the programm through the rabbit board

HARDWARE DESIGN

I have chosen case 2 that is optical sensor and the light source to connect with the bl 2000 mother board The connections and the optical sensor are as follows

Sensors

Specifications

Integral Visible Light Cutoff Filter Monolithic Silicon IC Containing Photodiode Operational Amplifier and Feedback Components Converts Light Intensity to a Voltage High Irradiance Responsivity Typically 111 mV( Wcm2) at p = 940 nm (TSL260R)Compact 3-Lead Plastic Package Single Voltage Supply Operation Low Dark (Offset) Voltage10mV Max Low Supply Current11 mA Typical Wide Supply-Voltage Range 27 V to 55 V Replacements for TSL260 TSL261 and TSL262 RoHS Compliant (minusLF Package Only)

PACKAGE S

SIDELOOKER

(FRONT VIEW)

1 2 3

VDD GND OUT

PACKAGE Sm SURFACE MOUNTSIDELOOKER

(FRONT VIEW)

1 2 3

VDD GND OUT

There are three connecting pins for the optical sensor they are

1 Vdd voltage input pin2 GND ground pin3 OUT analog out put pin

We have to connect the voltage input pin indicated as number 1 to the RABBIT BL2000 voltage supply terminal or power supply ie screw terminal J2 pin 12The ground pin indicated as number 2 is connected manually to screw terminal J9 pin 12 of RABBIT BL2000 The output pin indicated as number 3 shown in above diagram is connected to RABBIT BL2000 ADC channel 0 input screw terminal J4 pin1ADC is nothing but analog to digital converter it converts the analog input from the optical sensor into digital output either logical one or logical zero its nothing but circuit ldquoonrdquo and ldquooffrdquoIf the sensor is detecting the signal from the transmitter it shows no activity if the sensor dosnt detect the signal its count is incremented or decremented which is i++ or imdashin the dynamic c programIn this project iam using a low input and output sensors such as TSL260R TSL261R and TSL262R are infrared light-to-

voltage optical sensorseach combining a photodiode and a transimpedance amplifier(feedback resistor = 16M^8M^and 28M^ respectively) on a single monolithic ICoutput voltage is directly proportional to the light intensity (irradiance) on the photodiode as rabbit board supports the specified voltage and current input and output specificationsThe optical sensor range or light intensity is measured in nanometers ie ldquonmrdquo

Pin connections diagram

Description of sensor

The TSL260RTSL261R and TSL262R are infrared light-to-voltage optical sensorseach combining a photodiode and a transimpedance amplifier(feedback resistor = 16M^8M^and 28M^ respectively) on a single monolithic ICoutput voltage is directly proportional to the light intensity (irradiance) on the photodiode

These devices have improved amplifier offset-voltage stability and low power consumption and are supplied in a 3-lead plastic siderlooker package with an integral visible light cutoff filter and lensewhen supplied in the lead (Pb) free packagethe device is RoHS compliant

Functional diagram of sensor logic

Terminal functions

GND 1 Ground (substrate) All voltages are referenced to GND

OUT 2 output voltage

VDD 3 supply voltage

Absolute Maximum Rating over operating free-air temperature range (unless otherwise noted)

Supply voltage VDDhelliphelliphelliphelliphelliphelliphelliphelliphelliphellip6V

Output current Iohelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip+ -10mA

Duration of shortest-circuit current at (or below ) 25ordmchelliphelliphelliphelliphelliphelliphelliphelliphelliphellip5s

Operating free-air temperature range TAhelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip-25ordmC to 85ordmC

Storage temperature rangeTstghelliphelliphelliphelliphelliphelliphelliphellip -25ordmC to -85ordmC

Lead temperature 16mm(16 inch) from case for 10 seconds ( s package ) helliphelliphelliphelliphellip260ordmC

Reflow solderin accordance with j-std -020c or j-std-020d (SM package)helliphelliphelliphelliphelliphelliphellip260ordmC

Note

stresses beyondthose listed under absolute maximum ratings may cause permanent damage to the device

These are stress ratings only and functional operation of the device at these or any other conditions beyond those indicated under recommended operating conditions is not implied

Exposure to absolute-maximum-rated conditions for extended periods may affect device relaiability

All the voltages are with respect to the GND

Output may be shorted to supply

Recommended operating conditions

Supply voltage VDD helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipmin 27 volts and max 55 volts

Operating free-air temperatureTAhelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipmin 0ordmchelliphelliphelliphellipmax 70ordmc

The device operates at a minimum of 27 v and maximum of 55 v at proper conditions these are the the best specification values that made me to choose these type of sensor and moreover these are compatable with the advanced computing single module rabbit BL2000 motherboardThese temperature values also give a good result of output

Electrical characteristics at VDD = 5v TA = 25ordmcLp =940 nm RL =10K^

VD dark voltage min and max values are same for all models of devices TSL260RTSL261RTSL262R that is min 0 max 10 and type is 4 in mv

DATA SHEET

Electrical characteristic chart

V output voltage

Ee=18(Wcmsup2Ee=46(Wcmsup2Ee=220(Wcmsup2

min1 typ 2 max3

vMin1 typ2 max 3

Min1 typ2 max3

IDD supply current

Ee=18(Wcmsup2 Typ 11 max 17

mA

Ee=46(Wcmsup2 Typ11 max17

Ee=220(Wcmsup2 Typ11 max 17

Ne irradiance

Typ 111 435 91 mV(Wcmsup2)

VoM max output voltage

VDD = 45V min3 typ 33 Min3 typ 33 Min3 typ 33 v

Dynamic characteristics of the sensor at TA = 25ordm c

Parameter Testconditions TSL260R TSL261R TSL262RMin type max Min typ max Min typ

maxtr output pulse risetime

VDD=5v Lp= 940nm 260 70 7

Tr output falltime VDD=5v Lp=940nm 260 70 7Vn output noise voltage

VDD=5v Ee=0f=1000Hz

08 07 06(v0Hz

Depending on the purpose of client we can take any of the three models and these photo transistors were made by a company called TEXAS ADVANCED OPTO ELECTRONICS SOLUTIONSThere are varied range of opto devices to make our task done but by considering all the factors like response refresh rate and other atmospheric temperature and light conditionsSome time voltage flickers may cause irrelavent responcive signal and causes a bad output or missleneous output ranges which causes mismatch with the Dynamic c programresults to no functioning the device

Reference helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipwwwtaosincom

Typical characteristics

This is a graph taken at different temperature levels of the sensor

Circuit

LIGHT SOURCE

We can use a strong source of light tramission such as light emmiting diodes or laser light depending on the purpose if we use LEDrsquos that are low power consumption and low emission rates so some times signal may not be detected by the optical sensor and the program may leads to crash the BL2000so for this purpose we are using laser light source with an external input battery or powersupply

About BL2000

Description

The BL2000 gives OEM designers optional Ethernet connectivity in a low-cost high-

performance single-board computer These compact boards are rich with the digital IO AD

and DA designers need for embedded control and monitoring applications and the BL2000s

compact board size of 415 x 343 (105 mm x 87 mm) allows for easy integration Ethernet

models are ideal for remotely monitoring and supervising another programmable system or web-

enabling new or existing products

Features

10Base-T Ethernet with RJ-45

Up to 28 digital IO

Up to 11 AD and 2 DA

4 serial ports

Optional 512K Flash 512K SRAM

Onboard relay

The BL2000 models are available in four configurations-two with Ethernet two without-and

feature up to 28 digital IO (including 5 or 7 dual-purpose analog or digital inputs) 3 RS-

232485 serial ports (plus one programming port) Rabbitreg 2000 microprocessor at 221 MHz

128K SRAM and 256K Flash onboard SPDT relay LEDs 7 timers and battery-backed real-

time clock

For the most demanding applications the BL2000 and BL2020 models include 4 channels of 12-

bit resolution AD input 5 channels of dual-purpose input and 2 channels of 12-bit DA output

For applications not requiring high-resolution analog IO the BL2010 and BL2030 offer 4

channels of 10-bit resolution AD input and 7 channels of dual-purpose input The dual-purpose

inputs are software configurable as analog inputs or programmable-threshold digital inputs

All BL2000 models can be programmed and debugged over EthernetInternet using appropriate

accessory hardware Systems with built-in 10Base-T Ethernet can be directly controlled and

monitored across networks or the Internet and can also open sockets to remote devices serve

web pages or send E-mail

Programming the BL2000 Single-Board Computer

Programs are developed using Rabbits industry-proven Dynamic Creg software development

system An extensive library of drivers and sample programs is provided along with royalty-free

TCPIP stack with source All BL2000 models can be programmed and debugged over

EthernetInternet using appropriate accessory hardware

pin diagram of rabbit BL2000

Power Supply PinsInstead of connecting an AC adapter to the power supply jack J7 the input power supply(9 V to 40 V DC) may be connected to pins 12 and 11 on header J2 (see Figure 6(a) orFigure 6(b))Pin 12 on header J9 or J10 is normally GND by factory default but may be changed toVcc by removing resistor R161 and installing resistor R160power Supplyrdquo for more information on this configuration and for information on backupbattery options

About Dynamic c

overview

Dynamic C has been in use worldwide since 1989 It is specially designed for programming embedded systems and features quick compile and interactive debugging A complete reference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menu

The advantage of working in RAM is to save wear on the flash memory which is limited to about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAM

NOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memory

NOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizes

Developing software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

Dynamic C has a number of standard featuresbull Full-feature source andor assembly-level debugger no in-circuit emulator requiredbull Royalty-free TCPIP stack with source code and most common protocolsbull Hundreds of functions in source-code libraries and sample programs1048664 Exceptionally fast support for floating-point arithmetic and transcendental functions1048664 RS-232 and RS-485 serial communication1048664 Analog and digital IO drivers1048664 I2C SPI GPS file system1048664 LCD display and keypad driversbull Powerful language extensions for cooperative or preemptive multitaskingbull Loader utility program to load binary images into Rabbit-based targets in the absenceof Dynamic Cbull Provision for customers to create their own source code libraries and augment on-linehelp by creating ldquofunction descriptionrdquo block comments using a special format forlibrary functionsbull Standard debugging features1048664 BreakpointsmdashSet breakpoints that can disable interrupts1048664 Single-steppingmdashStep into or over functions at a source or machine code level μCOS-II aware1048664 Code disassemblymdashThe disassembly window displays addresses opcodes mnemonics andmachine cycle times Switch between debugging at machine-code level and source-code level bysimply opening or closing the disassembly window1048664 Watch expressionsmdashWatch expressions are compiled when defined so complex expressionsincluding function calls may be placed into watch expressions Watch expressions can be updatedwith or without stopping program execution

1048664 Register windowmdashAll processor registers and flags are displayed The contents of general registersmay be modified in the window by the user1048664 Stack windowmdashshows the contents of the top of the stack1048664 Hex memory dumpmdashdisplays the contents of memory at any address1048664 STDIO windowmdashprintf outputs to this window and keyboard input on the host PC can bedetected for debugging purposes printf output may also be sent to a serial port or file

Board InitializationCall this function at the beginning of your program This function initializes the system IO ports andloads all the AD and DAC calibration constants from flash memory into SRAM for use by your programThe ports are initialized as follows

void brdInit (void)Port IO Function Output FunctionStatePA0 Output OUT0RELAYLED_DS4 High-Current DriverOffPA1 Output OUT1LED_DS5 High-Current DriverOffPA2 Output OUT2LED_DS6 High-Current DriverOffPA3 Output OUT3LED_DS7 High-Current DriverOffPA4 Output OUT4 High-Current DriverOffPA5 Output OUT5 High-Current DriverOffPA6 Output OUT6 High-Current DriverOffPA7 Output OUT7 High-Current DriverOffPB0 Input IN6 NAPB1 Input CLKA NAPB2 Input IN7 NAPB3 Input IN8 NAPB4 Input IN9 NAPB5 Input IN10 NAPB6 Output RS485_EN OffPB7 Output UPGOOD Bad Indicator OffPC0 Output TXD RS-485 Inactive highPC1 Input RXD RS-485 NA

The light source or the change in the light range is taken as the input for the Dynamic c program and it is converted by the analog to digital converter ports processed and compiled by the rabbit processorThe voltage range variation makes the program to count the voltage in as addition and voltage out as the subtraction from the total customers It is menctioned as T in the program

SOFTWARE CODDING

PROGRAMM

void main()

int ijT

i=0

j=0

auto float voltageinvoltageout

brdInit()

voltagein = anaInVolts(pin number)

voltageout = anaInVolts(pin number)

for()

if (voltageinlt25)

i++

printf(total number of customers today d ni)

if (voltageoutlt25)

j++

T=i-j

printf(customers presence in the store= d nT)

some of the commands which were used to complete the task success are as follows

(1) kbhit

syntax int kbhit(void)

description detects keystrokes in the Dynamic C studio window

Return value 0 If a key has been pressed 0 otherwise

Library UTILLIB

(2) float anaInVolts(unsigned int channel) discription Reads the state of an AD converter input channel and uses the previously set calibration constants to convert it to volts

PARAMETER channel is the AD converter input channel (0ndash10)

RETURN VALUE A voltage value corresponding to the voltage on the analog input channel SEE ALSOanaIn anaInCalib brdInit

(3) void anaInCalib(int channel int value1float volts1 int value2 float volts2)

Calibrates the response of the AD converter channel as a linear function using the two conversion pointsprovided Gain and offset constants are calculated and placed into global table _adcInCalibPARAMETERSchannel is the AD converter input channel (0ndash10)value1 is the first AD converter channel valuevolts1 is the voltage corresponding to the first AD converter channel valuevalue2 is the second AD converter channel valuevolts2 is the voltage corresponding to the second AD converter channel valueRETURN VALUE0 if successful-1 if not able to make calibration constantsCommands used

anaIn anaInVolts brdInitReads the voltage of an analog input channel by serially clocking out an 8-bit command to the AD converterdevice of the following formats

TLC2543 commandsD7ndashD4Channel 0 - 10Channel 11 = (Vref+ - Vref-)2Channel 12 = Vref-

Channel 13 = Vref+

Channel 14 = software powerdownD3-D2Output data length01mdash8 bits00mdash12 bits (normally used as default)11mdash16 bits (not supported by driver)D1Output data format0mdashMSB first1mdashLSB first (not supported by driver)D0Mode of operation0mdashUnipolar (normally used as default)1mdashBipolar

Example Programms which pioneered for the main program

Sample server program

This sample program shows how to use the for loops in the Dynamic c programming language

server program

define TCPCONFIG1

use ldquodcrtcplibrdquo

use ldquohttplibrdquo

ximport ldquodworkhellowwwhtmlrdquohellowww_html

SSPEC_MIMETABLE_START

SSPEC_MIME(ldquohtmlrdquordquotexthtmlrdquo)

SSPEC_MIMETABLE_END

SSPEC_RESOURCETABLE_START

SSPEC_RESOURCE_XMEMFILE(ldquohellowwwhtmlrdquohellowww_html)

SSPEC_RESOURCETABLE_END

void main()

sock_init()

http_init()

for()

http_handler()

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

CHOSEN SOLUTION

Note 1

From all the above three cases case 2 where the optical sensors are used is a better way to deal with the objective because there are many good reasons like low power consumption accuracy and high operating frequency including with BL2000 compatability so iam conducting the objective with optical sensors and light source devices

Note 2

The requirements for the aim to be done is a BL2000 rabbit boardphoto sensors and system to make BL2000 as a web-server such that to show customer count incrementation and decrementation The circuit will be in active state when there is any obstacle between the reciver and transmitter of an reflective optical sensorActive state is nothing but ldquological off ldquo BL2000 have an ip address and we made it into web server and the result of Dynamic c program is always updated on the minitor All the input voltages for the sensor are taken from the rabbit board inputsSensors were embedded with rabbit board RJ-45 pin is used to get the updated information from the programm through the rabbit board

HARDWARE DESIGN

I have chosen case 2 that is optical sensor and the light source to connect with the bl 2000 mother board The connections and the optical sensor are as follows

Sensors

Specifications

Integral Visible Light Cutoff Filter Monolithic Silicon IC Containing Photodiode Operational Amplifier and Feedback Components Converts Light Intensity to a Voltage High Irradiance Responsivity Typically 111 mV( Wcm2) at p = 940 nm (TSL260R)Compact 3-Lead Plastic Package Single Voltage Supply Operation Low Dark (Offset) Voltage10mV Max Low Supply Current11 mA Typical Wide Supply-Voltage Range 27 V to 55 V Replacements for TSL260 TSL261 and TSL262 RoHS Compliant (minusLF Package Only)

PACKAGE S

SIDELOOKER

(FRONT VIEW)

1 2 3

VDD GND OUT

PACKAGE Sm SURFACE MOUNTSIDELOOKER

(FRONT VIEW)

1 2 3

VDD GND OUT

There are three connecting pins for the optical sensor they are

1 Vdd voltage input pin2 GND ground pin3 OUT analog out put pin

We have to connect the voltage input pin indicated as number 1 to the RABBIT BL2000 voltage supply terminal or power supply ie screw terminal J2 pin 12The ground pin indicated as number 2 is connected manually to screw terminal J9 pin 12 of RABBIT BL2000 The output pin indicated as number 3 shown in above diagram is connected to RABBIT BL2000 ADC channel 0 input screw terminal J4 pin1ADC is nothing but analog to digital converter it converts the analog input from the optical sensor into digital output either logical one or logical zero its nothing but circuit ldquoonrdquo and ldquooffrdquoIf the sensor is detecting the signal from the transmitter it shows no activity if the sensor dosnt detect the signal its count is incremented or decremented which is i++ or imdashin the dynamic c programIn this project iam using a low input and output sensors such as TSL260R TSL261R and TSL262R are infrared light-to-

voltage optical sensorseach combining a photodiode and a transimpedance amplifier(feedback resistor = 16M^8M^and 28M^ respectively) on a single monolithic ICoutput voltage is directly proportional to the light intensity (irradiance) on the photodiode as rabbit board supports the specified voltage and current input and output specificationsThe optical sensor range or light intensity is measured in nanometers ie ldquonmrdquo

Pin connections diagram

Description of sensor

The TSL260RTSL261R and TSL262R are infrared light-to-voltage optical sensorseach combining a photodiode and a transimpedance amplifier(feedback resistor = 16M^8M^and 28M^ respectively) on a single monolithic ICoutput voltage is directly proportional to the light intensity (irradiance) on the photodiode

These devices have improved amplifier offset-voltage stability and low power consumption and are supplied in a 3-lead plastic siderlooker package with an integral visible light cutoff filter and lensewhen supplied in the lead (Pb) free packagethe device is RoHS compliant

Functional diagram of sensor logic

Terminal functions

GND 1 Ground (substrate) All voltages are referenced to GND

OUT 2 output voltage

VDD 3 supply voltage

Absolute Maximum Rating over operating free-air temperature range (unless otherwise noted)

Supply voltage VDDhelliphelliphelliphelliphelliphelliphelliphelliphelliphellip6V

Output current Iohelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip+ -10mA

Duration of shortest-circuit current at (or below ) 25ordmchelliphelliphelliphelliphelliphelliphelliphelliphelliphellip5s

Operating free-air temperature range TAhelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip-25ordmC to 85ordmC

Storage temperature rangeTstghelliphelliphelliphelliphelliphelliphelliphellip -25ordmC to -85ordmC

Lead temperature 16mm(16 inch) from case for 10 seconds ( s package ) helliphelliphelliphelliphellip260ordmC

Reflow solderin accordance with j-std -020c or j-std-020d (SM package)helliphelliphelliphelliphelliphelliphellip260ordmC

Note

stresses beyondthose listed under absolute maximum ratings may cause permanent damage to the device

These are stress ratings only and functional operation of the device at these or any other conditions beyond those indicated under recommended operating conditions is not implied

Exposure to absolute-maximum-rated conditions for extended periods may affect device relaiability

All the voltages are with respect to the GND

Output may be shorted to supply

Recommended operating conditions

Supply voltage VDD helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipmin 27 volts and max 55 volts

Operating free-air temperatureTAhelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipmin 0ordmchelliphelliphelliphellipmax 70ordmc

The device operates at a minimum of 27 v and maximum of 55 v at proper conditions these are the the best specification values that made me to choose these type of sensor and moreover these are compatable with the advanced computing single module rabbit BL2000 motherboardThese temperature values also give a good result of output

Electrical characteristics at VDD = 5v TA = 25ordmcLp =940 nm RL =10K^

VD dark voltage min and max values are same for all models of devices TSL260RTSL261RTSL262R that is min 0 max 10 and type is 4 in mv

DATA SHEET

Electrical characteristic chart

V output voltage

Ee=18(Wcmsup2Ee=46(Wcmsup2Ee=220(Wcmsup2

min1 typ 2 max3

vMin1 typ2 max 3

Min1 typ2 max3

IDD supply current

Ee=18(Wcmsup2 Typ 11 max 17

mA

Ee=46(Wcmsup2 Typ11 max17

Ee=220(Wcmsup2 Typ11 max 17

Ne irradiance

Typ 111 435 91 mV(Wcmsup2)

VoM max output voltage

VDD = 45V min3 typ 33 Min3 typ 33 Min3 typ 33 v

Dynamic characteristics of the sensor at TA = 25ordm c

Parameter Testconditions TSL260R TSL261R TSL262RMin type max Min typ max Min typ

maxtr output pulse risetime

VDD=5v Lp= 940nm 260 70 7

Tr output falltime VDD=5v Lp=940nm 260 70 7Vn output noise voltage

VDD=5v Ee=0f=1000Hz

08 07 06(v0Hz

Depending on the purpose of client we can take any of the three models and these photo transistors were made by a company called TEXAS ADVANCED OPTO ELECTRONICS SOLUTIONSThere are varied range of opto devices to make our task done but by considering all the factors like response refresh rate and other atmospheric temperature and light conditionsSome time voltage flickers may cause irrelavent responcive signal and causes a bad output or missleneous output ranges which causes mismatch with the Dynamic c programresults to no functioning the device

Reference helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipwwwtaosincom

Typical characteristics

This is a graph taken at different temperature levels of the sensor

Circuit

LIGHT SOURCE

We can use a strong source of light tramission such as light emmiting diodes or laser light depending on the purpose if we use LEDrsquos that are low power consumption and low emission rates so some times signal may not be detected by the optical sensor and the program may leads to crash the BL2000so for this purpose we are using laser light source with an external input battery or powersupply

About BL2000

Description

The BL2000 gives OEM designers optional Ethernet connectivity in a low-cost high-

performance single-board computer These compact boards are rich with the digital IO AD

and DA designers need for embedded control and monitoring applications and the BL2000s

compact board size of 415 x 343 (105 mm x 87 mm) allows for easy integration Ethernet

models are ideal for remotely monitoring and supervising another programmable system or web-

enabling new or existing products

Features

10Base-T Ethernet with RJ-45

Up to 28 digital IO

Up to 11 AD and 2 DA

4 serial ports

Optional 512K Flash 512K SRAM

Onboard relay

The BL2000 models are available in four configurations-two with Ethernet two without-and

feature up to 28 digital IO (including 5 or 7 dual-purpose analog or digital inputs) 3 RS-

232485 serial ports (plus one programming port) Rabbitreg 2000 microprocessor at 221 MHz

128K SRAM and 256K Flash onboard SPDT relay LEDs 7 timers and battery-backed real-

time clock

For the most demanding applications the BL2000 and BL2020 models include 4 channels of 12-

bit resolution AD input 5 channels of dual-purpose input and 2 channels of 12-bit DA output

For applications not requiring high-resolution analog IO the BL2010 and BL2030 offer 4

channels of 10-bit resolution AD input and 7 channels of dual-purpose input The dual-purpose

inputs are software configurable as analog inputs or programmable-threshold digital inputs

All BL2000 models can be programmed and debugged over EthernetInternet using appropriate

accessory hardware Systems with built-in 10Base-T Ethernet can be directly controlled and

monitored across networks or the Internet and can also open sockets to remote devices serve

web pages or send E-mail

Programming the BL2000 Single-Board Computer

Programs are developed using Rabbits industry-proven Dynamic Creg software development

system An extensive library of drivers and sample programs is provided along with royalty-free

TCPIP stack with source All BL2000 models can be programmed and debugged over

EthernetInternet using appropriate accessory hardware

pin diagram of rabbit BL2000

Power Supply PinsInstead of connecting an AC adapter to the power supply jack J7 the input power supply(9 V to 40 V DC) may be connected to pins 12 and 11 on header J2 (see Figure 6(a) orFigure 6(b))Pin 12 on header J9 or J10 is normally GND by factory default but may be changed toVcc by removing resistor R161 and installing resistor R160power Supplyrdquo for more information on this configuration and for information on backupbattery options

About Dynamic c

overview

Dynamic C has been in use worldwide since 1989 It is specially designed for programming embedded systems and features quick compile and interactive debugging A complete reference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menu

The advantage of working in RAM is to save wear on the flash memory which is limited to about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAM

NOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memory

NOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizes

Developing software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

Dynamic C has a number of standard featuresbull Full-feature source andor assembly-level debugger no in-circuit emulator requiredbull Royalty-free TCPIP stack with source code and most common protocolsbull Hundreds of functions in source-code libraries and sample programs1048664 Exceptionally fast support for floating-point arithmetic and transcendental functions1048664 RS-232 and RS-485 serial communication1048664 Analog and digital IO drivers1048664 I2C SPI GPS file system1048664 LCD display and keypad driversbull Powerful language extensions for cooperative or preemptive multitaskingbull Loader utility program to load binary images into Rabbit-based targets in the absenceof Dynamic Cbull Provision for customers to create their own source code libraries and augment on-linehelp by creating ldquofunction descriptionrdquo block comments using a special format forlibrary functionsbull Standard debugging features1048664 BreakpointsmdashSet breakpoints that can disable interrupts1048664 Single-steppingmdashStep into or over functions at a source or machine code level μCOS-II aware1048664 Code disassemblymdashThe disassembly window displays addresses opcodes mnemonics andmachine cycle times Switch between debugging at machine-code level and source-code level bysimply opening or closing the disassembly window1048664 Watch expressionsmdashWatch expressions are compiled when defined so complex expressionsincluding function calls may be placed into watch expressions Watch expressions can be updatedwith or without stopping program execution

1048664 Register windowmdashAll processor registers and flags are displayed The contents of general registersmay be modified in the window by the user1048664 Stack windowmdashshows the contents of the top of the stack1048664 Hex memory dumpmdashdisplays the contents of memory at any address1048664 STDIO windowmdashprintf outputs to this window and keyboard input on the host PC can bedetected for debugging purposes printf output may also be sent to a serial port or file

Board InitializationCall this function at the beginning of your program This function initializes the system IO ports andloads all the AD and DAC calibration constants from flash memory into SRAM for use by your programThe ports are initialized as follows

void brdInit (void)Port IO Function Output FunctionStatePA0 Output OUT0RELAYLED_DS4 High-Current DriverOffPA1 Output OUT1LED_DS5 High-Current DriverOffPA2 Output OUT2LED_DS6 High-Current DriverOffPA3 Output OUT3LED_DS7 High-Current DriverOffPA4 Output OUT4 High-Current DriverOffPA5 Output OUT5 High-Current DriverOffPA6 Output OUT6 High-Current DriverOffPA7 Output OUT7 High-Current DriverOffPB0 Input IN6 NAPB1 Input CLKA NAPB2 Input IN7 NAPB3 Input IN8 NAPB4 Input IN9 NAPB5 Input IN10 NAPB6 Output RS485_EN OffPB7 Output UPGOOD Bad Indicator OffPC0 Output TXD RS-485 Inactive highPC1 Input RXD RS-485 NA

The light source or the change in the light range is taken as the input for the Dynamic c program and it is converted by the analog to digital converter ports processed and compiled by the rabbit processorThe voltage range variation makes the program to count the voltage in as addition and voltage out as the subtraction from the total customers It is menctioned as T in the program

SOFTWARE CODDING

PROGRAMM

void main()

int ijT

i=0

j=0

auto float voltageinvoltageout

brdInit()

voltagein = anaInVolts(pin number)

voltageout = anaInVolts(pin number)

for()

if (voltageinlt25)

i++

printf(total number of customers today d ni)

if (voltageoutlt25)

j++

T=i-j

printf(customers presence in the store= d nT)

some of the commands which were used to complete the task success are as follows

(1) kbhit

syntax int kbhit(void)

description detects keystrokes in the Dynamic C studio window

Return value 0 If a key has been pressed 0 otherwise

Library UTILLIB

(2) float anaInVolts(unsigned int channel) discription Reads the state of an AD converter input channel and uses the previously set calibration constants to convert it to volts

PARAMETER channel is the AD converter input channel (0ndash10)

RETURN VALUE A voltage value corresponding to the voltage on the analog input channel SEE ALSOanaIn anaInCalib brdInit

(3) void anaInCalib(int channel int value1float volts1 int value2 float volts2)

Calibrates the response of the AD converter channel as a linear function using the two conversion pointsprovided Gain and offset constants are calculated and placed into global table _adcInCalibPARAMETERSchannel is the AD converter input channel (0ndash10)value1 is the first AD converter channel valuevolts1 is the voltage corresponding to the first AD converter channel valuevalue2 is the second AD converter channel valuevolts2 is the voltage corresponding to the second AD converter channel valueRETURN VALUE0 if successful-1 if not able to make calibration constantsCommands used

anaIn anaInVolts brdInitReads the voltage of an analog input channel by serially clocking out an 8-bit command to the AD converterdevice of the following formats

TLC2543 commandsD7ndashD4Channel 0 - 10Channel 11 = (Vref+ - Vref-)2Channel 12 = Vref-

Channel 13 = Vref+

Channel 14 = software powerdownD3-D2Output data length01mdash8 bits00mdash12 bits (normally used as default)11mdash16 bits (not supported by driver)D1Output data format0mdashMSB first1mdashLSB first (not supported by driver)D0Mode of operation0mdashUnipolar (normally used as default)1mdashBipolar

Example Programms which pioneered for the main program

Sample server program

This sample program shows how to use the for loops in the Dynamic c programming language

server program

define TCPCONFIG1

use ldquodcrtcplibrdquo

use ldquohttplibrdquo

ximport ldquodworkhellowwwhtmlrdquohellowww_html

SSPEC_MIMETABLE_START

SSPEC_MIME(ldquohtmlrdquordquotexthtmlrdquo)

SSPEC_MIMETABLE_END

SSPEC_RESOURCETABLE_START

SSPEC_RESOURCE_XMEMFILE(ldquohellowwwhtmlrdquohellowww_html)

SSPEC_RESOURCETABLE_END

void main()

sock_init()

http_init()

for()

http_handler()

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

HARDWARE DESIGN

I have chosen case 2 that is optical sensor and the light source to connect with the bl 2000 mother board The connections and the optical sensor are as follows

Sensors

Specifications

Integral Visible Light Cutoff Filter Monolithic Silicon IC Containing Photodiode Operational Amplifier and Feedback Components Converts Light Intensity to a Voltage High Irradiance Responsivity Typically 111 mV( Wcm2) at p = 940 nm (TSL260R)Compact 3-Lead Plastic Package Single Voltage Supply Operation Low Dark (Offset) Voltage10mV Max Low Supply Current11 mA Typical Wide Supply-Voltage Range 27 V to 55 V Replacements for TSL260 TSL261 and TSL262 RoHS Compliant (minusLF Package Only)

PACKAGE S

SIDELOOKER

(FRONT VIEW)

1 2 3

VDD GND OUT

PACKAGE Sm SURFACE MOUNTSIDELOOKER

(FRONT VIEW)

1 2 3

VDD GND OUT

There are three connecting pins for the optical sensor they are

1 Vdd voltage input pin2 GND ground pin3 OUT analog out put pin

We have to connect the voltage input pin indicated as number 1 to the RABBIT BL2000 voltage supply terminal or power supply ie screw terminal J2 pin 12The ground pin indicated as number 2 is connected manually to screw terminal J9 pin 12 of RABBIT BL2000 The output pin indicated as number 3 shown in above diagram is connected to RABBIT BL2000 ADC channel 0 input screw terminal J4 pin1ADC is nothing but analog to digital converter it converts the analog input from the optical sensor into digital output either logical one or logical zero its nothing but circuit ldquoonrdquo and ldquooffrdquoIf the sensor is detecting the signal from the transmitter it shows no activity if the sensor dosnt detect the signal its count is incremented or decremented which is i++ or imdashin the dynamic c programIn this project iam using a low input and output sensors such as TSL260R TSL261R and TSL262R are infrared light-to-

voltage optical sensorseach combining a photodiode and a transimpedance amplifier(feedback resistor = 16M^8M^and 28M^ respectively) on a single monolithic ICoutput voltage is directly proportional to the light intensity (irradiance) on the photodiode as rabbit board supports the specified voltage and current input and output specificationsThe optical sensor range or light intensity is measured in nanometers ie ldquonmrdquo

Pin connections diagram

Description of sensor

The TSL260RTSL261R and TSL262R are infrared light-to-voltage optical sensorseach combining a photodiode and a transimpedance amplifier(feedback resistor = 16M^8M^and 28M^ respectively) on a single monolithic ICoutput voltage is directly proportional to the light intensity (irradiance) on the photodiode

These devices have improved amplifier offset-voltage stability and low power consumption and are supplied in a 3-lead plastic siderlooker package with an integral visible light cutoff filter and lensewhen supplied in the lead (Pb) free packagethe device is RoHS compliant

Functional diagram of sensor logic

Terminal functions

GND 1 Ground (substrate) All voltages are referenced to GND

OUT 2 output voltage

VDD 3 supply voltage

Absolute Maximum Rating over operating free-air temperature range (unless otherwise noted)

Supply voltage VDDhelliphelliphelliphelliphelliphelliphelliphelliphelliphellip6V

Output current Iohelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip+ -10mA

Duration of shortest-circuit current at (or below ) 25ordmchelliphelliphelliphelliphelliphelliphelliphelliphelliphellip5s

Operating free-air temperature range TAhelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip-25ordmC to 85ordmC

Storage temperature rangeTstghelliphelliphelliphelliphelliphelliphelliphellip -25ordmC to -85ordmC

Lead temperature 16mm(16 inch) from case for 10 seconds ( s package ) helliphelliphelliphelliphellip260ordmC

Reflow solderin accordance with j-std -020c or j-std-020d (SM package)helliphelliphelliphelliphelliphelliphellip260ordmC

Note

stresses beyondthose listed under absolute maximum ratings may cause permanent damage to the device

These are stress ratings only and functional operation of the device at these or any other conditions beyond those indicated under recommended operating conditions is not implied

Exposure to absolute-maximum-rated conditions for extended periods may affect device relaiability

All the voltages are with respect to the GND

Output may be shorted to supply

Recommended operating conditions

Supply voltage VDD helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipmin 27 volts and max 55 volts

Operating free-air temperatureTAhelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipmin 0ordmchelliphelliphelliphellipmax 70ordmc

The device operates at a minimum of 27 v and maximum of 55 v at proper conditions these are the the best specification values that made me to choose these type of sensor and moreover these are compatable with the advanced computing single module rabbit BL2000 motherboardThese temperature values also give a good result of output

Electrical characteristics at VDD = 5v TA = 25ordmcLp =940 nm RL =10K^

VD dark voltage min and max values are same for all models of devices TSL260RTSL261RTSL262R that is min 0 max 10 and type is 4 in mv

DATA SHEET

Electrical characteristic chart

V output voltage

Ee=18(Wcmsup2Ee=46(Wcmsup2Ee=220(Wcmsup2

min1 typ 2 max3

vMin1 typ2 max 3

Min1 typ2 max3

IDD supply current

Ee=18(Wcmsup2 Typ 11 max 17

mA

Ee=46(Wcmsup2 Typ11 max17

Ee=220(Wcmsup2 Typ11 max 17

Ne irradiance

Typ 111 435 91 mV(Wcmsup2)

VoM max output voltage

VDD = 45V min3 typ 33 Min3 typ 33 Min3 typ 33 v

Dynamic characteristics of the sensor at TA = 25ordm c

Parameter Testconditions TSL260R TSL261R TSL262RMin type max Min typ max Min typ

maxtr output pulse risetime

VDD=5v Lp= 940nm 260 70 7

Tr output falltime VDD=5v Lp=940nm 260 70 7Vn output noise voltage

VDD=5v Ee=0f=1000Hz

08 07 06(v0Hz

Depending on the purpose of client we can take any of the three models and these photo transistors were made by a company called TEXAS ADVANCED OPTO ELECTRONICS SOLUTIONSThere are varied range of opto devices to make our task done but by considering all the factors like response refresh rate and other atmospheric temperature and light conditionsSome time voltage flickers may cause irrelavent responcive signal and causes a bad output or missleneous output ranges which causes mismatch with the Dynamic c programresults to no functioning the device

Reference helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipwwwtaosincom

Typical characteristics

This is a graph taken at different temperature levels of the sensor

Circuit

LIGHT SOURCE

We can use a strong source of light tramission such as light emmiting diodes or laser light depending on the purpose if we use LEDrsquos that are low power consumption and low emission rates so some times signal may not be detected by the optical sensor and the program may leads to crash the BL2000so for this purpose we are using laser light source with an external input battery or powersupply

About BL2000

Description

The BL2000 gives OEM designers optional Ethernet connectivity in a low-cost high-

performance single-board computer These compact boards are rich with the digital IO AD

and DA designers need for embedded control and monitoring applications and the BL2000s

compact board size of 415 x 343 (105 mm x 87 mm) allows for easy integration Ethernet

models are ideal for remotely monitoring and supervising another programmable system or web-

enabling new or existing products

Features

10Base-T Ethernet with RJ-45

Up to 28 digital IO

Up to 11 AD and 2 DA

4 serial ports

Optional 512K Flash 512K SRAM

Onboard relay

The BL2000 models are available in four configurations-two with Ethernet two without-and

feature up to 28 digital IO (including 5 or 7 dual-purpose analog or digital inputs) 3 RS-

232485 serial ports (plus one programming port) Rabbitreg 2000 microprocessor at 221 MHz

128K SRAM and 256K Flash onboard SPDT relay LEDs 7 timers and battery-backed real-

time clock

For the most demanding applications the BL2000 and BL2020 models include 4 channels of 12-

bit resolution AD input 5 channels of dual-purpose input and 2 channels of 12-bit DA output

For applications not requiring high-resolution analog IO the BL2010 and BL2030 offer 4

channels of 10-bit resolution AD input and 7 channels of dual-purpose input The dual-purpose

inputs are software configurable as analog inputs or programmable-threshold digital inputs

All BL2000 models can be programmed and debugged over EthernetInternet using appropriate

accessory hardware Systems with built-in 10Base-T Ethernet can be directly controlled and

monitored across networks or the Internet and can also open sockets to remote devices serve

web pages or send E-mail

Programming the BL2000 Single-Board Computer

Programs are developed using Rabbits industry-proven Dynamic Creg software development

system An extensive library of drivers and sample programs is provided along with royalty-free

TCPIP stack with source All BL2000 models can be programmed and debugged over

EthernetInternet using appropriate accessory hardware

pin diagram of rabbit BL2000

Power Supply PinsInstead of connecting an AC adapter to the power supply jack J7 the input power supply(9 V to 40 V DC) may be connected to pins 12 and 11 on header J2 (see Figure 6(a) orFigure 6(b))Pin 12 on header J9 or J10 is normally GND by factory default but may be changed toVcc by removing resistor R161 and installing resistor R160power Supplyrdquo for more information on this configuration and for information on backupbattery options

About Dynamic c

overview

Dynamic C has been in use worldwide since 1989 It is specially designed for programming embedded systems and features quick compile and interactive debugging A complete reference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menu

The advantage of working in RAM is to save wear on the flash memory which is limited to about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAM

NOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memory

NOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizes

Developing software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

Dynamic C has a number of standard featuresbull Full-feature source andor assembly-level debugger no in-circuit emulator requiredbull Royalty-free TCPIP stack with source code and most common protocolsbull Hundreds of functions in source-code libraries and sample programs1048664 Exceptionally fast support for floating-point arithmetic and transcendental functions1048664 RS-232 and RS-485 serial communication1048664 Analog and digital IO drivers1048664 I2C SPI GPS file system1048664 LCD display and keypad driversbull Powerful language extensions for cooperative or preemptive multitaskingbull Loader utility program to load binary images into Rabbit-based targets in the absenceof Dynamic Cbull Provision for customers to create their own source code libraries and augment on-linehelp by creating ldquofunction descriptionrdquo block comments using a special format forlibrary functionsbull Standard debugging features1048664 BreakpointsmdashSet breakpoints that can disable interrupts1048664 Single-steppingmdashStep into or over functions at a source or machine code level μCOS-II aware1048664 Code disassemblymdashThe disassembly window displays addresses opcodes mnemonics andmachine cycle times Switch between debugging at machine-code level and source-code level bysimply opening or closing the disassembly window1048664 Watch expressionsmdashWatch expressions are compiled when defined so complex expressionsincluding function calls may be placed into watch expressions Watch expressions can be updatedwith or without stopping program execution

1048664 Register windowmdashAll processor registers and flags are displayed The contents of general registersmay be modified in the window by the user1048664 Stack windowmdashshows the contents of the top of the stack1048664 Hex memory dumpmdashdisplays the contents of memory at any address1048664 STDIO windowmdashprintf outputs to this window and keyboard input on the host PC can bedetected for debugging purposes printf output may also be sent to a serial port or file

Board InitializationCall this function at the beginning of your program This function initializes the system IO ports andloads all the AD and DAC calibration constants from flash memory into SRAM for use by your programThe ports are initialized as follows

void brdInit (void)Port IO Function Output FunctionStatePA0 Output OUT0RELAYLED_DS4 High-Current DriverOffPA1 Output OUT1LED_DS5 High-Current DriverOffPA2 Output OUT2LED_DS6 High-Current DriverOffPA3 Output OUT3LED_DS7 High-Current DriverOffPA4 Output OUT4 High-Current DriverOffPA5 Output OUT5 High-Current DriverOffPA6 Output OUT6 High-Current DriverOffPA7 Output OUT7 High-Current DriverOffPB0 Input IN6 NAPB1 Input CLKA NAPB2 Input IN7 NAPB3 Input IN8 NAPB4 Input IN9 NAPB5 Input IN10 NAPB6 Output RS485_EN OffPB7 Output UPGOOD Bad Indicator OffPC0 Output TXD RS-485 Inactive highPC1 Input RXD RS-485 NA

The light source or the change in the light range is taken as the input for the Dynamic c program and it is converted by the analog to digital converter ports processed and compiled by the rabbit processorThe voltage range variation makes the program to count the voltage in as addition and voltage out as the subtraction from the total customers It is menctioned as T in the program

SOFTWARE CODDING

PROGRAMM

void main()

int ijT

i=0

j=0

auto float voltageinvoltageout

brdInit()

voltagein = anaInVolts(pin number)

voltageout = anaInVolts(pin number)

for()

if (voltageinlt25)

i++

printf(total number of customers today d ni)

if (voltageoutlt25)

j++

T=i-j

printf(customers presence in the store= d nT)

some of the commands which were used to complete the task success are as follows

(1) kbhit

syntax int kbhit(void)

description detects keystrokes in the Dynamic C studio window

Return value 0 If a key has been pressed 0 otherwise

Library UTILLIB

(2) float anaInVolts(unsigned int channel) discription Reads the state of an AD converter input channel and uses the previously set calibration constants to convert it to volts

PARAMETER channel is the AD converter input channel (0ndash10)

RETURN VALUE A voltage value corresponding to the voltage on the analog input channel SEE ALSOanaIn anaInCalib brdInit

(3) void anaInCalib(int channel int value1float volts1 int value2 float volts2)

Calibrates the response of the AD converter channel as a linear function using the two conversion pointsprovided Gain and offset constants are calculated and placed into global table _adcInCalibPARAMETERSchannel is the AD converter input channel (0ndash10)value1 is the first AD converter channel valuevolts1 is the voltage corresponding to the first AD converter channel valuevalue2 is the second AD converter channel valuevolts2 is the voltage corresponding to the second AD converter channel valueRETURN VALUE0 if successful-1 if not able to make calibration constantsCommands used

anaIn anaInVolts brdInitReads the voltage of an analog input channel by serially clocking out an 8-bit command to the AD converterdevice of the following formats

TLC2543 commandsD7ndashD4Channel 0 - 10Channel 11 = (Vref+ - Vref-)2Channel 12 = Vref-

Channel 13 = Vref+

Channel 14 = software powerdownD3-D2Output data length01mdash8 bits00mdash12 bits (normally used as default)11mdash16 bits (not supported by driver)D1Output data format0mdashMSB first1mdashLSB first (not supported by driver)D0Mode of operation0mdashUnipolar (normally used as default)1mdashBipolar

Example Programms which pioneered for the main program

Sample server program

This sample program shows how to use the for loops in the Dynamic c programming language

server program

define TCPCONFIG1

use ldquodcrtcplibrdquo

use ldquohttplibrdquo

ximport ldquodworkhellowwwhtmlrdquohellowww_html

SSPEC_MIMETABLE_START

SSPEC_MIME(ldquohtmlrdquordquotexthtmlrdquo)

SSPEC_MIMETABLE_END

SSPEC_RESOURCETABLE_START

SSPEC_RESOURCE_XMEMFILE(ldquohellowwwhtmlrdquohellowww_html)

SSPEC_RESOURCETABLE_END

void main()

sock_init()

http_init()

for()

http_handler()

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

PACKAGE Sm SURFACE MOUNTSIDELOOKER

(FRONT VIEW)

1 2 3

VDD GND OUT

There are three connecting pins for the optical sensor they are

1 Vdd voltage input pin2 GND ground pin3 OUT analog out put pin

We have to connect the voltage input pin indicated as number 1 to the RABBIT BL2000 voltage supply terminal or power supply ie screw terminal J2 pin 12The ground pin indicated as number 2 is connected manually to screw terminal J9 pin 12 of RABBIT BL2000 The output pin indicated as number 3 shown in above diagram is connected to RABBIT BL2000 ADC channel 0 input screw terminal J4 pin1ADC is nothing but analog to digital converter it converts the analog input from the optical sensor into digital output either logical one or logical zero its nothing but circuit ldquoonrdquo and ldquooffrdquoIf the sensor is detecting the signal from the transmitter it shows no activity if the sensor dosnt detect the signal its count is incremented or decremented which is i++ or imdashin the dynamic c programIn this project iam using a low input and output sensors such as TSL260R TSL261R and TSL262R are infrared light-to-

voltage optical sensorseach combining a photodiode and a transimpedance amplifier(feedback resistor = 16M^8M^and 28M^ respectively) on a single monolithic ICoutput voltage is directly proportional to the light intensity (irradiance) on the photodiode as rabbit board supports the specified voltage and current input and output specificationsThe optical sensor range or light intensity is measured in nanometers ie ldquonmrdquo

Pin connections diagram

Description of sensor

The TSL260RTSL261R and TSL262R are infrared light-to-voltage optical sensorseach combining a photodiode and a transimpedance amplifier(feedback resistor = 16M^8M^and 28M^ respectively) on a single monolithic ICoutput voltage is directly proportional to the light intensity (irradiance) on the photodiode

These devices have improved amplifier offset-voltage stability and low power consumption and are supplied in a 3-lead plastic siderlooker package with an integral visible light cutoff filter and lensewhen supplied in the lead (Pb) free packagethe device is RoHS compliant

Functional diagram of sensor logic

Terminal functions

GND 1 Ground (substrate) All voltages are referenced to GND

OUT 2 output voltage

VDD 3 supply voltage

Absolute Maximum Rating over operating free-air temperature range (unless otherwise noted)

Supply voltage VDDhelliphelliphelliphelliphelliphelliphelliphelliphelliphellip6V

Output current Iohelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip+ -10mA

Duration of shortest-circuit current at (or below ) 25ordmchelliphelliphelliphelliphelliphelliphelliphelliphelliphellip5s

Operating free-air temperature range TAhelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip-25ordmC to 85ordmC

Storage temperature rangeTstghelliphelliphelliphelliphelliphelliphelliphellip -25ordmC to -85ordmC

Lead temperature 16mm(16 inch) from case for 10 seconds ( s package ) helliphelliphelliphelliphellip260ordmC

Reflow solderin accordance with j-std -020c or j-std-020d (SM package)helliphelliphelliphelliphelliphelliphellip260ordmC

Note

stresses beyondthose listed under absolute maximum ratings may cause permanent damage to the device

These are stress ratings only and functional operation of the device at these or any other conditions beyond those indicated under recommended operating conditions is not implied

Exposure to absolute-maximum-rated conditions for extended periods may affect device relaiability

All the voltages are with respect to the GND

Output may be shorted to supply

Recommended operating conditions

Supply voltage VDD helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipmin 27 volts and max 55 volts

Operating free-air temperatureTAhelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipmin 0ordmchelliphelliphelliphellipmax 70ordmc

The device operates at a minimum of 27 v and maximum of 55 v at proper conditions these are the the best specification values that made me to choose these type of sensor and moreover these are compatable with the advanced computing single module rabbit BL2000 motherboardThese temperature values also give a good result of output

Electrical characteristics at VDD = 5v TA = 25ordmcLp =940 nm RL =10K^

VD dark voltage min and max values are same for all models of devices TSL260RTSL261RTSL262R that is min 0 max 10 and type is 4 in mv

DATA SHEET

Electrical characteristic chart

V output voltage

Ee=18(Wcmsup2Ee=46(Wcmsup2Ee=220(Wcmsup2

min1 typ 2 max3

vMin1 typ2 max 3

Min1 typ2 max3

IDD supply current

Ee=18(Wcmsup2 Typ 11 max 17

mA

Ee=46(Wcmsup2 Typ11 max17

Ee=220(Wcmsup2 Typ11 max 17

Ne irradiance

Typ 111 435 91 mV(Wcmsup2)

VoM max output voltage

VDD = 45V min3 typ 33 Min3 typ 33 Min3 typ 33 v

Dynamic characteristics of the sensor at TA = 25ordm c

Parameter Testconditions TSL260R TSL261R TSL262RMin type max Min typ max Min typ

maxtr output pulse risetime

VDD=5v Lp= 940nm 260 70 7

Tr output falltime VDD=5v Lp=940nm 260 70 7Vn output noise voltage

VDD=5v Ee=0f=1000Hz

08 07 06(v0Hz

Depending on the purpose of client we can take any of the three models and these photo transistors were made by a company called TEXAS ADVANCED OPTO ELECTRONICS SOLUTIONSThere are varied range of opto devices to make our task done but by considering all the factors like response refresh rate and other atmospheric temperature and light conditionsSome time voltage flickers may cause irrelavent responcive signal and causes a bad output or missleneous output ranges which causes mismatch with the Dynamic c programresults to no functioning the device

Reference helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipwwwtaosincom

Typical characteristics

This is a graph taken at different temperature levels of the sensor

Circuit

LIGHT SOURCE

We can use a strong source of light tramission such as light emmiting diodes or laser light depending on the purpose if we use LEDrsquos that are low power consumption and low emission rates so some times signal may not be detected by the optical sensor and the program may leads to crash the BL2000so for this purpose we are using laser light source with an external input battery or powersupply

About BL2000

Description

The BL2000 gives OEM designers optional Ethernet connectivity in a low-cost high-

performance single-board computer These compact boards are rich with the digital IO AD

and DA designers need for embedded control and monitoring applications and the BL2000s

compact board size of 415 x 343 (105 mm x 87 mm) allows for easy integration Ethernet

models are ideal for remotely monitoring and supervising another programmable system or web-

enabling new or existing products

Features

10Base-T Ethernet with RJ-45

Up to 28 digital IO

Up to 11 AD and 2 DA

4 serial ports

Optional 512K Flash 512K SRAM

Onboard relay

The BL2000 models are available in four configurations-two with Ethernet two without-and

feature up to 28 digital IO (including 5 or 7 dual-purpose analog or digital inputs) 3 RS-

232485 serial ports (plus one programming port) Rabbitreg 2000 microprocessor at 221 MHz

128K SRAM and 256K Flash onboard SPDT relay LEDs 7 timers and battery-backed real-

time clock

For the most demanding applications the BL2000 and BL2020 models include 4 channels of 12-

bit resolution AD input 5 channels of dual-purpose input and 2 channels of 12-bit DA output

For applications not requiring high-resolution analog IO the BL2010 and BL2030 offer 4

channels of 10-bit resolution AD input and 7 channels of dual-purpose input The dual-purpose

inputs are software configurable as analog inputs or programmable-threshold digital inputs

All BL2000 models can be programmed and debugged over EthernetInternet using appropriate

accessory hardware Systems with built-in 10Base-T Ethernet can be directly controlled and

monitored across networks or the Internet and can also open sockets to remote devices serve

web pages or send E-mail

Programming the BL2000 Single-Board Computer

Programs are developed using Rabbits industry-proven Dynamic Creg software development

system An extensive library of drivers and sample programs is provided along with royalty-free

TCPIP stack with source All BL2000 models can be programmed and debugged over

EthernetInternet using appropriate accessory hardware

pin diagram of rabbit BL2000

Power Supply PinsInstead of connecting an AC adapter to the power supply jack J7 the input power supply(9 V to 40 V DC) may be connected to pins 12 and 11 on header J2 (see Figure 6(a) orFigure 6(b))Pin 12 on header J9 or J10 is normally GND by factory default but may be changed toVcc by removing resistor R161 and installing resistor R160power Supplyrdquo for more information on this configuration and for information on backupbattery options

About Dynamic c

overview

Dynamic C has been in use worldwide since 1989 It is specially designed for programming embedded systems and features quick compile and interactive debugging A complete reference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menu

The advantage of working in RAM is to save wear on the flash memory which is limited to about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAM

NOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memory

NOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizes

Developing software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

Dynamic C has a number of standard featuresbull Full-feature source andor assembly-level debugger no in-circuit emulator requiredbull Royalty-free TCPIP stack with source code and most common protocolsbull Hundreds of functions in source-code libraries and sample programs1048664 Exceptionally fast support for floating-point arithmetic and transcendental functions1048664 RS-232 and RS-485 serial communication1048664 Analog and digital IO drivers1048664 I2C SPI GPS file system1048664 LCD display and keypad driversbull Powerful language extensions for cooperative or preemptive multitaskingbull Loader utility program to load binary images into Rabbit-based targets in the absenceof Dynamic Cbull Provision for customers to create their own source code libraries and augment on-linehelp by creating ldquofunction descriptionrdquo block comments using a special format forlibrary functionsbull Standard debugging features1048664 BreakpointsmdashSet breakpoints that can disable interrupts1048664 Single-steppingmdashStep into or over functions at a source or machine code level μCOS-II aware1048664 Code disassemblymdashThe disassembly window displays addresses opcodes mnemonics andmachine cycle times Switch between debugging at machine-code level and source-code level bysimply opening or closing the disassembly window1048664 Watch expressionsmdashWatch expressions are compiled when defined so complex expressionsincluding function calls may be placed into watch expressions Watch expressions can be updatedwith or without stopping program execution

1048664 Register windowmdashAll processor registers and flags are displayed The contents of general registersmay be modified in the window by the user1048664 Stack windowmdashshows the contents of the top of the stack1048664 Hex memory dumpmdashdisplays the contents of memory at any address1048664 STDIO windowmdashprintf outputs to this window and keyboard input on the host PC can bedetected for debugging purposes printf output may also be sent to a serial port or file

Board InitializationCall this function at the beginning of your program This function initializes the system IO ports andloads all the AD and DAC calibration constants from flash memory into SRAM for use by your programThe ports are initialized as follows

void brdInit (void)Port IO Function Output FunctionStatePA0 Output OUT0RELAYLED_DS4 High-Current DriverOffPA1 Output OUT1LED_DS5 High-Current DriverOffPA2 Output OUT2LED_DS6 High-Current DriverOffPA3 Output OUT3LED_DS7 High-Current DriverOffPA4 Output OUT4 High-Current DriverOffPA5 Output OUT5 High-Current DriverOffPA6 Output OUT6 High-Current DriverOffPA7 Output OUT7 High-Current DriverOffPB0 Input IN6 NAPB1 Input CLKA NAPB2 Input IN7 NAPB3 Input IN8 NAPB4 Input IN9 NAPB5 Input IN10 NAPB6 Output RS485_EN OffPB7 Output UPGOOD Bad Indicator OffPC0 Output TXD RS-485 Inactive highPC1 Input RXD RS-485 NA

The light source or the change in the light range is taken as the input for the Dynamic c program and it is converted by the analog to digital converter ports processed and compiled by the rabbit processorThe voltage range variation makes the program to count the voltage in as addition and voltage out as the subtraction from the total customers It is menctioned as T in the program

SOFTWARE CODDING

PROGRAMM

void main()

int ijT

i=0

j=0

auto float voltageinvoltageout

brdInit()

voltagein = anaInVolts(pin number)

voltageout = anaInVolts(pin number)

for()

if (voltageinlt25)

i++

printf(total number of customers today d ni)

if (voltageoutlt25)

j++

T=i-j

printf(customers presence in the store= d nT)

some of the commands which were used to complete the task success are as follows

(1) kbhit

syntax int kbhit(void)

description detects keystrokes in the Dynamic C studio window

Return value 0 If a key has been pressed 0 otherwise

Library UTILLIB

(2) float anaInVolts(unsigned int channel) discription Reads the state of an AD converter input channel and uses the previously set calibration constants to convert it to volts

PARAMETER channel is the AD converter input channel (0ndash10)

RETURN VALUE A voltage value corresponding to the voltage on the analog input channel SEE ALSOanaIn anaInCalib brdInit

(3) void anaInCalib(int channel int value1float volts1 int value2 float volts2)

Calibrates the response of the AD converter channel as a linear function using the two conversion pointsprovided Gain and offset constants are calculated and placed into global table _adcInCalibPARAMETERSchannel is the AD converter input channel (0ndash10)value1 is the first AD converter channel valuevolts1 is the voltage corresponding to the first AD converter channel valuevalue2 is the second AD converter channel valuevolts2 is the voltage corresponding to the second AD converter channel valueRETURN VALUE0 if successful-1 if not able to make calibration constantsCommands used

anaIn anaInVolts brdInitReads the voltage of an analog input channel by serially clocking out an 8-bit command to the AD converterdevice of the following formats

TLC2543 commandsD7ndashD4Channel 0 - 10Channel 11 = (Vref+ - Vref-)2Channel 12 = Vref-

Channel 13 = Vref+

Channel 14 = software powerdownD3-D2Output data length01mdash8 bits00mdash12 bits (normally used as default)11mdash16 bits (not supported by driver)D1Output data format0mdashMSB first1mdashLSB first (not supported by driver)D0Mode of operation0mdashUnipolar (normally used as default)1mdashBipolar

Example Programms which pioneered for the main program

Sample server program

This sample program shows how to use the for loops in the Dynamic c programming language

server program

define TCPCONFIG1

use ldquodcrtcplibrdquo

use ldquohttplibrdquo

ximport ldquodworkhellowwwhtmlrdquohellowww_html

SSPEC_MIMETABLE_START

SSPEC_MIME(ldquohtmlrdquordquotexthtmlrdquo)

SSPEC_MIMETABLE_END

SSPEC_RESOURCETABLE_START

SSPEC_RESOURCE_XMEMFILE(ldquohellowwwhtmlrdquohellowww_html)

SSPEC_RESOURCETABLE_END

void main()

sock_init()

http_init()

for()

http_handler()

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

voltage optical sensorseach combining a photodiode and a transimpedance amplifier(feedback resistor = 16M^8M^and 28M^ respectively) on a single monolithic ICoutput voltage is directly proportional to the light intensity (irradiance) on the photodiode as rabbit board supports the specified voltage and current input and output specificationsThe optical sensor range or light intensity is measured in nanometers ie ldquonmrdquo

Pin connections diagram

Description of sensor

The TSL260RTSL261R and TSL262R are infrared light-to-voltage optical sensorseach combining a photodiode and a transimpedance amplifier(feedback resistor = 16M^8M^and 28M^ respectively) on a single monolithic ICoutput voltage is directly proportional to the light intensity (irradiance) on the photodiode

These devices have improved amplifier offset-voltage stability and low power consumption and are supplied in a 3-lead plastic siderlooker package with an integral visible light cutoff filter and lensewhen supplied in the lead (Pb) free packagethe device is RoHS compliant

Functional diagram of sensor logic

Terminal functions

GND 1 Ground (substrate) All voltages are referenced to GND

OUT 2 output voltage

VDD 3 supply voltage

Absolute Maximum Rating over operating free-air temperature range (unless otherwise noted)

Supply voltage VDDhelliphelliphelliphelliphelliphelliphelliphelliphelliphellip6V

Output current Iohelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip+ -10mA

Duration of shortest-circuit current at (or below ) 25ordmchelliphelliphelliphelliphelliphelliphelliphelliphelliphellip5s

Operating free-air temperature range TAhelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip-25ordmC to 85ordmC

Storage temperature rangeTstghelliphelliphelliphelliphelliphelliphelliphellip -25ordmC to -85ordmC

Lead temperature 16mm(16 inch) from case for 10 seconds ( s package ) helliphelliphelliphelliphellip260ordmC

Reflow solderin accordance with j-std -020c or j-std-020d (SM package)helliphelliphelliphelliphelliphelliphellip260ordmC

Note

stresses beyondthose listed under absolute maximum ratings may cause permanent damage to the device

These are stress ratings only and functional operation of the device at these or any other conditions beyond those indicated under recommended operating conditions is not implied

Exposure to absolute-maximum-rated conditions for extended periods may affect device relaiability

All the voltages are with respect to the GND

Output may be shorted to supply

Recommended operating conditions

Supply voltage VDD helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipmin 27 volts and max 55 volts

Operating free-air temperatureTAhelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipmin 0ordmchelliphelliphelliphellipmax 70ordmc

The device operates at a minimum of 27 v and maximum of 55 v at proper conditions these are the the best specification values that made me to choose these type of sensor and moreover these are compatable with the advanced computing single module rabbit BL2000 motherboardThese temperature values also give a good result of output

Electrical characteristics at VDD = 5v TA = 25ordmcLp =940 nm RL =10K^

VD dark voltage min and max values are same for all models of devices TSL260RTSL261RTSL262R that is min 0 max 10 and type is 4 in mv

DATA SHEET

Electrical characteristic chart

V output voltage

Ee=18(Wcmsup2Ee=46(Wcmsup2Ee=220(Wcmsup2

min1 typ 2 max3

vMin1 typ2 max 3

Min1 typ2 max3

IDD supply current

Ee=18(Wcmsup2 Typ 11 max 17

mA

Ee=46(Wcmsup2 Typ11 max17

Ee=220(Wcmsup2 Typ11 max 17

Ne irradiance

Typ 111 435 91 mV(Wcmsup2)

VoM max output voltage

VDD = 45V min3 typ 33 Min3 typ 33 Min3 typ 33 v

Dynamic characteristics of the sensor at TA = 25ordm c

Parameter Testconditions TSL260R TSL261R TSL262RMin type max Min typ max Min typ

maxtr output pulse risetime

VDD=5v Lp= 940nm 260 70 7

Tr output falltime VDD=5v Lp=940nm 260 70 7Vn output noise voltage

VDD=5v Ee=0f=1000Hz

08 07 06(v0Hz

Depending on the purpose of client we can take any of the three models and these photo transistors were made by a company called TEXAS ADVANCED OPTO ELECTRONICS SOLUTIONSThere are varied range of opto devices to make our task done but by considering all the factors like response refresh rate and other atmospheric temperature and light conditionsSome time voltage flickers may cause irrelavent responcive signal and causes a bad output or missleneous output ranges which causes mismatch with the Dynamic c programresults to no functioning the device

Reference helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipwwwtaosincom

Typical characteristics

This is a graph taken at different temperature levels of the sensor

Circuit

LIGHT SOURCE

We can use a strong source of light tramission such as light emmiting diodes or laser light depending on the purpose if we use LEDrsquos that are low power consumption and low emission rates so some times signal may not be detected by the optical sensor and the program may leads to crash the BL2000so for this purpose we are using laser light source with an external input battery or powersupply

About BL2000

Description

The BL2000 gives OEM designers optional Ethernet connectivity in a low-cost high-

performance single-board computer These compact boards are rich with the digital IO AD

and DA designers need for embedded control and monitoring applications and the BL2000s

compact board size of 415 x 343 (105 mm x 87 mm) allows for easy integration Ethernet

models are ideal for remotely monitoring and supervising another programmable system or web-

enabling new or existing products

Features

10Base-T Ethernet with RJ-45

Up to 28 digital IO

Up to 11 AD and 2 DA

4 serial ports

Optional 512K Flash 512K SRAM

Onboard relay

The BL2000 models are available in four configurations-two with Ethernet two without-and

feature up to 28 digital IO (including 5 or 7 dual-purpose analog or digital inputs) 3 RS-

232485 serial ports (plus one programming port) Rabbitreg 2000 microprocessor at 221 MHz

128K SRAM and 256K Flash onboard SPDT relay LEDs 7 timers and battery-backed real-

time clock

For the most demanding applications the BL2000 and BL2020 models include 4 channels of 12-

bit resolution AD input 5 channels of dual-purpose input and 2 channels of 12-bit DA output

For applications not requiring high-resolution analog IO the BL2010 and BL2030 offer 4

channels of 10-bit resolution AD input and 7 channels of dual-purpose input The dual-purpose

inputs are software configurable as analog inputs or programmable-threshold digital inputs

All BL2000 models can be programmed and debugged over EthernetInternet using appropriate

accessory hardware Systems with built-in 10Base-T Ethernet can be directly controlled and

monitored across networks or the Internet and can also open sockets to remote devices serve

web pages or send E-mail

Programming the BL2000 Single-Board Computer

Programs are developed using Rabbits industry-proven Dynamic Creg software development

system An extensive library of drivers and sample programs is provided along with royalty-free

TCPIP stack with source All BL2000 models can be programmed and debugged over

EthernetInternet using appropriate accessory hardware

pin diagram of rabbit BL2000

Power Supply PinsInstead of connecting an AC adapter to the power supply jack J7 the input power supply(9 V to 40 V DC) may be connected to pins 12 and 11 on header J2 (see Figure 6(a) orFigure 6(b))Pin 12 on header J9 or J10 is normally GND by factory default but may be changed toVcc by removing resistor R161 and installing resistor R160power Supplyrdquo for more information on this configuration and for information on backupbattery options

About Dynamic c

overview

Dynamic C has been in use worldwide since 1989 It is specially designed for programming embedded systems and features quick compile and interactive debugging A complete reference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menu

The advantage of working in RAM is to save wear on the flash memory which is limited to about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAM

NOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memory

NOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizes

Developing software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

Dynamic C has a number of standard featuresbull Full-feature source andor assembly-level debugger no in-circuit emulator requiredbull Royalty-free TCPIP stack with source code and most common protocolsbull Hundreds of functions in source-code libraries and sample programs1048664 Exceptionally fast support for floating-point arithmetic and transcendental functions1048664 RS-232 and RS-485 serial communication1048664 Analog and digital IO drivers1048664 I2C SPI GPS file system1048664 LCD display and keypad driversbull Powerful language extensions for cooperative or preemptive multitaskingbull Loader utility program to load binary images into Rabbit-based targets in the absenceof Dynamic Cbull Provision for customers to create their own source code libraries and augment on-linehelp by creating ldquofunction descriptionrdquo block comments using a special format forlibrary functionsbull Standard debugging features1048664 BreakpointsmdashSet breakpoints that can disable interrupts1048664 Single-steppingmdashStep into or over functions at a source or machine code level μCOS-II aware1048664 Code disassemblymdashThe disassembly window displays addresses opcodes mnemonics andmachine cycle times Switch between debugging at machine-code level and source-code level bysimply opening or closing the disassembly window1048664 Watch expressionsmdashWatch expressions are compiled when defined so complex expressionsincluding function calls may be placed into watch expressions Watch expressions can be updatedwith or without stopping program execution

1048664 Register windowmdashAll processor registers and flags are displayed The contents of general registersmay be modified in the window by the user1048664 Stack windowmdashshows the contents of the top of the stack1048664 Hex memory dumpmdashdisplays the contents of memory at any address1048664 STDIO windowmdashprintf outputs to this window and keyboard input on the host PC can bedetected for debugging purposes printf output may also be sent to a serial port or file

Board InitializationCall this function at the beginning of your program This function initializes the system IO ports andloads all the AD and DAC calibration constants from flash memory into SRAM for use by your programThe ports are initialized as follows

void brdInit (void)Port IO Function Output FunctionStatePA0 Output OUT0RELAYLED_DS4 High-Current DriverOffPA1 Output OUT1LED_DS5 High-Current DriverOffPA2 Output OUT2LED_DS6 High-Current DriverOffPA3 Output OUT3LED_DS7 High-Current DriverOffPA4 Output OUT4 High-Current DriverOffPA5 Output OUT5 High-Current DriverOffPA6 Output OUT6 High-Current DriverOffPA7 Output OUT7 High-Current DriverOffPB0 Input IN6 NAPB1 Input CLKA NAPB2 Input IN7 NAPB3 Input IN8 NAPB4 Input IN9 NAPB5 Input IN10 NAPB6 Output RS485_EN OffPB7 Output UPGOOD Bad Indicator OffPC0 Output TXD RS-485 Inactive highPC1 Input RXD RS-485 NA

The light source or the change in the light range is taken as the input for the Dynamic c program and it is converted by the analog to digital converter ports processed and compiled by the rabbit processorThe voltage range variation makes the program to count the voltage in as addition and voltage out as the subtraction from the total customers It is menctioned as T in the program

SOFTWARE CODDING

PROGRAMM

void main()

int ijT

i=0

j=0

auto float voltageinvoltageout

brdInit()

voltagein = anaInVolts(pin number)

voltageout = anaInVolts(pin number)

for()

if (voltageinlt25)

i++

printf(total number of customers today d ni)

if (voltageoutlt25)

j++

T=i-j

printf(customers presence in the store= d nT)

some of the commands which were used to complete the task success are as follows

(1) kbhit

syntax int kbhit(void)

description detects keystrokes in the Dynamic C studio window

Return value 0 If a key has been pressed 0 otherwise

Library UTILLIB

(2) float anaInVolts(unsigned int channel) discription Reads the state of an AD converter input channel and uses the previously set calibration constants to convert it to volts

PARAMETER channel is the AD converter input channel (0ndash10)

RETURN VALUE A voltage value corresponding to the voltage on the analog input channel SEE ALSOanaIn anaInCalib brdInit

(3) void anaInCalib(int channel int value1float volts1 int value2 float volts2)

Calibrates the response of the AD converter channel as a linear function using the two conversion pointsprovided Gain and offset constants are calculated and placed into global table _adcInCalibPARAMETERSchannel is the AD converter input channel (0ndash10)value1 is the first AD converter channel valuevolts1 is the voltage corresponding to the first AD converter channel valuevalue2 is the second AD converter channel valuevolts2 is the voltage corresponding to the second AD converter channel valueRETURN VALUE0 if successful-1 if not able to make calibration constantsCommands used

anaIn anaInVolts brdInitReads the voltage of an analog input channel by serially clocking out an 8-bit command to the AD converterdevice of the following formats

TLC2543 commandsD7ndashD4Channel 0 - 10Channel 11 = (Vref+ - Vref-)2Channel 12 = Vref-

Channel 13 = Vref+

Channel 14 = software powerdownD3-D2Output data length01mdash8 bits00mdash12 bits (normally used as default)11mdash16 bits (not supported by driver)D1Output data format0mdashMSB first1mdashLSB first (not supported by driver)D0Mode of operation0mdashUnipolar (normally used as default)1mdashBipolar

Example Programms which pioneered for the main program

Sample server program

This sample program shows how to use the for loops in the Dynamic c programming language

server program

define TCPCONFIG1

use ldquodcrtcplibrdquo

use ldquohttplibrdquo

ximport ldquodworkhellowwwhtmlrdquohellowww_html

SSPEC_MIMETABLE_START

SSPEC_MIME(ldquohtmlrdquordquotexthtmlrdquo)

SSPEC_MIMETABLE_END

SSPEC_RESOURCETABLE_START

SSPEC_RESOURCE_XMEMFILE(ldquohellowwwhtmlrdquohellowww_html)

SSPEC_RESOURCETABLE_END

void main()

sock_init()

http_init()

for()

http_handler()

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

Functional diagram of sensor logic

Terminal functions

GND 1 Ground (substrate) All voltages are referenced to GND

OUT 2 output voltage

VDD 3 supply voltage

Absolute Maximum Rating over operating free-air temperature range (unless otherwise noted)

Supply voltage VDDhelliphelliphelliphelliphelliphelliphelliphelliphelliphellip6V

Output current Iohelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip+ -10mA

Duration of shortest-circuit current at (or below ) 25ordmchelliphelliphelliphelliphelliphelliphelliphelliphelliphellip5s

Operating free-air temperature range TAhelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip-25ordmC to 85ordmC

Storage temperature rangeTstghelliphelliphelliphelliphelliphelliphelliphellip -25ordmC to -85ordmC

Lead temperature 16mm(16 inch) from case for 10 seconds ( s package ) helliphelliphelliphelliphellip260ordmC

Reflow solderin accordance with j-std -020c or j-std-020d (SM package)helliphelliphelliphelliphelliphelliphellip260ordmC

Note

stresses beyondthose listed under absolute maximum ratings may cause permanent damage to the device

These are stress ratings only and functional operation of the device at these or any other conditions beyond those indicated under recommended operating conditions is not implied

Exposure to absolute-maximum-rated conditions for extended periods may affect device relaiability

All the voltages are with respect to the GND

Output may be shorted to supply

Recommended operating conditions

Supply voltage VDD helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipmin 27 volts and max 55 volts

Operating free-air temperatureTAhelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipmin 0ordmchelliphelliphelliphellipmax 70ordmc

The device operates at a minimum of 27 v and maximum of 55 v at proper conditions these are the the best specification values that made me to choose these type of sensor and moreover these are compatable with the advanced computing single module rabbit BL2000 motherboardThese temperature values also give a good result of output

Electrical characteristics at VDD = 5v TA = 25ordmcLp =940 nm RL =10K^

VD dark voltage min and max values are same for all models of devices TSL260RTSL261RTSL262R that is min 0 max 10 and type is 4 in mv

DATA SHEET

Electrical characteristic chart

V output voltage

Ee=18(Wcmsup2Ee=46(Wcmsup2Ee=220(Wcmsup2

min1 typ 2 max3

vMin1 typ2 max 3

Min1 typ2 max3

IDD supply current

Ee=18(Wcmsup2 Typ 11 max 17

mA

Ee=46(Wcmsup2 Typ11 max17

Ee=220(Wcmsup2 Typ11 max 17

Ne irradiance

Typ 111 435 91 mV(Wcmsup2)

VoM max output voltage

VDD = 45V min3 typ 33 Min3 typ 33 Min3 typ 33 v

Dynamic characteristics of the sensor at TA = 25ordm c

Parameter Testconditions TSL260R TSL261R TSL262RMin type max Min typ max Min typ

maxtr output pulse risetime

VDD=5v Lp= 940nm 260 70 7

Tr output falltime VDD=5v Lp=940nm 260 70 7Vn output noise voltage

VDD=5v Ee=0f=1000Hz

08 07 06(v0Hz

Depending on the purpose of client we can take any of the three models and these photo transistors were made by a company called TEXAS ADVANCED OPTO ELECTRONICS SOLUTIONSThere are varied range of opto devices to make our task done but by considering all the factors like response refresh rate and other atmospheric temperature and light conditionsSome time voltage flickers may cause irrelavent responcive signal and causes a bad output or missleneous output ranges which causes mismatch with the Dynamic c programresults to no functioning the device

Reference helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipwwwtaosincom

Typical characteristics

This is a graph taken at different temperature levels of the sensor

Circuit

LIGHT SOURCE

We can use a strong source of light tramission such as light emmiting diodes or laser light depending on the purpose if we use LEDrsquos that are low power consumption and low emission rates so some times signal may not be detected by the optical sensor and the program may leads to crash the BL2000so for this purpose we are using laser light source with an external input battery or powersupply

About BL2000

Description

The BL2000 gives OEM designers optional Ethernet connectivity in a low-cost high-

performance single-board computer These compact boards are rich with the digital IO AD

and DA designers need for embedded control and monitoring applications and the BL2000s

compact board size of 415 x 343 (105 mm x 87 mm) allows for easy integration Ethernet

models are ideal for remotely monitoring and supervising another programmable system or web-

enabling new or existing products

Features

10Base-T Ethernet with RJ-45

Up to 28 digital IO

Up to 11 AD and 2 DA

4 serial ports

Optional 512K Flash 512K SRAM

Onboard relay

The BL2000 models are available in four configurations-two with Ethernet two without-and

feature up to 28 digital IO (including 5 or 7 dual-purpose analog or digital inputs) 3 RS-

232485 serial ports (plus one programming port) Rabbitreg 2000 microprocessor at 221 MHz

128K SRAM and 256K Flash onboard SPDT relay LEDs 7 timers and battery-backed real-

time clock

For the most demanding applications the BL2000 and BL2020 models include 4 channels of 12-

bit resolution AD input 5 channels of dual-purpose input and 2 channels of 12-bit DA output

For applications not requiring high-resolution analog IO the BL2010 and BL2030 offer 4

channels of 10-bit resolution AD input and 7 channels of dual-purpose input The dual-purpose

inputs are software configurable as analog inputs or programmable-threshold digital inputs

All BL2000 models can be programmed and debugged over EthernetInternet using appropriate

accessory hardware Systems with built-in 10Base-T Ethernet can be directly controlled and

monitored across networks or the Internet and can also open sockets to remote devices serve

web pages or send E-mail

Programming the BL2000 Single-Board Computer

Programs are developed using Rabbits industry-proven Dynamic Creg software development

system An extensive library of drivers and sample programs is provided along with royalty-free

TCPIP stack with source All BL2000 models can be programmed and debugged over

EthernetInternet using appropriate accessory hardware

pin diagram of rabbit BL2000

Power Supply PinsInstead of connecting an AC adapter to the power supply jack J7 the input power supply(9 V to 40 V DC) may be connected to pins 12 and 11 on header J2 (see Figure 6(a) orFigure 6(b))Pin 12 on header J9 or J10 is normally GND by factory default but may be changed toVcc by removing resistor R161 and installing resistor R160power Supplyrdquo for more information on this configuration and for information on backupbattery options

About Dynamic c

overview

Dynamic C has been in use worldwide since 1989 It is specially designed for programming embedded systems and features quick compile and interactive debugging A complete reference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menu

The advantage of working in RAM is to save wear on the flash memory which is limited to about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAM

NOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memory

NOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizes

Developing software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

Dynamic C has a number of standard featuresbull Full-feature source andor assembly-level debugger no in-circuit emulator requiredbull Royalty-free TCPIP stack with source code and most common protocolsbull Hundreds of functions in source-code libraries and sample programs1048664 Exceptionally fast support for floating-point arithmetic and transcendental functions1048664 RS-232 and RS-485 serial communication1048664 Analog and digital IO drivers1048664 I2C SPI GPS file system1048664 LCD display and keypad driversbull Powerful language extensions for cooperative or preemptive multitaskingbull Loader utility program to load binary images into Rabbit-based targets in the absenceof Dynamic Cbull Provision for customers to create their own source code libraries and augment on-linehelp by creating ldquofunction descriptionrdquo block comments using a special format forlibrary functionsbull Standard debugging features1048664 BreakpointsmdashSet breakpoints that can disable interrupts1048664 Single-steppingmdashStep into or over functions at a source or machine code level μCOS-II aware1048664 Code disassemblymdashThe disassembly window displays addresses opcodes mnemonics andmachine cycle times Switch between debugging at machine-code level and source-code level bysimply opening or closing the disassembly window1048664 Watch expressionsmdashWatch expressions are compiled when defined so complex expressionsincluding function calls may be placed into watch expressions Watch expressions can be updatedwith or without stopping program execution

1048664 Register windowmdashAll processor registers and flags are displayed The contents of general registersmay be modified in the window by the user1048664 Stack windowmdashshows the contents of the top of the stack1048664 Hex memory dumpmdashdisplays the contents of memory at any address1048664 STDIO windowmdashprintf outputs to this window and keyboard input on the host PC can bedetected for debugging purposes printf output may also be sent to a serial port or file

Board InitializationCall this function at the beginning of your program This function initializes the system IO ports andloads all the AD and DAC calibration constants from flash memory into SRAM for use by your programThe ports are initialized as follows

void brdInit (void)Port IO Function Output FunctionStatePA0 Output OUT0RELAYLED_DS4 High-Current DriverOffPA1 Output OUT1LED_DS5 High-Current DriverOffPA2 Output OUT2LED_DS6 High-Current DriverOffPA3 Output OUT3LED_DS7 High-Current DriverOffPA4 Output OUT4 High-Current DriverOffPA5 Output OUT5 High-Current DriverOffPA6 Output OUT6 High-Current DriverOffPA7 Output OUT7 High-Current DriverOffPB0 Input IN6 NAPB1 Input CLKA NAPB2 Input IN7 NAPB3 Input IN8 NAPB4 Input IN9 NAPB5 Input IN10 NAPB6 Output RS485_EN OffPB7 Output UPGOOD Bad Indicator OffPC0 Output TXD RS-485 Inactive highPC1 Input RXD RS-485 NA

The light source or the change in the light range is taken as the input for the Dynamic c program and it is converted by the analog to digital converter ports processed and compiled by the rabbit processorThe voltage range variation makes the program to count the voltage in as addition and voltage out as the subtraction from the total customers It is menctioned as T in the program

SOFTWARE CODDING

PROGRAMM

void main()

int ijT

i=0

j=0

auto float voltageinvoltageout

brdInit()

voltagein = anaInVolts(pin number)

voltageout = anaInVolts(pin number)

for()

if (voltageinlt25)

i++

printf(total number of customers today d ni)

if (voltageoutlt25)

j++

T=i-j

printf(customers presence in the store= d nT)

some of the commands which were used to complete the task success are as follows

(1) kbhit

syntax int kbhit(void)

description detects keystrokes in the Dynamic C studio window

Return value 0 If a key has been pressed 0 otherwise

Library UTILLIB

(2) float anaInVolts(unsigned int channel) discription Reads the state of an AD converter input channel and uses the previously set calibration constants to convert it to volts

PARAMETER channel is the AD converter input channel (0ndash10)

RETURN VALUE A voltage value corresponding to the voltage on the analog input channel SEE ALSOanaIn anaInCalib brdInit

(3) void anaInCalib(int channel int value1float volts1 int value2 float volts2)

Calibrates the response of the AD converter channel as a linear function using the two conversion pointsprovided Gain and offset constants are calculated and placed into global table _adcInCalibPARAMETERSchannel is the AD converter input channel (0ndash10)value1 is the first AD converter channel valuevolts1 is the voltage corresponding to the first AD converter channel valuevalue2 is the second AD converter channel valuevolts2 is the voltage corresponding to the second AD converter channel valueRETURN VALUE0 if successful-1 if not able to make calibration constantsCommands used

anaIn anaInVolts brdInitReads the voltage of an analog input channel by serially clocking out an 8-bit command to the AD converterdevice of the following formats

TLC2543 commandsD7ndashD4Channel 0 - 10Channel 11 = (Vref+ - Vref-)2Channel 12 = Vref-

Channel 13 = Vref+

Channel 14 = software powerdownD3-D2Output data length01mdash8 bits00mdash12 bits (normally used as default)11mdash16 bits (not supported by driver)D1Output data format0mdashMSB first1mdashLSB first (not supported by driver)D0Mode of operation0mdashUnipolar (normally used as default)1mdashBipolar

Example Programms which pioneered for the main program

Sample server program

This sample program shows how to use the for loops in the Dynamic c programming language

server program

define TCPCONFIG1

use ldquodcrtcplibrdquo

use ldquohttplibrdquo

ximport ldquodworkhellowwwhtmlrdquohellowww_html

SSPEC_MIMETABLE_START

SSPEC_MIME(ldquohtmlrdquordquotexthtmlrdquo)

SSPEC_MIMETABLE_END

SSPEC_RESOURCETABLE_START

SSPEC_RESOURCE_XMEMFILE(ldquohellowwwhtmlrdquohellowww_html)

SSPEC_RESOURCETABLE_END

void main()

sock_init()

http_init()

for()

http_handler()

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

These are stress ratings only and functional operation of the device at these or any other conditions beyond those indicated under recommended operating conditions is not implied

Exposure to absolute-maximum-rated conditions for extended periods may affect device relaiability

All the voltages are with respect to the GND

Output may be shorted to supply

Recommended operating conditions

Supply voltage VDD helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipmin 27 volts and max 55 volts

Operating free-air temperatureTAhelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipmin 0ordmchelliphelliphelliphellipmax 70ordmc

The device operates at a minimum of 27 v and maximum of 55 v at proper conditions these are the the best specification values that made me to choose these type of sensor and moreover these are compatable with the advanced computing single module rabbit BL2000 motherboardThese temperature values also give a good result of output

Electrical characteristics at VDD = 5v TA = 25ordmcLp =940 nm RL =10K^

VD dark voltage min and max values are same for all models of devices TSL260RTSL261RTSL262R that is min 0 max 10 and type is 4 in mv

DATA SHEET

Electrical characteristic chart

V output voltage

Ee=18(Wcmsup2Ee=46(Wcmsup2Ee=220(Wcmsup2

min1 typ 2 max3

vMin1 typ2 max 3

Min1 typ2 max3

IDD supply current

Ee=18(Wcmsup2 Typ 11 max 17

mA

Ee=46(Wcmsup2 Typ11 max17

Ee=220(Wcmsup2 Typ11 max 17

Ne irradiance

Typ 111 435 91 mV(Wcmsup2)

VoM max output voltage

VDD = 45V min3 typ 33 Min3 typ 33 Min3 typ 33 v

Dynamic characteristics of the sensor at TA = 25ordm c

Parameter Testconditions TSL260R TSL261R TSL262RMin type max Min typ max Min typ

maxtr output pulse risetime

VDD=5v Lp= 940nm 260 70 7

Tr output falltime VDD=5v Lp=940nm 260 70 7Vn output noise voltage

VDD=5v Ee=0f=1000Hz

08 07 06(v0Hz

Depending on the purpose of client we can take any of the three models and these photo transistors were made by a company called TEXAS ADVANCED OPTO ELECTRONICS SOLUTIONSThere are varied range of opto devices to make our task done but by considering all the factors like response refresh rate and other atmospheric temperature and light conditionsSome time voltage flickers may cause irrelavent responcive signal and causes a bad output or missleneous output ranges which causes mismatch with the Dynamic c programresults to no functioning the device

Reference helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipwwwtaosincom

Typical characteristics

This is a graph taken at different temperature levels of the sensor

Circuit

LIGHT SOURCE

We can use a strong source of light tramission such as light emmiting diodes or laser light depending on the purpose if we use LEDrsquos that are low power consumption and low emission rates so some times signal may not be detected by the optical sensor and the program may leads to crash the BL2000so for this purpose we are using laser light source with an external input battery or powersupply

About BL2000

Description

The BL2000 gives OEM designers optional Ethernet connectivity in a low-cost high-

performance single-board computer These compact boards are rich with the digital IO AD

and DA designers need for embedded control and monitoring applications and the BL2000s

compact board size of 415 x 343 (105 mm x 87 mm) allows for easy integration Ethernet

models are ideal for remotely monitoring and supervising another programmable system or web-

enabling new or existing products

Features

10Base-T Ethernet with RJ-45

Up to 28 digital IO

Up to 11 AD and 2 DA

4 serial ports

Optional 512K Flash 512K SRAM

Onboard relay

The BL2000 models are available in four configurations-two with Ethernet two without-and

feature up to 28 digital IO (including 5 or 7 dual-purpose analog or digital inputs) 3 RS-

232485 serial ports (plus one programming port) Rabbitreg 2000 microprocessor at 221 MHz

128K SRAM and 256K Flash onboard SPDT relay LEDs 7 timers and battery-backed real-

time clock

For the most demanding applications the BL2000 and BL2020 models include 4 channels of 12-

bit resolution AD input 5 channels of dual-purpose input and 2 channels of 12-bit DA output

For applications not requiring high-resolution analog IO the BL2010 and BL2030 offer 4

channels of 10-bit resolution AD input and 7 channels of dual-purpose input The dual-purpose

inputs are software configurable as analog inputs or programmable-threshold digital inputs

All BL2000 models can be programmed and debugged over EthernetInternet using appropriate

accessory hardware Systems with built-in 10Base-T Ethernet can be directly controlled and

monitored across networks or the Internet and can also open sockets to remote devices serve

web pages or send E-mail

Programming the BL2000 Single-Board Computer

Programs are developed using Rabbits industry-proven Dynamic Creg software development

system An extensive library of drivers and sample programs is provided along with royalty-free

TCPIP stack with source All BL2000 models can be programmed and debugged over

EthernetInternet using appropriate accessory hardware

pin diagram of rabbit BL2000

Power Supply PinsInstead of connecting an AC adapter to the power supply jack J7 the input power supply(9 V to 40 V DC) may be connected to pins 12 and 11 on header J2 (see Figure 6(a) orFigure 6(b))Pin 12 on header J9 or J10 is normally GND by factory default but may be changed toVcc by removing resistor R161 and installing resistor R160power Supplyrdquo for more information on this configuration and for information on backupbattery options

About Dynamic c

overview

Dynamic C has been in use worldwide since 1989 It is specially designed for programming embedded systems and features quick compile and interactive debugging A complete reference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menu

The advantage of working in RAM is to save wear on the flash memory which is limited to about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAM

NOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memory

NOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizes

Developing software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

Dynamic C has a number of standard featuresbull Full-feature source andor assembly-level debugger no in-circuit emulator requiredbull Royalty-free TCPIP stack with source code and most common protocolsbull Hundreds of functions in source-code libraries and sample programs1048664 Exceptionally fast support for floating-point arithmetic and transcendental functions1048664 RS-232 and RS-485 serial communication1048664 Analog and digital IO drivers1048664 I2C SPI GPS file system1048664 LCD display and keypad driversbull Powerful language extensions for cooperative or preemptive multitaskingbull Loader utility program to load binary images into Rabbit-based targets in the absenceof Dynamic Cbull Provision for customers to create their own source code libraries and augment on-linehelp by creating ldquofunction descriptionrdquo block comments using a special format forlibrary functionsbull Standard debugging features1048664 BreakpointsmdashSet breakpoints that can disable interrupts1048664 Single-steppingmdashStep into or over functions at a source or machine code level μCOS-II aware1048664 Code disassemblymdashThe disassembly window displays addresses opcodes mnemonics andmachine cycle times Switch between debugging at machine-code level and source-code level bysimply opening or closing the disassembly window1048664 Watch expressionsmdashWatch expressions are compiled when defined so complex expressionsincluding function calls may be placed into watch expressions Watch expressions can be updatedwith or without stopping program execution

1048664 Register windowmdashAll processor registers and flags are displayed The contents of general registersmay be modified in the window by the user1048664 Stack windowmdashshows the contents of the top of the stack1048664 Hex memory dumpmdashdisplays the contents of memory at any address1048664 STDIO windowmdashprintf outputs to this window and keyboard input on the host PC can bedetected for debugging purposes printf output may also be sent to a serial port or file

Board InitializationCall this function at the beginning of your program This function initializes the system IO ports andloads all the AD and DAC calibration constants from flash memory into SRAM for use by your programThe ports are initialized as follows

void brdInit (void)Port IO Function Output FunctionStatePA0 Output OUT0RELAYLED_DS4 High-Current DriverOffPA1 Output OUT1LED_DS5 High-Current DriverOffPA2 Output OUT2LED_DS6 High-Current DriverOffPA3 Output OUT3LED_DS7 High-Current DriverOffPA4 Output OUT4 High-Current DriverOffPA5 Output OUT5 High-Current DriverOffPA6 Output OUT6 High-Current DriverOffPA7 Output OUT7 High-Current DriverOffPB0 Input IN6 NAPB1 Input CLKA NAPB2 Input IN7 NAPB3 Input IN8 NAPB4 Input IN9 NAPB5 Input IN10 NAPB6 Output RS485_EN OffPB7 Output UPGOOD Bad Indicator OffPC0 Output TXD RS-485 Inactive highPC1 Input RXD RS-485 NA

The light source or the change in the light range is taken as the input for the Dynamic c program and it is converted by the analog to digital converter ports processed and compiled by the rabbit processorThe voltage range variation makes the program to count the voltage in as addition and voltage out as the subtraction from the total customers It is menctioned as T in the program

SOFTWARE CODDING

PROGRAMM

void main()

int ijT

i=0

j=0

auto float voltageinvoltageout

brdInit()

voltagein = anaInVolts(pin number)

voltageout = anaInVolts(pin number)

for()

if (voltageinlt25)

i++

printf(total number of customers today d ni)

if (voltageoutlt25)

j++

T=i-j

printf(customers presence in the store= d nT)

some of the commands which were used to complete the task success are as follows

(1) kbhit

syntax int kbhit(void)

description detects keystrokes in the Dynamic C studio window

Return value 0 If a key has been pressed 0 otherwise

Library UTILLIB

(2) float anaInVolts(unsigned int channel) discription Reads the state of an AD converter input channel and uses the previously set calibration constants to convert it to volts

PARAMETER channel is the AD converter input channel (0ndash10)

RETURN VALUE A voltage value corresponding to the voltage on the analog input channel SEE ALSOanaIn anaInCalib brdInit

(3) void anaInCalib(int channel int value1float volts1 int value2 float volts2)

Calibrates the response of the AD converter channel as a linear function using the two conversion pointsprovided Gain and offset constants are calculated and placed into global table _adcInCalibPARAMETERSchannel is the AD converter input channel (0ndash10)value1 is the first AD converter channel valuevolts1 is the voltage corresponding to the first AD converter channel valuevalue2 is the second AD converter channel valuevolts2 is the voltage corresponding to the second AD converter channel valueRETURN VALUE0 if successful-1 if not able to make calibration constantsCommands used

anaIn anaInVolts brdInitReads the voltage of an analog input channel by serially clocking out an 8-bit command to the AD converterdevice of the following formats

TLC2543 commandsD7ndashD4Channel 0 - 10Channel 11 = (Vref+ - Vref-)2Channel 12 = Vref-

Channel 13 = Vref+

Channel 14 = software powerdownD3-D2Output data length01mdash8 bits00mdash12 bits (normally used as default)11mdash16 bits (not supported by driver)D1Output data format0mdashMSB first1mdashLSB first (not supported by driver)D0Mode of operation0mdashUnipolar (normally used as default)1mdashBipolar

Example Programms which pioneered for the main program

Sample server program

This sample program shows how to use the for loops in the Dynamic c programming language

server program

define TCPCONFIG1

use ldquodcrtcplibrdquo

use ldquohttplibrdquo

ximport ldquodworkhellowwwhtmlrdquohellowww_html

SSPEC_MIMETABLE_START

SSPEC_MIME(ldquohtmlrdquordquotexthtmlrdquo)

SSPEC_MIMETABLE_END

SSPEC_RESOURCETABLE_START

SSPEC_RESOURCE_XMEMFILE(ldquohellowwwhtmlrdquohellowww_html)

SSPEC_RESOURCETABLE_END

void main()

sock_init()

http_init()

for()

http_handler()

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

Electrical characteristics at VDD = 5v TA = 25ordmcLp =940 nm RL =10K^

VD dark voltage min and max values are same for all models of devices TSL260RTSL261RTSL262R that is min 0 max 10 and type is 4 in mv

DATA SHEET

Electrical characteristic chart

V output voltage

Ee=18(Wcmsup2Ee=46(Wcmsup2Ee=220(Wcmsup2

min1 typ 2 max3

vMin1 typ2 max 3

Min1 typ2 max3

IDD supply current

Ee=18(Wcmsup2 Typ 11 max 17

mA

Ee=46(Wcmsup2 Typ11 max17

Ee=220(Wcmsup2 Typ11 max 17

Ne irradiance

Typ 111 435 91 mV(Wcmsup2)

VoM max output voltage

VDD = 45V min3 typ 33 Min3 typ 33 Min3 typ 33 v

Dynamic characteristics of the sensor at TA = 25ordm c

Parameter Testconditions TSL260R TSL261R TSL262RMin type max Min typ max Min typ

maxtr output pulse risetime

VDD=5v Lp= 940nm 260 70 7

Tr output falltime VDD=5v Lp=940nm 260 70 7Vn output noise voltage

VDD=5v Ee=0f=1000Hz

08 07 06(v0Hz

Depending on the purpose of client we can take any of the three models and these photo transistors were made by a company called TEXAS ADVANCED OPTO ELECTRONICS SOLUTIONSThere are varied range of opto devices to make our task done but by considering all the factors like response refresh rate and other atmospheric temperature and light conditionsSome time voltage flickers may cause irrelavent responcive signal and causes a bad output or missleneous output ranges which causes mismatch with the Dynamic c programresults to no functioning the device

Reference helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipwwwtaosincom

Typical characteristics

This is a graph taken at different temperature levels of the sensor

Circuit

LIGHT SOURCE

We can use a strong source of light tramission such as light emmiting diodes or laser light depending on the purpose if we use LEDrsquos that are low power consumption and low emission rates so some times signal may not be detected by the optical sensor and the program may leads to crash the BL2000so for this purpose we are using laser light source with an external input battery or powersupply

About BL2000

Description

The BL2000 gives OEM designers optional Ethernet connectivity in a low-cost high-

performance single-board computer These compact boards are rich with the digital IO AD

and DA designers need for embedded control and monitoring applications and the BL2000s

compact board size of 415 x 343 (105 mm x 87 mm) allows for easy integration Ethernet

models are ideal for remotely monitoring and supervising another programmable system or web-

enabling new or existing products

Features

10Base-T Ethernet with RJ-45

Up to 28 digital IO

Up to 11 AD and 2 DA

4 serial ports

Optional 512K Flash 512K SRAM

Onboard relay

The BL2000 models are available in four configurations-two with Ethernet two without-and

feature up to 28 digital IO (including 5 or 7 dual-purpose analog or digital inputs) 3 RS-

232485 serial ports (plus one programming port) Rabbitreg 2000 microprocessor at 221 MHz

128K SRAM and 256K Flash onboard SPDT relay LEDs 7 timers and battery-backed real-

time clock

For the most demanding applications the BL2000 and BL2020 models include 4 channels of 12-

bit resolution AD input 5 channels of dual-purpose input and 2 channels of 12-bit DA output

For applications not requiring high-resolution analog IO the BL2010 and BL2030 offer 4

channels of 10-bit resolution AD input and 7 channels of dual-purpose input The dual-purpose

inputs are software configurable as analog inputs or programmable-threshold digital inputs

All BL2000 models can be programmed and debugged over EthernetInternet using appropriate

accessory hardware Systems with built-in 10Base-T Ethernet can be directly controlled and

monitored across networks or the Internet and can also open sockets to remote devices serve

web pages or send E-mail

Programming the BL2000 Single-Board Computer

Programs are developed using Rabbits industry-proven Dynamic Creg software development

system An extensive library of drivers and sample programs is provided along with royalty-free

TCPIP stack with source All BL2000 models can be programmed and debugged over

EthernetInternet using appropriate accessory hardware

pin diagram of rabbit BL2000

Power Supply PinsInstead of connecting an AC adapter to the power supply jack J7 the input power supply(9 V to 40 V DC) may be connected to pins 12 and 11 on header J2 (see Figure 6(a) orFigure 6(b))Pin 12 on header J9 or J10 is normally GND by factory default but may be changed toVcc by removing resistor R161 and installing resistor R160power Supplyrdquo for more information on this configuration and for information on backupbattery options

About Dynamic c

overview

Dynamic C has been in use worldwide since 1989 It is specially designed for programming embedded systems and features quick compile and interactive debugging A complete reference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menu

The advantage of working in RAM is to save wear on the flash memory which is limited to about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAM

NOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memory

NOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizes

Developing software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

Dynamic C has a number of standard featuresbull Full-feature source andor assembly-level debugger no in-circuit emulator requiredbull Royalty-free TCPIP stack with source code and most common protocolsbull Hundreds of functions in source-code libraries and sample programs1048664 Exceptionally fast support for floating-point arithmetic and transcendental functions1048664 RS-232 and RS-485 serial communication1048664 Analog and digital IO drivers1048664 I2C SPI GPS file system1048664 LCD display and keypad driversbull Powerful language extensions for cooperative or preemptive multitaskingbull Loader utility program to load binary images into Rabbit-based targets in the absenceof Dynamic Cbull Provision for customers to create their own source code libraries and augment on-linehelp by creating ldquofunction descriptionrdquo block comments using a special format forlibrary functionsbull Standard debugging features1048664 BreakpointsmdashSet breakpoints that can disable interrupts1048664 Single-steppingmdashStep into or over functions at a source or machine code level μCOS-II aware1048664 Code disassemblymdashThe disassembly window displays addresses opcodes mnemonics andmachine cycle times Switch between debugging at machine-code level and source-code level bysimply opening or closing the disassembly window1048664 Watch expressionsmdashWatch expressions are compiled when defined so complex expressionsincluding function calls may be placed into watch expressions Watch expressions can be updatedwith or without stopping program execution

1048664 Register windowmdashAll processor registers and flags are displayed The contents of general registersmay be modified in the window by the user1048664 Stack windowmdashshows the contents of the top of the stack1048664 Hex memory dumpmdashdisplays the contents of memory at any address1048664 STDIO windowmdashprintf outputs to this window and keyboard input on the host PC can bedetected for debugging purposes printf output may also be sent to a serial port or file

Board InitializationCall this function at the beginning of your program This function initializes the system IO ports andloads all the AD and DAC calibration constants from flash memory into SRAM for use by your programThe ports are initialized as follows

void brdInit (void)Port IO Function Output FunctionStatePA0 Output OUT0RELAYLED_DS4 High-Current DriverOffPA1 Output OUT1LED_DS5 High-Current DriverOffPA2 Output OUT2LED_DS6 High-Current DriverOffPA3 Output OUT3LED_DS7 High-Current DriverOffPA4 Output OUT4 High-Current DriverOffPA5 Output OUT5 High-Current DriverOffPA6 Output OUT6 High-Current DriverOffPA7 Output OUT7 High-Current DriverOffPB0 Input IN6 NAPB1 Input CLKA NAPB2 Input IN7 NAPB3 Input IN8 NAPB4 Input IN9 NAPB5 Input IN10 NAPB6 Output RS485_EN OffPB7 Output UPGOOD Bad Indicator OffPC0 Output TXD RS-485 Inactive highPC1 Input RXD RS-485 NA

The light source or the change in the light range is taken as the input for the Dynamic c program and it is converted by the analog to digital converter ports processed and compiled by the rabbit processorThe voltage range variation makes the program to count the voltage in as addition and voltage out as the subtraction from the total customers It is menctioned as T in the program

SOFTWARE CODDING

PROGRAMM

void main()

int ijT

i=0

j=0

auto float voltageinvoltageout

brdInit()

voltagein = anaInVolts(pin number)

voltageout = anaInVolts(pin number)

for()

if (voltageinlt25)

i++

printf(total number of customers today d ni)

if (voltageoutlt25)

j++

T=i-j

printf(customers presence in the store= d nT)

some of the commands which were used to complete the task success are as follows

(1) kbhit

syntax int kbhit(void)

description detects keystrokes in the Dynamic C studio window

Return value 0 If a key has been pressed 0 otherwise

Library UTILLIB

(2) float anaInVolts(unsigned int channel) discription Reads the state of an AD converter input channel and uses the previously set calibration constants to convert it to volts

PARAMETER channel is the AD converter input channel (0ndash10)

RETURN VALUE A voltage value corresponding to the voltage on the analog input channel SEE ALSOanaIn anaInCalib brdInit

(3) void anaInCalib(int channel int value1float volts1 int value2 float volts2)

Calibrates the response of the AD converter channel as a linear function using the two conversion pointsprovided Gain and offset constants are calculated and placed into global table _adcInCalibPARAMETERSchannel is the AD converter input channel (0ndash10)value1 is the first AD converter channel valuevolts1 is the voltage corresponding to the first AD converter channel valuevalue2 is the second AD converter channel valuevolts2 is the voltage corresponding to the second AD converter channel valueRETURN VALUE0 if successful-1 if not able to make calibration constantsCommands used

anaIn anaInVolts brdInitReads the voltage of an analog input channel by serially clocking out an 8-bit command to the AD converterdevice of the following formats

TLC2543 commandsD7ndashD4Channel 0 - 10Channel 11 = (Vref+ - Vref-)2Channel 12 = Vref-

Channel 13 = Vref+

Channel 14 = software powerdownD3-D2Output data length01mdash8 bits00mdash12 bits (normally used as default)11mdash16 bits (not supported by driver)D1Output data format0mdashMSB first1mdashLSB first (not supported by driver)D0Mode of operation0mdashUnipolar (normally used as default)1mdashBipolar

Example Programms which pioneered for the main program

Sample server program

This sample program shows how to use the for loops in the Dynamic c programming language

server program

define TCPCONFIG1

use ldquodcrtcplibrdquo

use ldquohttplibrdquo

ximport ldquodworkhellowwwhtmlrdquohellowww_html

SSPEC_MIMETABLE_START

SSPEC_MIME(ldquohtmlrdquordquotexthtmlrdquo)

SSPEC_MIMETABLE_END

SSPEC_RESOURCETABLE_START

SSPEC_RESOURCE_XMEMFILE(ldquohellowwwhtmlrdquohellowww_html)

SSPEC_RESOURCETABLE_END

void main()

sock_init()

http_init()

for()

http_handler()

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

Dynamic characteristics of the sensor at TA = 25ordm c

Parameter Testconditions TSL260R TSL261R TSL262RMin type max Min typ max Min typ

maxtr output pulse risetime

VDD=5v Lp= 940nm 260 70 7

Tr output falltime VDD=5v Lp=940nm 260 70 7Vn output noise voltage

VDD=5v Ee=0f=1000Hz

08 07 06(v0Hz

Depending on the purpose of client we can take any of the three models and these photo transistors were made by a company called TEXAS ADVANCED OPTO ELECTRONICS SOLUTIONSThere are varied range of opto devices to make our task done but by considering all the factors like response refresh rate and other atmospheric temperature and light conditionsSome time voltage flickers may cause irrelavent responcive signal and causes a bad output or missleneous output ranges which causes mismatch with the Dynamic c programresults to no functioning the device

Reference helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellipwwwtaosincom

Typical characteristics

This is a graph taken at different temperature levels of the sensor

Circuit

LIGHT SOURCE

We can use a strong source of light tramission such as light emmiting diodes or laser light depending on the purpose if we use LEDrsquos that are low power consumption and low emission rates so some times signal may not be detected by the optical sensor and the program may leads to crash the BL2000so for this purpose we are using laser light source with an external input battery or powersupply

About BL2000

Description

The BL2000 gives OEM designers optional Ethernet connectivity in a low-cost high-

performance single-board computer These compact boards are rich with the digital IO AD

and DA designers need for embedded control and monitoring applications and the BL2000s

compact board size of 415 x 343 (105 mm x 87 mm) allows for easy integration Ethernet

models are ideal for remotely monitoring and supervising another programmable system or web-

enabling new or existing products

Features

10Base-T Ethernet with RJ-45

Up to 28 digital IO

Up to 11 AD and 2 DA

4 serial ports

Optional 512K Flash 512K SRAM

Onboard relay

The BL2000 models are available in four configurations-two with Ethernet two without-and

feature up to 28 digital IO (including 5 or 7 dual-purpose analog or digital inputs) 3 RS-

232485 serial ports (plus one programming port) Rabbitreg 2000 microprocessor at 221 MHz

128K SRAM and 256K Flash onboard SPDT relay LEDs 7 timers and battery-backed real-

time clock

For the most demanding applications the BL2000 and BL2020 models include 4 channels of 12-

bit resolution AD input 5 channels of dual-purpose input and 2 channels of 12-bit DA output

For applications not requiring high-resolution analog IO the BL2010 and BL2030 offer 4

channels of 10-bit resolution AD input and 7 channels of dual-purpose input The dual-purpose

inputs are software configurable as analog inputs or programmable-threshold digital inputs

All BL2000 models can be programmed and debugged over EthernetInternet using appropriate

accessory hardware Systems with built-in 10Base-T Ethernet can be directly controlled and

monitored across networks or the Internet and can also open sockets to remote devices serve

web pages or send E-mail

Programming the BL2000 Single-Board Computer

Programs are developed using Rabbits industry-proven Dynamic Creg software development

system An extensive library of drivers and sample programs is provided along with royalty-free

TCPIP stack with source All BL2000 models can be programmed and debugged over

EthernetInternet using appropriate accessory hardware

pin diagram of rabbit BL2000

Power Supply PinsInstead of connecting an AC adapter to the power supply jack J7 the input power supply(9 V to 40 V DC) may be connected to pins 12 and 11 on header J2 (see Figure 6(a) orFigure 6(b))Pin 12 on header J9 or J10 is normally GND by factory default but may be changed toVcc by removing resistor R161 and installing resistor R160power Supplyrdquo for more information on this configuration and for information on backupbattery options

About Dynamic c

overview

Dynamic C has been in use worldwide since 1989 It is specially designed for programming embedded systems and features quick compile and interactive debugging A complete reference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menu

The advantage of working in RAM is to save wear on the flash memory which is limited to about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAM

NOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memory

NOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizes

Developing software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

Dynamic C has a number of standard featuresbull Full-feature source andor assembly-level debugger no in-circuit emulator requiredbull Royalty-free TCPIP stack with source code and most common protocolsbull Hundreds of functions in source-code libraries and sample programs1048664 Exceptionally fast support for floating-point arithmetic and transcendental functions1048664 RS-232 and RS-485 serial communication1048664 Analog and digital IO drivers1048664 I2C SPI GPS file system1048664 LCD display and keypad driversbull Powerful language extensions for cooperative or preemptive multitaskingbull Loader utility program to load binary images into Rabbit-based targets in the absenceof Dynamic Cbull Provision for customers to create their own source code libraries and augment on-linehelp by creating ldquofunction descriptionrdquo block comments using a special format forlibrary functionsbull Standard debugging features1048664 BreakpointsmdashSet breakpoints that can disable interrupts1048664 Single-steppingmdashStep into or over functions at a source or machine code level μCOS-II aware1048664 Code disassemblymdashThe disassembly window displays addresses opcodes mnemonics andmachine cycle times Switch between debugging at machine-code level and source-code level bysimply opening or closing the disassembly window1048664 Watch expressionsmdashWatch expressions are compiled when defined so complex expressionsincluding function calls may be placed into watch expressions Watch expressions can be updatedwith or without stopping program execution

1048664 Register windowmdashAll processor registers and flags are displayed The contents of general registersmay be modified in the window by the user1048664 Stack windowmdashshows the contents of the top of the stack1048664 Hex memory dumpmdashdisplays the contents of memory at any address1048664 STDIO windowmdashprintf outputs to this window and keyboard input on the host PC can bedetected for debugging purposes printf output may also be sent to a serial port or file

Board InitializationCall this function at the beginning of your program This function initializes the system IO ports andloads all the AD and DAC calibration constants from flash memory into SRAM for use by your programThe ports are initialized as follows

void brdInit (void)Port IO Function Output FunctionStatePA0 Output OUT0RELAYLED_DS4 High-Current DriverOffPA1 Output OUT1LED_DS5 High-Current DriverOffPA2 Output OUT2LED_DS6 High-Current DriverOffPA3 Output OUT3LED_DS7 High-Current DriverOffPA4 Output OUT4 High-Current DriverOffPA5 Output OUT5 High-Current DriverOffPA6 Output OUT6 High-Current DriverOffPA7 Output OUT7 High-Current DriverOffPB0 Input IN6 NAPB1 Input CLKA NAPB2 Input IN7 NAPB3 Input IN8 NAPB4 Input IN9 NAPB5 Input IN10 NAPB6 Output RS485_EN OffPB7 Output UPGOOD Bad Indicator OffPC0 Output TXD RS-485 Inactive highPC1 Input RXD RS-485 NA

The light source or the change in the light range is taken as the input for the Dynamic c program and it is converted by the analog to digital converter ports processed and compiled by the rabbit processorThe voltage range variation makes the program to count the voltage in as addition and voltage out as the subtraction from the total customers It is menctioned as T in the program

SOFTWARE CODDING

PROGRAMM

void main()

int ijT

i=0

j=0

auto float voltageinvoltageout

brdInit()

voltagein = anaInVolts(pin number)

voltageout = anaInVolts(pin number)

for()

if (voltageinlt25)

i++

printf(total number of customers today d ni)

if (voltageoutlt25)

j++

T=i-j

printf(customers presence in the store= d nT)

some of the commands which were used to complete the task success are as follows

(1) kbhit

syntax int kbhit(void)

description detects keystrokes in the Dynamic C studio window

Return value 0 If a key has been pressed 0 otherwise

Library UTILLIB

(2) float anaInVolts(unsigned int channel) discription Reads the state of an AD converter input channel and uses the previously set calibration constants to convert it to volts

PARAMETER channel is the AD converter input channel (0ndash10)

RETURN VALUE A voltage value corresponding to the voltage on the analog input channel SEE ALSOanaIn anaInCalib brdInit

(3) void anaInCalib(int channel int value1float volts1 int value2 float volts2)

Calibrates the response of the AD converter channel as a linear function using the two conversion pointsprovided Gain and offset constants are calculated and placed into global table _adcInCalibPARAMETERSchannel is the AD converter input channel (0ndash10)value1 is the first AD converter channel valuevolts1 is the voltage corresponding to the first AD converter channel valuevalue2 is the second AD converter channel valuevolts2 is the voltage corresponding to the second AD converter channel valueRETURN VALUE0 if successful-1 if not able to make calibration constantsCommands used

anaIn anaInVolts brdInitReads the voltage of an analog input channel by serially clocking out an 8-bit command to the AD converterdevice of the following formats

TLC2543 commandsD7ndashD4Channel 0 - 10Channel 11 = (Vref+ - Vref-)2Channel 12 = Vref-

Channel 13 = Vref+

Channel 14 = software powerdownD3-D2Output data length01mdash8 bits00mdash12 bits (normally used as default)11mdash16 bits (not supported by driver)D1Output data format0mdashMSB first1mdashLSB first (not supported by driver)D0Mode of operation0mdashUnipolar (normally used as default)1mdashBipolar

Example Programms which pioneered for the main program

Sample server program

This sample program shows how to use the for loops in the Dynamic c programming language

server program

define TCPCONFIG1

use ldquodcrtcplibrdquo

use ldquohttplibrdquo

ximport ldquodworkhellowwwhtmlrdquohellowww_html

SSPEC_MIMETABLE_START

SSPEC_MIME(ldquohtmlrdquordquotexthtmlrdquo)

SSPEC_MIMETABLE_END

SSPEC_RESOURCETABLE_START

SSPEC_RESOURCE_XMEMFILE(ldquohellowwwhtmlrdquohellowww_html)

SSPEC_RESOURCETABLE_END

void main()

sock_init()

http_init()

for()

http_handler()

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

LIGHT SOURCE

We can use a strong source of light tramission such as light emmiting diodes or laser light depending on the purpose if we use LEDrsquos that are low power consumption and low emission rates so some times signal may not be detected by the optical sensor and the program may leads to crash the BL2000so for this purpose we are using laser light source with an external input battery or powersupply

About BL2000

Description

The BL2000 gives OEM designers optional Ethernet connectivity in a low-cost high-

performance single-board computer These compact boards are rich with the digital IO AD

and DA designers need for embedded control and monitoring applications and the BL2000s

compact board size of 415 x 343 (105 mm x 87 mm) allows for easy integration Ethernet

models are ideal for remotely monitoring and supervising another programmable system or web-

enabling new or existing products

Features

10Base-T Ethernet with RJ-45

Up to 28 digital IO

Up to 11 AD and 2 DA

4 serial ports

Optional 512K Flash 512K SRAM

Onboard relay

The BL2000 models are available in four configurations-two with Ethernet two without-and

feature up to 28 digital IO (including 5 or 7 dual-purpose analog or digital inputs) 3 RS-

232485 serial ports (plus one programming port) Rabbitreg 2000 microprocessor at 221 MHz

128K SRAM and 256K Flash onboard SPDT relay LEDs 7 timers and battery-backed real-

time clock

For the most demanding applications the BL2000 and BL2020 models include 4 channels of 12-

bit resolution AD input 5 channels of dual-purpose input and 2 channels of 12-bit DA output

For applications not requiring high-resolution analog IO the BL2010 and BL2030 offer 4

channels of 10-bit resolution AD input and 7 channels of dual-purpose input The dual-purpose

inputs are software configurable as analog inputs or programmable-threshold digital inputs

All BL2000 models can be programmed and debugged over EthernetInternet using appropriate

accessory hardware Systems with built-in 10Base-T Ethernet can be directly controlled and

monitored across networks or the Internet and can also open sockets to remote devices serve

web pages or send E-mail

Programming the BL2000 Single-Board Computer

Programs are developed using Rabbits industry-proven Dynamic Creg software development

system An extensive library of drivers and sample programs is provided along with royalty-free

TCPIP stack with source All BL2000 models can be programmed and debugged over

EthernetInternet using appropriate accessory hardware

pin diagram of rabbit BL2000

Power Supply PinsInstead of connecting an AC adapter to the power supply jack J7 the input power supply(9 V to 40 V DC) may be connected to pins 12 and 11 on header J2 (see Figure 6(a) orFigure 6(b))Pin 12 on header J9 or J10 is normally GND by factory default but may be changed toVcc by removing resistor R161 and installing resistor R160power Supplyrdquo for more information on this configuration and for information on backupbattery options

About Dynamic c

overview

Dynamic C has been in use worldwide since 1989 It is specially designed for programming embedded systems and features quick compile and interactive debugging A complete reference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menu

The advantage of working in RAM is to save wear on the flash memory which is limited to about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAM

NOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memory

NOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizes

Developing software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

Dynamic C has a number of standard featuresbull Full-feature source andor assembly-level debugger no in-circuit emulator requiredbull Royalty-free TCPIP stack with source code and most common protocolsbull Hundreds of functions in source-code libraries and sample programs1048664 Exceptionally fast support for floating-point arithmetic and transcendental functions1048664 RS-232 and RS-485 serial communication1048664 Analog and digital IO drivers1048664 I2C SPI GPS file system1048664 LCD display and keypad driversbull Powerful language extensions for cooperative or preemptive multitaskingbull Loader utility program to load binary images into Rabbit-based targets in the absenceof Dynamic Cbull Provision for customers to create their own source code libraries and augment on-linehelp by creating ldquofunction descriptionrdquo block comments using a special format forlibrary functionsbull Standard debugging features1048664 BreakpointsmdashSet breakpoints that can disable interrupts1048664 Single-steppingmdashStep into or over functions at a source or machine code level μCOS-II aware1048664 Code disassemblymdashThe disassembly window displays addresses opcodes mnemonics andmachine cycle times Switch between debugging at machine-code level and source-code level bysimply opening or closing the disassembly window1048664 Watch expressionsmdashWatch expressions are compiled when defined so complex expressionsincluding function calls may be placed into watch expressions Watch expressions can be updatedwith or without stopping program execution

1048664 Register windowmdashAll processor registers and flags are displayed The contents of general registersmay be modified in the window by the user1048664 Stack windowmdashshows the contents of the top of the stack1048664 Hex memory dumpmdashdisplays the contents of memory at any address1048664 STDIO windowmdashprintf outputs to this window and keyboard input on the host PC can bedetected for debugging purposes printf output may also be sent to a serial port or file

Board InitializationCall this function at the beginning of your program This function initializes the system IO ports andloads all the AD and DAC calibration constants from flash memory into SRAM for use by your programThe ports are initialized as follows

void brdInit (void)Port IO Function Output FunctionStatePA0 Output OUT0RELAYLED_DS4 High-Current DriverOffPA1 Output OUT1LED_DS5 High-Current DriverOffPA2 Output OUT2LED_DS6 High-Current DriverOffPA3 Output OUT3LED_DS7 High-Current DriverOffPA4 Output OUT4 High-Current DriverOffPA5 Output OUT5 High-Current DriverOffPA6 Output OUT6 High-Current DriverOffPA7 Output OUT7 High-Current DriverOffPB0 Input IN6 NAPB1 Input CLKA NAPB2 Input IN7 NAPB3 Input IN8 NAPB4 Input IN9 NAPB5 Input IN10 NAPB6 Output RS485_EN OffPB7 Output UPGOOD Bad Indicator OffPC0 Output TXD RS-485 Inactive highPC1 Input RXD RS-485 NA

The light source or the change in the light range is taken as the input for the Dynamic c program and it is converted by the analog to digital converter ports processed and compiled by the rabbit processorThe voltage range variation makes the program to count the voltage in as addition and voltage out as the subtraction from the total customers It is menctioned as T in the program

SOFTWARE CODDING

PROGRAMM

void main()

int ijT

i=0

j=0

auto float voltageinvoltageout

brdInit()

voltagein = anaInVolts(pin number)

voltageout = anaInVolts(pin number)

for()

if (voltageinlt25)

i++

printf(total number of customers today d ni)

if (voltageoutlt25)

j++

T=i-j

printf(customers presence in the store= d nT)

some of the commands which were used to complete the task success are as follows

(1) kbhit

syntax int kbhit(void)

description detects keystrokes in the Dynamic C studio window

Return value 0 If a key has been pressed 0 otherwise

Library UTILLIB

(2) float anaInVolts(unsigned int channel) discription Reads the state of an AD converter input channel and uses the previously set calibration constants to convert it to volts

PARAMETER channel is the AD converter input channel (0ndash10)

RETURN VALUE A voltage value corresponding to the voltage on the analog input channel SEE ALSOanaIn anaInCalib brdInit

(3) void anaInCalib(int channel int value1float volts1 int value2 float volts2)

Calibrates the response of the AD converter channel as a linear function using the two conversion pointsprovided Gain and offset constants are calculated and placed into global table _adcInCalibPARAMETERSchannel is the AD converter input channel (0ndash10)value1 is the first AD converter channel valuevolts1 is the voltage corresponding to the first AD converter channel valuevalue2 is the second AD converter channel valuevolts2 is the voltage corresponding to the second AD converter channel valueRETURN VALUE0 if successful-1 if not able to make calibration constantsCommands used

anaIn anaInVolts brdInitReads the voltage of an analog input channel by serially clocking out an 8-bit command to the AD converterdevice of the following formats

TLC2543 commandsD7ndashD4Channel 0 - 10Channel 11 = (Vref+ - Vref-)2Channel 12 = Vref-

Channel 13 = Vref+

Channel 14 = software powerdownD3-D2Output data length01mdash8 bits00mdash12 bits (normally used as default)11mdash16 bits (not supported by driver)D1Output data format0mdashMSB first1mdashLSB first (not supported by driver)D0Mode of operation0mdashUnipolar (normally used as default)1mdashBipolar

Example Programms which pioneered for the main program

Sample server program

This sample program shows how to use the for loops in the Dynamic c programming language

server program

define TCPCONFIG1

use ldquodcrtcplibrdquo

use ldquohttplibrdquo

ximport ldquodworkhellowwwhtmlrdquohellowww_html

SSPEC_MIMETABLE_START

SSPEC_MIME(ldquohtmlrdquordquotexthtmlrdquo)

SSPEC_MIMETABLE_END

SSPEC_RESOURCETABLE_START

SSPEC_RESOURCE_XMEMFILE(ldquohellowwwhtmlrdquohellowww_html)

SSPEC_RESOURCETABLE_END

void main()

sock_init()

http_init()

for()

http_handler()

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

The BL2000 models are available in four configurations-two with Ethernet two without-and

feature up to 28 digital IO (including 5 or 7 dual-purpose analog or digital inputs) 3 RS-

232485 serial ports (plus one programming port) Rabbitreg 2000 microprocessor at 221 MHz

128K SRAM and 256K Flash onboard SPDT relay LEDs 7 timers and battery-backed real-

time clock

For the most demanding applications the BL2000 and BL2020 models include 4 channels of 12-

bit resolution AD input 5 channels of dual-purpose input and 2 channels of 12-bit DA output

For applications not requiring high-resolution analog IO the BL2010 and BL2030 offer 4

channels of 10-bit resolution AD input and 7 channels of dual-purpose input The dual-purpose

inputs are software configurable as analog inputs or programmable-threshold digital inputs

All BL2000 models can be programmed and debugged over EthernetInternet using appropriate

accessory hardware Systems with built-in 10Base-T Ethernet can be directly controlled and

monitored across networks or the Internet and can also open sockets to remote devices serve

web pages or send E-mail

Programming the BL2000 Single-Board Computer

Programs are developed using Rabbits industry-proven Dynamic Creg software development

system An extensive library of drivers and sample programs is provided along with royalty-free

TCPIP stack with source All BL2000 models can be programmed and debugged over

EthernetInternet using appropriate accessory hardware

pin diagram of rabbit BL2000

Power Supply PinsInstead of connecting an AC adapter to the power supply jack J7 the input power supply(9 V to 40 V DC) may be connected to pins 12 and 11 on header J2 (see Figure 6(a) orFigure 6(b))Pin 12 on header J9 or J10 is normally GND by factory default but may be changed toVcc by removing resistor R161 and installing resistor R160power Supplyrdquo for more information on this configuration and for information on backupbattery options

About Dynamic c

overview

Dynamic C has been in use worldwide since 1989 It is specially designed for programming embedded systems and features quick compile and interactive debugging A complete reference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menu

The advantage of working in RAM is to save wear on the flash memory which is limited to about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAM

NOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memory

NOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizes

Developing software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

Dynamic C has a number of standard featuresbull Full-feature source andor assembly-level debugger no in-circuit emulator requiredbull Royalty-free TCPIP stack with source code and most common protocolsbull Hundreds of functions in source-code libraries and sample programs1048664 Exceptionally fast support for floating-point arithmetic and transcendental functions1048664 RS-232 and RS-485 serial communication1048664 Analog and digital IO drivers1048664 I2C SPI GPS file system1048664 LCD display and keypad driversbull Powerful language extensions for cooperative or preemptive multitaskingbull Loader utility program to load binary images into Rabbit-based targets in the absenceof Dynamic Cbull Provision for customers to create their own source code libraries and augment on-linehelp by creating ldquofunction descriptionrdquo block comments using a special format forlibrary functionsbull Standard debugging features1048664 BreakpointsmdashSet breakpoints that can disable interrupts1048664 Single-steppingmdashStep into or over functions at a source or machine code level μCOS-II aware1048664 Code disassemblymdashThe disassembly window displays addresses opcodes mnemonics andmachine cycle times Switch between debugging at machine-code level and source-code level bysimply opening or closing the disassembly window1048664 Watch expressionsmdashWatch expressions are compiled when defined so complex expressionsincluding function calls may be placed into watch expressions Watch expressions can be updatedwith or without stopping program execution

1048664 Register windowmdashAll processor registers and flags are displayed The contents of general registersmay be modified in the window by the user1048664 Stack windowmdashshows the contents of the top of the stack1048664 Hex memory dumpmdashdisplays the contents of memory at any address1048664 STDIO windowmdashprintf outputs to this window and keyboard input on the host PC can bedetected for debugging purposes printf output may also be sent to a serial port or file

Board InitializationCall this function at the beginning of your program This function initializes the system IO ports andloads all the AD and DAC calibration constants from flash memory into SRAM for use by your programThe ports are initialized as follows

void brdInit (void)Port IO Function Output FunctionStatePA0 Output OUT0RELAYLED_DS4 High-Current DriverOffPA1 Output OUT1LED_DS5 High-Current DriverOffPA2 Output OUT2LED_DS6 High-Current DriverOffPA3 Output OUT3LED_DS7 High-Current DriverOffPA4 Output OUT4 High-Current DriverOffPA5 Output OUT5 High-Current DriverOffPA6 Output OUT6 High-Current DriverOffPA7 Output OUT7 High-Current DriverOffPB0 Input IN6 NAPB1 Input CLKA NAPB2 Input IN7 NAPB3 Input IN8 NAPB4 Input IN9 NAPB5 Input IN10 NAPB6 Output RS485_EN OffPB7 Output UPGOOD Bad Indicator OffPC0 Output TXD RS-485 Inactive highPC1 Input RXD RS-485 NA

The light source or the change in the light range is taken as the input for the Dynamic c program and it is converted by the analog to digital converter ports processed and compiled by the rabbit processorThe voltage range variation makes the program to count the voltage in as addition and voltage out as the subtraction from the total customers It is menctioned as T in the program

SOFTWARE CODDING

PROGRAMM

void main()

int ijT

i=0

j=0

auto float voltageinvoltageout

brdInit()

voltagein = anaInVolts(pin number)

voltageout = anaInVolts(pin number)

for()

if (voltageinlt25)

i++

printf(total number of customers today d ni)

if (voltageoutlt25)

j++

T=i-j

printf(customers presence in the store= d nT)

some of the commands which were used to complete the task success are as follows

(1) kbhit

syntax int kbhit(void)

description detects keystrokes in the Dynamic C studio window

Return value 0 If a key has been pressed 0 otherwise

Library UTILLIB

(2) float anaInVolts(unsigned int channel) discription Reads the state of an AD converter input channel and uses the previously set calibration constants to convert it to volts

PARAMETER channel is the AD converter input channel (0ndash10)

RETURN VALUE A voltage value corresponding to the voltage on the analog input channel SEE ALSOanaIn anaInCalib brdInit

(3) void anaInCalib(int channel int value1float volts1 int value2 float volts2)

Calibrates the response of the AD converter channel as a linear function using the two conversion pointsprovided Gain and offset constants are calculated and placed into global table _adcInCalibPARAMETERSchannel is the AD converter input channel (0ndash10)value1 is the first AD converter channel valuevolts1 is the voltage corresponding to the first AD converter channel valuevalue2 is the second AD converter channel valuevolts2 is the voltage corresponding to the second AD converter channel valueRETURN VALUE0 if successful-1 if not able to make calibration constantsCommands used

anaIn anaInVolts brdInitReads the voltage of an analog input channel by serially clocking out an 8-bit command to the AD converterdevice of the following formats

TLC2543 commandsD7ndashD4Channel 0 - 10Channel 11 = (Vref+ - Vref-)2Channel 12 = Vref-

Channel 13 = Vref+

Channel 14 = software powerdownD3-D2Output data length01mdash8 bits00mdash12 bits (normally used as default)11mdash16 bits (not supported by driver)D1Output data format0mdashMSB first1mdashLSB first (not supported by driver)D0Mode of operation0mdashUnipolar (normally used as default)1mdashBipolar

Example Programms which pioneered for the main program

Sample server program

This sample program shows how to use the for loops in the Dynamic c programming language

server program

define TCPCONFIG1

use ldquodcrtcplibrdquo

use ldquohttplibrdquo

ximport ldquodworkhellowwwhtmlrdquohellowww_html

SSPEC_MIMETABLE_START

SSPEC_MIME(ldquohtmlrdquordquotexthtmlrdquo)

SSPEC_MIMETABLE_END

SSPEC_RESOURCETABLE_START

SSPEC_RESOURCE_XMEMFILE(ldquohellowwwhtmlrdquohellowww_html)

SSPEC_RESOURCETABLE_END

void main()

sock_init()

http_init()

for()

http_handler()

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

pin diagram of rabbit BL2000

Power Supply PinsInstead of connecting an AC adapter to the power supply jack J7 the input power supply(9 V to 40 V DC) may be connected to pins 12 and 11 on header J2 (see Figure 6(a) orFigure 6(b))Pin 12 on header J9 or J10 is normally GND by factory default but may be changed toVcc by removing resistor R161 and installing resistor R160power Supplyrdquo for more information on this configuration and for information on backupbattery options

About Dynamic c

overview

Dynamic C has been in use worldwide since 1989 It is specially designed for programming embedded systems and features quick compile and interactive debugging A complete reference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menu

The advantage of working in RAM is to save wear on the flash memory which is limited to about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAM

NOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memory

NOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizes

Developing software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

Dynamic C has a number of standard featuresbull Full-feature source andor assembly-level debugger no in-circuit emulator requiredbull Royalty-free TCPIP stack with source code and most common protocolsbull Hundreds of functions in source-code libraries and sample programs1048664 Exceptionally fast support for floating-point arithmetic and transcendental functions1048664 RS-232 and RS-485 serial communication1048664 Analog and digital IO drivers1048664 I2C SPI GPS file system1048664 LCD display and keypad driversbull Powerful language extensions for cooperative or preemptive multitaskingbull Loader utility program to load binary images into Rabbit-based targets in the absenceof Dynamic Cbull Provision for customers to create their own source code libraries and augment on-linehelp by creating ldquofunction descriptionrdquo block comments using a special format forlibrary functionsbull Standard debugging features1048664 BreakpointsmdashSet breakpoints that can disable interrupts1048664 Single-steppingmdashStep into or over functions at a source or machine code level μCOS-II aware1048664 Code disassemblymdashThe disassembly window displays addresses opcodes mnemonics andmachine cycle times Switch between debugging at machine-code level and source-code level bysimply opening or closing the disassembly window1048664 Watch expressionsmdashWatch expressions are compiled when defined so complex expressionsincluding function calls may be placed into watch expressions Watch expressions can be updatedwith or without stopping program execution

1048664 Register windowmdashAll processor registers and flags are displayed The contents of general registersmay be modified in the window by the user1048664 Stack windowmdashshows the contents of the top of the stack1048664 Hex memory dumpmdashdisplays the contents of memory at any address1048664 STDIO windowmdashprintf outputs to this window and keyboard input on the host PC can bedetected for debugging purposes printf output may also be sent to a serial port or file

Board InitializationCall this function at the beginning of your program This function initializes the system IO ports andloads all the AD and DAC calibration constants from flash memory into SRAM for use by your programThe ports are initialized as follows

void brdInit (void)Port IO Function Output FunctionStatePA0 Output OUT0RELAYLED_DS4 High-Current DriverOffPA1 Output OUT1LED_DS5 High-Current DriverOffPA2 Output OUT2LED_DS6 High-Current DriverOffPA3 Output OUT3LED_DS7 High-Current DriverOffPA4 Output OUT4 High-Current DriverOffPA5 Output OUT5 High-Current DriverOffPA6 Output OUT6 High-Current DriverOffPA7 Output OUT7 High-Current DriverOffPB0 Input IN6 NAPB1 Input CLKA NAPB2 Input IN7 NAPB3 Input IN8 NAPB4 Input IN9 NAPB5 Input IN10 NAPB6 Output RS485_EN OffPB7 Output UPGOOD Bad Indicator OffPC0 Output TXD RS-485 Inactive highPC1 Input RXD RS-485 NA

The light source or the change in the light range is taken as the input for the Dynamic c program and it is converted by the analog to digital converter ports processed and compiled by the rabbit processorThe voltage range variation makes the program to count the voltage in as addition and voltage out as the subtraction from the total customers It is menctioned as T in the program

SOFTWARE CODDING

PROGRAMM

void main()

int ijT

i=0

j=0

auto float voltageinvoltageout

brdInit()

voltagein = anaInVolts(pin number)

voltageout = anaInVolts(pin number)

for()

if (voltageinlt25)

i++

printf(total number of customers today d ni)

if (voltageoutlt25)

j++

T=i-j

printf(customers presence in the store= d nT)

some of the commands which were used to complete the task success are as follows

(1) kbhit

syntax int kbhit(void)

description detects keystrokes in the Dynamic C studio window

Return value 0 If a key has been pressed 0 otherwise

Library UTILLIB

(2) float anaInVolts(unsigned int channel) discription Reads the state of an AD converter input channel and uses the previously set calibration constants to convert it to volts

PARAMETER channel is the AD converter input channel (0ndash10)

RETURN VALUE A voltage value corresponding to the voltage on the analog input channel SEE ALSOanaIn anaInCalib brdInit

(3) void anaInCalib(int channel int value1float volts1 int value2 float volts2)

Calibrates the response of the AD converter channel as a linear function using the two conversion pointsprovided Gain and offset constants are calculated and placed into global table _adcInCalibPARAMETERSchannel is the AD converter input channel (0ndash10)value1 is the first AD converter channel valuevolts1 is the voltage corresponding to the first AD converter channel valuevalue2 is the second AD converter channel valuevolts2 is the voltage corresponding to the second AD converter channel valueRETURN VALUE0 if successful-1 if not able to make calibration constantsCommands used

anaIn anaInVolts brdInitReads the voltage of an analog input channel by serially clocking out an 8-bit command to the AD converterdevice of the following formats

TLC2543 commandsD7ndashD4Channel 0 - 10Channel 11 = (Vref+ - Vref-)2Channel 12 = Vref-

Channel 13 = Vref+

Channel 14 = software powerdownD3-D2Output data length01mdash8 bits00mdash12 bits (normally used as default)11mdash16 bits (not supported by driver)D1Output data format0mdashMSB first1mdashLSB first (not supported by driver)D0Mode of operation0mdashUnipolar (normally used as default)1mdashBipolar

Example Programms which pioneered for the main program

Sample server program

This sample program shows how to use the for loops in the Dynamic c programming language

server program

define TCPCONFIG1

use ldquodcrtcplibrdquo

use ldquohttplibrdquo

ximport ldquodworkhellowwwhtmlrdquohellowww_html

SSPEC_MIMETABLE_START

SSPEC_MIME(ldquohtmlrdquordquotexthtmlrdquo)

SSPEC_MIMETABLE_END

SSPEC_RESOURCETABLE_START

SSPEC_RESOURCE_XMEMFILE(ldquohellowwwhtmlrdquohellowww_html)

SSPEC_RESOURCETABLE_END

void main()

sock_init()

http_init()

for()

http_handler()

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

The advantage of working in RAM is to save wear on the flash memory which is limited to about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAM

NOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memory

NOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizes

Developing software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

Dynamic C has a number of standard featuresbull Full-feature source andor assembly-level debugger no in-circuit emulator requiredbull Royalty-free TCPIP stack with source code and most common protocolsbull Hundreds of functions in source-code libraries and sample programs1048664 Exceptionally fast support for floating-point arithmetic and transcendental functions1048664 RS-232 and RS-485 serial communication1048664 Analog and digital IO drivers1048664 I2C SPI GPS file system1048664 LCD display and keypad driversbull Powerful language extensions for cooperative or preemptive multitaskingbull Loader utility program to load binary images into Rabbit-based targets in the absenceof Dynamic Cbull Provision for customers to create their own source code libraries and augment on-linehelp by creating ldquofunction descriptionrdquo block comments using a special format forlibrary functionsbull Standard debugging features1048664 BreakpointsmdashSet breakpoints that can disable interrupts1048664 Single-steppingmdashStep into or over functions at a source or machine code level μCOS-II aware1048664 Code disassemblymdashThe disassembly window displays addresses opcodes mnemonics andmachine cycle times Switch between debugging at machine-code level and source-code level bysimply opening or closing the disassembly window1048664 Watch expressionsmdashWatch expressions are compiled when defined so complex expressionsincluding function calls may be placed into watch expressions Watch expressions can be updatedwith or without stopping program execution

1048664 Register windowmdashAll processor registers and flags are displayed The contents of general registersmay be modified in the window by the user1048664 Stack windowmdashshows the contents of the top of the stack1048664 Hex memory dumpmdashdisplays the contents of memory at any address1048664 STDIO windowmdashprintf outputs to this window and keyboard input on the host PC can bedetected for debugging purposes printf output may also be sent to a serial port or file

Board InitializationCall this function at the beginning of your program This function initializes the system IO ports andloads all the AD and DAC calibration constants from flash memory into SRAM for use by your programThe ports are initialized as follows

void brdInit (void)Port IO Function Output FunctionStatePA0 Output OUT0RELAYLED_DS4 High-Current DriverOffPA1 Output OUT1LED_DS5 High-Current DriverOffPA2 Output OUT2LED_DS6 High-Current DriverOffPA3 Output OUT3LED_DS7 High-Current DriverOffPA4 Output OUT4 High-Current DriverOffPA5 Output OUT5 High-Current DriverOffPA6 Output OUT6 High-Current DriverOffPA7 Output OUT7 High-Current DriverOffPB0 Input IN6 NAPB1 Input CLKA NAPB2 Input IN7 NAPB3 Input IN8 NAPB4 Input IN9 NAPB5 Input IN10 NAPB6 Output RS485_EN OffPB7 Output UPGOOD Bad Indicator OffPC0 Output TXD RS-485 Inactive highPC1 Input RXD RS-485 NA

The light source or the change in the light range is taken as the input for the Dynamic c program and it is converted by the analog to digital converter ports processed and compiled by the rabbit processorThe voltage range variation makes the program to count the voltage in as addition and voltage out as the subtraction from the total customers It is menctioned as T in the program

SOFTWARE CODDING

PROGRAMM

void main()

int ijT

i=0

j=0

auto float voltageinvoltageout

brdInit()

voltagein = anaInVolts(pin number)

voltageout = anaInVolts(pin number)

for()

if (voltageinlt25)

i++

printf(total number of customers today d ni)

if (voltageoutlt25)

j++

T=i-j

printf(customers presence in the store= d nT)

some of the commands which were used to complete the task success are as follows

(1) kbhit

syntax int kbhit(void)

description detects keystrokes in the Dynamic C studio window

Return value 0 If a key has been pressed 0 otherwise

Library UTILLIB

(2) float anaInVolts(unsigned int channel) discription Reads the state of an AD converter input channel and uses the previously set calibration constants to convert it to volts

PARAMETER channel is the AD converter input channel (0ndash10)

RETURN VALUE A voltage value corresponding to the voltage on the analog input channel SEE ALSOanaIn anaInCalib brdInit

(3) void anaInCalib(int channel int value1float volts1 int value2 float volts2)

Calibrates the response of the AD converter channel as a linear function using the two conversion pointsprovided Gain and offset constants are calculated and placed into global table _adcInCalibPARAMETERSchannel is the AD converter input channel (0ndash10)value1 is the first AD converter channel valuevolts1 is the voltage corresponding to the first AD converter channel valuevalue2 is the second AD converter channel valuevolts2 is the voltage corresponding to the second AD converter channel valueRETURN VALUE0 if successful-1 if not able to make calibration constantsCommands used

anaIn anaInVolts brdInitReads the voltage of an analog input channel by serially clocking out an 8-bit command to the AD converterdevice of the following formats

TLC2543 commandsD7ndashD4Channel 0 - 10Channel 11 = (Vref+ - Vref-)2Channel 12 = Vref-

Channel 13 = Vref+

Channel 14 = software powerdownD3-D2Output data length01mdash8 bits00mdash12 bits (normally used as default)11mdash16 bits (not supported by driver)D1Output data format0mdashMSB first1mdashLSB first (not supported by driver)D0Mode of operation0mdashUnipolar (normally used as default)1mdashBipolar

Example Programms which pioneered for the main program

Sample server program

This sample program shows how to use the for loops in the Dynamic c programming language

server program

define TCPCONFIG1

use ldquodcrtcplibrdquo

use ldquohttplibrdquo

ximport ldquodworkhellowwwhtmlrdquohellowww_html

SSPEC_MIMETABLE_START

SSPEC_MIME(ldquohtmlrdquordquotexthtmlrdquo)

SSPEC_MIMETABLE_END

SSPEC_RESOURCETABLE_START

SSPEC_RESOURCE_XMEMFILE(ldquohellowwwhtmlrdquohellowww_html)

SSPEC_RESOURCETABLE_END

void main()

sock_init()

http_init()

for()

http_handler()

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

1048664 Register windowmdashAll processor registers and flags are displayed The contents of general registersmay be modified in the window by the user1048664 Stack windowmdashshows the contents of the top of the stack1048664 Hex memory dumpmdashdisplays the contents of memory at any address1048664 STDIO windowmdashprintf outputs to this window and keyboard input on the host PC can bedetected for debugging purposes printf output may also be sent to a serial port or file

Board InitializationCall this function at the beginning of your program This function initializes the system IO ports andloads all the AD and DAC calibration constants from flash memory into SRAM for use by your programThe ports are initialized as follows

void brdInit (void)Port IO Function Output FunctionStatePA0 Output OUT0RELAYLED_DS4 High-Current DriverOffPA1 Output OUT1LED_DS5 High-Current DriverOffPA2 Output OUT2LED_DS6 High-Current DriverOffPA3 Output OUT3LED_DS7 High-Current DriverOffPA4 Output OUT4 High-Current DriverOffPA5 Output OUT5 High-Current DriverOffPA6 Output OUT6 High-Current DriverOffPA7 Output OUT7 High-Current DriverOffPB0 Input IN6 NAPB1 Input CLKA NAPB2 Input IN7 NAPB3 Input IN8 NAPB4 Input IN9 NAPB5 Input IN10 NAPB6 Output RS485_EN OffPB7 Output UPGOOD Bad Indicator OffPC0 Output TXD RS-485 Inactive highPC1 Input RXD RS-485 NA

The light source or the change in the light range is taken as the input for the Dynamic c program and it is converted by the analog to digital converter ports processed and compiled by the rabbit processorThe voltage range variation makes the program to count the voltage in as addition and voltage out as the subtraction from the total customers It is menctioned as T in the program

SOFTWARE CODDING

PROGRAMM

void main()

int ijT

i=0

j=0

auto float voltageinvoltageout

brdInit()

voltagein = anaInVolts(pin number)

voltageout = anaInVolts(pin number)

for()

if (voltageinlt25)

i++

printf(total number of customers today d ni)

if (voltageoutlt25)

j++

T=i-j

printf(customers presence in the store= d nT)

some of the commands which were used to complete the task success are as follows

(1) kbhit

syntax int kbhit(void)

description detects keystrokes in the Dynamic C studio window

Return value 0 If a key has been pressed 0 otherwise

Library UTILLIB

(2) float anaInVolts(unsigned int channel) discription Reads the state of an AD converter input channel and uses the previously set calibration constants to convert it to volts

PARAMETER channel is the AD converter input channel (0ndash10)

RETURN VALUE A voltage value corresponding to the voltage on the analog input channel SEE ALSOanaIn anaInCalib brdInit

(3) void anaInCalib(int channel int value1float volts1 int value2 float volts2)

Calibrates the response of the AD converter channel as a linear function using the two conversion pointsprovided Gain and offset constants are calculated and placed into global table _adcInCalibPARAMETERSchannel is the AD converter input channel (0ndash10)value1 is the first AD converter channel valuevolts1 is the voltage corresponding to the first AD converter channel valuevalue2 is the second AD converter channel valuevolts2 is the voltage corresponding to the second AD converter channel valueRETURN VALUE0 if successful-1 if not able to make calibration constantsCommands used

anaIn anaInVolts brdInitReads the voltage of an analog input channel by serially clocking out an 8-bit command to the AD converterdevice of the following formats

TLC2543 commandsD7ndashD4Channel 0 - 10Channel 11 = (Vref+ - Vref-)2Channel 12 = Vref-

Channel 13 = Vref+

Channel 14 = software powerdownD3-D2Output data length01mdash8 bits00mdash12 bits (normally used as default)11mdash16 bits (not supported by driver)D1Output data format0mdashMSB first1mdashLSB first (not supported by driver)D0Mode of operation0mdashUnipolar (normally used as default)1mdashBipolar

Example Programms which pioneered for the main program

Sample server program

This sample program shows how to use the for loops in the Dynamic c programming language

server program

define TCPCONFIG1

use ldquodcrtcplibrdquo

use ldquohttplibrdquo

ximport ldquodworkhellowwwhtmlrdquohellowww_html

SSPEC_MIMETABLE_START

SSPEC_MIME(ldquohtmlrdquordquotexthtmlrdquo)

SSPEC_MIMETABLE_END

SSPEC_RESOURCETABLE_START

SSPEC_RESOURCE_XMEMFILE(ldquohellowwwhtmlrdquohellowww_html)

SSPEC_RESOURCETABLE_END

void main()

sock_init()

http_init()

for()

http_handler()

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

The light source or the change in the light range is taken as the input for the Dynamic c program and it is converted by the analog to digital converter ports processed and compiled by the rabbit processorThe voltage range variation makes the program to count the voltage in as addition and voltage out as the subtraction from the total customers It is menctioned as T in the program

SOFTWARE CODDING

PROGRAMM

void main()

int ijT

i=0

j=0

auto float voltageinvoltageout

brdInit()

voltagein = anaInVolts(pin number)

voltageout = anaInVolts(pin number)

for()

if (voltageinlt25)

i++

printf(total number of customers today d ni)

if (voltageoutlt25)

j++

T=i-j

printf(customers presence in the store= d nT)

some of the commands which were used to complete the task success are as follows

(1) kbhit

syntax int kbhit(void)

description detects keystrokes in the Dynamic C studio window

Return value 0 If a key has been pressed 0 otherwise

Library UTILLIB

(2) float anaInVolts(unsigned int channel) discription Reads the state of an AD converter input channel and uses the previously set calibration constants to convert it to volts

PARAMETER channel is the AD converter input channel (0ndash10)

RETURN VALUE A voltage value corresponding to the voltage on the analog input channel SEE ALSOanaIn anaInCalib brdInit

(3) void anaInCalib(int channel int value1float volts1 int value2 float volts2)

Calibrates the response of the AD converter channel as a linear function using the two conversion pointsprovided Gain and offset constants are calculated and placed into global table _adcInCalibPARAMETERSchannel is the AD converter input channel (0ndash10)value1 is the first AD converter channel valuevolts1 is the voltage corresponding to the first AD converter channel valuevalue2 is the second AD converter channel valuevolts2 is the voltage corresponding to the second AD converter channel valueRETURN VALUE0 if successful-1 if not able to make calibration constantsCommands used

anaIn anaInVolts brdInitReads the voltage of an analog input channel by serially clocking out an 8-bit command to the AD converterdevice of the following formats

TLC2543 commandsD7ndashD4Channel 0 - 10Channel 11 = (Vref+ - Vref-)2Channel 12 = Vref-

Channel 13 = Vref+

Channel 14 = software powerdownD3-D2Output data length01mdash8 bits00mdash12 bits (normally used as default)11mdash16 bits (not supported by driver)D1Output data format0mdashMSB first1mdashLSB first (not supported by driver)D0Mode of operation0mdashUnipolar (normally used as default)1mdashBipolar

Example Programms which pioneered for the main program

Sample server program

This sample program shows how to use the for loops in the Dynamic c programming language

server program

define TCPCONFIG1

use ldquodcrtcplibrdquo

use ldquohttplibrdquo

ximport ldquodworkhellowwwhtmlrdquohellowww_html

SSPEC_MIMETABLE_START

SSPEC_MIME(ldquohtmlrdquordquotexthtmlrdquo)

SSPEC_MIMETABLE_END

SSPEC_RESOURCETABLE_START

SSPEC_RESOURCE_XMEMFILE(ldquohellowwwhtmlrdquohellowww_html)

SSPEC_RESOURCETABLE_END

void main()

sock_init()

http_init()

for()

http_handler()

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

i++

printf(total number of customers today d ni)

if (voltageoutlt25)

j++

T=i-j

printf(customers presence in the store= d nT)

some of the commands which were used to complete the task success are as follows

(1) kbhit

syntax int kbhit(void)

description detects keystrokes in the Dynamic C studio window

Return value 0 If a key has been pressed 0 otherwise

Library UTILLIB

(2) float anaInVolts(unsigned int channel) discription Reads the state of an AD converter input channel and uses the previously set calibration constants to convert it to volts

PARAMETER channel is the AD converter input channel (0ndash10)

RETURN VALUE A voltage value corresponding to the voltage on the analog input channel SEE ALSOanaIn anaInCalib brdInit

(3) void anaInCalib(int channel int value1float volts1 int value2 float volts2)

Calibrates the response of the AD converter channel as a linear function using the two conversion pointsprovided Gain and offset constants are calculated and placed into global table _adcInCalibPARAMETERSchannel is the AD converter input channel (0ndash10)value1 is the first AD converter channel valuevolts1 is the voltage corresponding to the first AD converter channel valuevalue2 is the second AD converter channel valuevolts2 is the voltage corresponding to the second AD converter channel valueRETURN VALUE0 if successful-1 if not able to make calibration constantsCommands used

anaIn anaInVolts brdInitReads the voltage of an analog input channel by serially clocking out an 8-bit command to the AD converterdevice of the following formats

TLC2543 commandsD7ndashD4Channel 0 - 10Channel 11 = (Vref+ - Vref-)2Channel 12 = Vref-

Channel 13 = Vref+

Channel 14 = software powerdownD3-D2Output data length01mdash8 bits00mdash12 bits (normally used as default)11mdash16 bits (not supported by driver)D1Output data format0mdashMSB first1mdashLSB first (not supported by driver)D0Mode of operation0mdashUnipolar (normally used as default)1mdashBipolar

Example Programms which pioneered for the main program

Sample server program

This sample program shows how to use the for loops in the Dynamic c programming language

server program

define TCPCONFIG1

use ldquodcrtcplibrdquo

use ldquohttplibrdquo

ximport ldquodworkhellowwwhtmlrdquohellowww_html

SSPEC_MIMETABLE_START

SSPEC_MIME(ldquohtmlrdquordquotexthtmlrdquo)

SSPEC_MIMETABLE_END

SSPEC_RESOURCETABLE_START

SSPEC_RESOURCE_XMEMFILE(ldquohellowwwhtmlrdquohellowww_html)

SSPEC_RESOURCETABLE_END

void main()

sock_init()

http_init()

for()

http_handler()

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

(3) void anaInCalib(int channel int value1float volts1 int value2 float volts2)

Calibrates the response of the AD converter channel as a linear function using the two conversion pointsprovided Gain and offset constants are calculated and placed into global table _adcInCalibPARAMETERSchannel is the AD converter input channel (0ndash10)value1 is the first AD converter channel valuevolts1 is the voltage corresponding to the first AD converter channel valuevalue2 is the second AD converter channel valuevolts2 is the voltage corresponding to the second AD converter channel valueRETURN VALUE0 if successful-1 if not able to make calibration constantsCommands used

anaIn anaInVolts brdInitReads the voltage of an analog input channel by serially clocking out an 8-bit command to the AD converterdevice of the following formats

TLC2543 commandsD7ndashD4Channel 0 - 10Channel 11 = (Vref+ - Vref-)2Channel 12 = Vref-

Channel 13 = Vref+

Channel 14 = software powerdownD3-D2Output data length01mdash8 bits00mdash12 bits (normally used as default)11mdash16 bits (not supported by driver)D1Output data format0mdashMSB first1mdashLSB first (not supported by driver)D0Mode of operation0mdashUnipolar (normally used as default)1mdashBipolar

Example Programms which pioneered for the main program

Sample server program

This sample program shows how to use the for loops in the Dynamic c programming language

server program

define TCPCONFIG1

use ldquodcrtcplibrdquo

use ldquohttplibrdquo

ximport ldquodworkhellowwwhtmlrdquohellowww_html

SSPEC_MIMETABLE_START

SSPEC_MIME(ldquohtmlrdquordquotexthtmlrdquo)

SSPEC_MIMETABLE_END

SSPEC_RESOURCETABLE_START

SSPEC_RESOURCE_XMEMFILE(ldquohellowwwhtmlrdquohellowww_html)

SSPEC_RESOURCETABLE_END

void main()

sock_init()

http_init()

for()

http_handler()

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

This sample program shows how to use the for loops in the Dynamic c programming language

server program

define TCPCONFIG1

use ldquodcrtcplibrdquo

use ldquohttplibrdquo

ximport ldquodworkhellowwwhtmlrdquohellowww_html

SSPEC_MIMETABLE_START

SSPEC_MIME(ldquohtmlrdquordquotexthtmlrdquo)

SSPEC_MIMETABLE_END

SSPEC_RESOURCETABLE_START

SSPEC_RESOURCE_XMEMFILE(ldquohellowwwhtmlrdquohellowww_html)

SSPEC_RESOURCETABLE_END

void main()

sock_init()

http_init()

for()

http_handler()

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

FLOW CHART

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

BLOCK DIAGRAM OF THE CIRCUIT

ANALOG INPUT

RABBIT BL2000

EXECUTION CIRCUIT SYSTEM

MONITOR OR DISPLAY

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

RESULT

The analog variations in the optical sensors gives the incrementation and decrementation in the program counter as it is a continuous for loop its never going to be stoped and the arithametic operation counting is donewhich is interlinked with the rabbit board and the count is updated in the web server

CONCLUSION

This program works under certain conditions onlysuch as when there is no much repetation because analog to digital conversion takes some time to get the calculations donewe can use different sensors with high transmission and reception qualities but the costfactor becomes high

Due to the un-natural atmospheric conditions the humidity light variations in room may also cause to the failure of the systemIn most of the cases using of photosensors photodiodes can give better result

In the program i have taken 25v as the cutoff voltage range such that to identify the change in the light intensity The variation in the light intensity or the analog inputs causes the open circuit and it just takes it as a count either to increment or to decrement itThe count is dependent on the for() for loop in the program

SUGGESTIONS

Continuous input voltage may cause internal noise and may cause to hardware-failure so low-noise sensors can be used

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

By using a high intensity source of analog inputs like laser can give effective outputs and accurate results but to embed the rabbit port with the laser is a much though and risky process

By using infrared LEDrsquos the task can be made to locost and the only drawback with infrared ledrsquos is that it has low input ranges and so external noise my cause the system failure

Using photo sensors is a good deal with the aim which has give

Variations in input voltages causes aging of the photo sensor

REFERENCE

httpwwwrabbitcomproductsbl2000

httpwwwrabbitcomdocumentationSamplesRoadmaproadmappdf

httpwwwrabbitcomdocumentationdocsmanualsDynCFunctionReferenceDynCFunRefpdf

httpwwwtaosinccomdefaultaspx

httpwwwgoblackdedesydigitaltsensorentsl-250tsl250rpdf

httpsearchdigikeycomscriptsDkSearchdksusdlllang=enampWTmedium=cpcampWTcampaign=1654ampsite=UKampWTterm=optical+sensorampkeywords=Optical+SensorsampWTcontent=textampWTsource=googleampcshift_ck=1393856448cs605581080ampWTsrch=1

APPENDIX

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

appendix a

about case study

The number of customers coming in and going out of a supermarket needs to be monitoredThe system should be capable of recording data on total customers visiting the store and the total number of customers in the store at any one timeThe data needs to be reducedBoth the recorded and instantaneous data should be made available to the store managerrsquos Pc

advantages

low-cost and low fidelity power

utilizes loopback in program such that overlaping is minimized

simple Dynamic c program helps in minimizimg runtime

miniature in hardware

disadvantages

The only disadvantage with this system is due to the light and external noise interface may cause in failure or improper result

appendix b

connections are done as per the block diagram shone in the circuit block diagram

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer

available options we can choose any of the following photo sensors

DEVICE TA PACKAGE minus LEADS PACKAGE DESIGNATOR ORDERING NUMBERTSL260R 0C to 70C 3-lead Sidelooker S TSL260RTSL260R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL260RminusLFTSL260R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL260RSMminusLFTSL261R 0C to 70C 3-lead Sidelooker S TSL261RTSL261R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL261RminusLFTSL261R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL261RSMminusLFTSL262R 0C to 70C 3-lead Sidelooker S TSL262RTSL262R 0C to 70C 3-lead Sidelooker mdash Lead (Pb) Free S TSL262RminusLFTSL262R 0C to 70C 3-lead Surface-Mount Sidelooker mdash Lead (Pb) Free SM TSL262RSMminusLF

appendix c

An Overview of Dynamic C

Dynamic C has been in use worldwide since 1989 It is specially designed for programmingembedded systems and features quick compile and interactive debugging A completereference guide to Dynamic C is contained in the Dynamic C Userrsquos ManualYou have a choice of doing your software development in the flash memory or in the dataSRAM included on the Jackrabbit The flash memory and SRAM options are selectedwith the Options gt Project Options gt Compiler menuThe advantage of working in RAM is to save wear on the flash memory which is limitedto about 100000 write cycles The disadvantage is that the code and data might not bothfit in RAMNOTE An application can be developed in RAM but cannot run standalone from RAMafter the programming cable is disconnected All standalone applications can only runfrom flash memoryNOTE Do not depend on the flash memory sector size or type Due to the volatility ofthe flash memory market the Jackrabbit and Dynamic C were designed to accommodateflash devices with various sector sizesDeveloping software with Dynamic C is simple Users can write compile and test C andassembly code without leaving the Dynamic C development environment Debuggingoccurs while the application runs on the target Alternatively users can compile a programto an image file for later loading Dynamic C runs on PCs under Windows 95 and laterPrograms can be downloaded at baud rates of up to 460800 bps after the program

  • Description
    • Features
      • Programming the BL2000 Single-Board Computer
  • Description
    • Features
      • Programming the BL2000 Single-Board Computer