Transcript for:
Visitor Counter Setup and Programming

Assalamualaikum warahmatullahi wabarakatuh welcome back to the Alvian Center channel in this video I will share How to make a tool to count visitors using a Pir sensor in the tinkercat simulator How to follow this video until the end But before that, just a little information at Samadalan University there is an Electrical Engineering study program so for those of you who want to study in Yogyakarta majoring in Electrical Engineering, you can try to check the link in the description of Electrical Engineering at Sadlan University there You can also develop your skills by joining the robot team and also the electric car team Oh yeah, don't forget to like, comment and subscribe to the Alvian Center channel and don't forget to turn on the bell because there are so many who have watched on this channel but forgot to subscribe so that's why I remind you to subscribe if you have, let's go straight to the tutorial Okay Guys in this tutorial we want to use the tinkercat simulator Now let's open the browser first, you are free to use any browser here I use Chrome you can type here tinkercat like this then you choose the top one for those of you who don't have an account you can register first then you can login, well if you have logged in then you will be shown a dashboard page like this if it appears like this you can click create then click circuit and you will be directed to a blank page menu Project like this you can change the name of the project here on the top left you can change it to a visitor counter or yes your project that you want to make like that Well then here we will first assemble the components we enter first starting from the microcontroller which is Arduino Uno R3 Well we click then we slide the components you can access on the right here yes next we need something called LCD you can click here components then click all You can scroll down for the LCD select LCD 16 * 2 i2c or i2c like that next we also need something called a sensor namely a pir sensor you can scroll down or up at the top here yes this pir sensor then we need two sensors we can copy by clicking ctrl c then clicking ctrl V Well then we get two components then we need something called eh push button like this we add it here then we need something called LED then add ee resistor led this can be changed the color becomes green then we also need something called piezo or buzzer put it here okay if we have started the frame yes guys yes Starting from the LCD first you can Click the LCD then you set it first for the type to pcf8574 then addr yes you choose 39 0 * 27 like this Well then if you have connected it for gnd to the gnd PIN on the Arduino like this Okay we change the color to black then vcc is at 5 volts you can set it down here to 5 volts like this change the color to red yes make it a habit for G black and vcc red yes so you don't get confused then for SDA we connect it to the SDA section on the Arduino we also change the color to make it easier then the sccl we connect to the sccl section on the Arduino Okay we slide this first this we change the color like this Okay after finishing for the LCD we move on to the eh sensor section friends for the left sensor there are three PINs yes These are also three PINs we like to connect first for the power to the power the right side of the right sensor is like this Then for eh Power this color is red yes gnd-nya we also like this the color is black well then for the right side we press for the signal this to analog PIN 0 yes the bottom part is like this we change the color then this one we press to analog PIN 1 like this Okay this was connected earlier yes guys for gnd and power Well we choose one can start from here or from here we start from this one or this one well this Power we press to 5 volts like this we change it to red and for the gnd we connect to the gnd section like this Well then next we move on to the eh led section first for the cathode LED we press to the negative section like this like this like this well negative on piezo so for the negative we just unite well then for this one it's also the same to the e button for gnd like this and this we also connect it to this section don't be confused this because the gnd we connect into one yes guys this becomes one gnd all become the same Well we just connect for the positive pin yes for the LED we connect to PIN 5 yes for the LED to PIN 5 like this why pin 5 Bang because in the program it uses PIN 5 guys this if for example you want to change You also change in the program for piezo to PIN 6 and then for the reset button yes make sure this crosses yes guys yes Well like this this one to PIN 7 like this we change the color okay we enlarge this please screenshot if friends want a screenshot for the wiring is finished like this you can screenshot okay okay if we have moved on to the program part yes guys yes this we slide first we click the code on the top right here we select the block to text like this we click continue for the program I've put it in the description link So you can just copy paste this I delete first delete then we slide a little to clarify the program now the program becomes like this guys if you see what's in the description like this the program you can block everything like this we you can block everything don't miss anything then Right Click then copy and you open your browser that was your Project that was Right Click then paste Well then the program will go here like that Well in this program we use a library called from Liquid Crystal i2c for the LCD Besides that, we don't use other libraries, guys, okay Well, I'll give you an explanation first, you can while I'm giving you an explanation, you can subscribe first, guys, like Alvian center like this, subscribe, okay Thank you for subscribing Okay, if we've tried it, eh, let's discuss a little bit about the pins here, guys, the PIR sensor PIN 1 is in an0 P 2 in A1, then the LED earlier, PIN 5 buzzer in PIN 6, then the reset button in PIN 7, then here there is a count variable or to calculate it, here there is a condition variable, yes, for the PIR sensor, then in the void setup there is a serial begin to display information on the serial monitor Then initialization for the LCD, then there is a backlight that also displays this information, then the PIR mode PIN is as an input, the LED buzzer and the reset button are as output Sorry The reset button is an input pull up for the buzzer and the LED that is the output, yes, we set it for the buzzer and the LED as low first, so it's turned off first, after that we read it in the void Loop sensor reads the value from p pin 1 yes we read the value then we process it if the pir detects or is high then it will add the value of the visitor, namely visitor a then it will turn on the E buzzer and the led if for example it is not detected it will turn off or detect as no movement like that or low then this is the same for the second so the sensor is the same only the difference is This is the top sat sensor and the bottom one is sensor two like that and then this is for the reset button yes or back to no0 so the countoun is the same as 0 countoun 1 or the P 2 is the same as 0 too so the visitor is 0 all so it is reset to 0 like that guys for the program eh I think it's clear enough if for example there are questions please eh you guys just write in the comments column here we try to start the simulation yes now we click start simulation we wait a moment there should be no problem yes okay cer already please subscribe already this KUD appears empty yes friends Because this has not detected this we minimize it first Kara we want to see the sensor we click the one next to okay ung a add S we move again visitor a add so du we move again visitor A so 3 so 4 so 5 so 6 now you can also see that the buzzer and the LED are on 7 8 and so on until e as much as possible until you can Click this button it's zero again like that this is for a like that guys yeah Now for B or visitor B this other sensor when we move it then B will increase like this now when visitor a comes Well he also adds like this Okay like that now you want to reset you Click this reset button click press it will be 0 like that guys yeah Now this ee you can apply for ee visitors who come to your house during Eid maybe who knows or to visitors to your shop or to your house or to your workplace like that So you can count how many visitors per day like that guys yeah Well ee Hopefully it can be understood and can be followed this tutorial Thank you for watching don't forget to like comment and subscribe to the Vian center channel and don't forget to turn on the bell or end Billahi Taufik walhidayah wassalamualaikum warahmatullahi wabarakatuh