Sunday, May 9, 2021

DIGITAL COUNTER |R2C Technologies |Embedded system |IOT|AI|ML|

 DIGITAL COUNTER


 

 

Program description:

We are going to use IR sensor for detecting the interference and for each interference we need to count .So initialize a variable name  with int data type like count and initialize its value as 0(count=0).

In void setup() the input and output pins that we gonna use are declared.led pins 29(red led),10(green led),9(yellow led) are assigned as output.At initial state all  leds should  be in OFF state hence  all  leds are set to OFF state. Since we are using serial monitor for printing the information in order to print enable printing in serial monitor we need to declare serial.begin(115200) here 115200 represents the baud rate  of cc3200 launch pad ( an IoT microcontroller) used for  hardware implementation. It varies for each  launch pad model  hence we have be very careful in representing the baud rate of the launch pad.

In void loop the commands which are programmed to run repeatedly are declared here .We need to fetch the datas measured by the IR sensor for that we need analog pin because sensor will reads the physical signal which will be always in analog nature.In cc3200 launch pad  pin number 2,4,23,24 and 33 are in analog nature.In this programme I gonna use pin number 2 for reading analog input.In general if IR sensor detects any interference the sensor value will be less than 2800 else the sensor value will be at a range of 4500 . Hence we are using ‘ If ’ statement for the command followed by condition   sensor value < 2800.If the condition is true  the value of the variable 'count ' should be increased for that increament operator is enabled by declaring 'count++'  .After that  red led is programmed to switch ON for additional buzzer intimation buzzer’s positive terminal is connected to the pin number 29(red led pin) and  negative terminal is grounded .By doing so both the red led and buzzer will be made series connection .Using serial print we have to  print  "no of persons entered: " in this we have to make the count value to be displayed by declaring  count without double codes using serial print.For authorisation of persons who entering the room "Your entry is accepted" is printedb in serial monitor.If the above condition fails then all the leds are made to remain in "OFF" condition and the value of the variable "count" is initialized as zero.

Hardware description

For uploading the program to the cc3200 launch pad we need to connect pin 2 of SOP and tck together .The Vcc and ground of the IR sensor are connected to launch pad’s  Vcc and ground . The  Output of the IR sensor is connected to P58(pin number 2).A buzzer is connected to launch pad by connecting positive terminal to P64(pin number 29) and negative terminal is connected to ground of the launch pad.

Video demonstration:

Youtube link:

 https://youtu.be/pYpjF8k1ddE

USD TO INR C++ PROGRAMMING

  NALLAMUTHU GOUNDER MAHALINGAM COLLEGE                                                 POLLACHI-642001                                     ...