Barking Desk Guard Dog - Seeed Studio

1y ago
21 Views
2 Downloads
7.00 MB
36 Pages
Last View : 16d ago
Last Download : 3m ago
Upload by : Kamden Hassan
Transcription

BarkingDeskGuardDogYou can watch a video of it here:http://www.youtube.com/watch?v 8BghIeelvtY1Welcometoastep- ‐by- experienceallofit.Toy Hacking Contest

didwechoosethatport/pin?”Toy Hacking Contest

y Hacking Contest

emBaseShield.Toy Hacking Contest

re)Connectthe2hookupwirestoanLED.Toy Hacking Contest

adsoftheLED.Color- icatorfornow.Toy Hacking Contest

tobeopened.Letussaveoursketchas“BarkingDog”Toy Hacking Contest

BarkingDeskGuardDog8Let us test out that when there is movement, then an LED will light up.Our code will look like below:Code available online Dog/blob/master/ 01 Motion Sensor/ 01 Motion Sensor.pde#define PIR 10#define PIRIND 11// pin 10 for PIR signal// recycle N/C pin from PIR to led test indicator// keep statesboolean isMoveDetected; // if PIR triggeredvoid setup() {// initialize motion sensor pinisMoveDetected false;pinMode(PIR, INPUT);pinMode(PIRIND, OUTPUT);}void loop() {if(digitalRead(PIR) && !isMoveDetected) {digitalWrite(PIRIND,HIGH);if(!isMoveDetected) {isMoveDetected true;}}}Try to load this up to our Seeeduino and look at how it works.Does the LED light up when it detects your movement?Take time also to adjust the sensitivity of the PIR sensor at this point.Toy Hacking Contest

//seeedstudio.com/wiki/index.php?title Twig Sound Recorder v0.92b#How to controll it eShield.Toy Hacking Contest

reful! Ask for help or let someone teach you if you are notfamiliar with soldering.Toy Hacking Contest

ustonly1(thefarthestterminal)tothe lconnectthesoundrecorder’s onnectedfornow.Let us go back to our Arduino IDE and test our code. We will make the sound recorder play sounds when the motionsensor is triggered. We will use one of our pre-made libraries to make the sound recorder work. Let us check aseparate guide on how it is done 29/grove-sound-recorder-library/Our code will now look like below:Code available online Dog/blob/master/ 02 Sound Recorder/ 02 Sound Recorder.pde#include GroveSoundRecorder.h // include our sound recorder library// define sensor pins#define SOUNDRECSEL1 2 // Grove pin 2 for sound recorder#define PIR 10// pin 10 for PIR signal#define PIRIND 11// recycle N/C pin from PIR to led test indicator// initialize a recorderGroveSoundRecorder recorder(SOUNDRECSEL1);// keep statesboolean isMoveDetected; // if PIR triggeredvoid setup() {// initialize the sound recorderrecorder.initialize();// initialize motion sensor pinisMoveDetected false;pinMode(PIR, INPUT);pinMode(PIRIND, OUTPUT);}void loop() {if(digitalRead(PIR) && !isMoveDetected) {//Serial.println("Something ed) {recorder.beginPlaybackLoop(TRACK2);Toy Hacking Contest

BarkingDeskGuardDog12isMoveDetected true;}}}Try to load this up to our Seeeduino and look at how it works.Do the LED light up and the sound recorder play TRACK 2 when it detects your H24orENTERforCH3Toy Hacking Contest

oit.Careful! Ask for help or let someone teach you if you are notfamiliar with IN7oftheStemBaseShield.Toy Hacking Contest

randthebase).We will now make the barking stop by using a 3 digit code combination. We will again use one of our pre-madelibraries to make the Twig I2C Touch Sensor work. Let us check a separate guide on how it is done 27/grove-i2c-touch-sensor-library/Our code will look like below:Code available online Dog/blob/master/ 03 Touch Sensors/ 03 Touch Sensors.pde#include Wire.h // include I2C library#include GroveMultiTouch.h // include our Grove I2C touch sensor library#include GroveSoundRecorder.h // include our sound recorder library// define sensor pinsToy Hacking Contest

dDogSOUNDRECSEL1 2TOUCHINT 7PIR 10PIRIND 11PASSCODELEN 3//////////15Grove pin 2 for sound recorderarduino pin 7 for I2C touch interruptpin 10 for PIR signalrecycle N/C pin from PIR to led test indicatorlength of passcode// initialize a recorderGroveSoundRecorder recorder(SOUNDRECSEL1);// initialize the Grove I2C touch sensorGroveMultiTouch feelers(TOUCHINT);// keep track of 4 pads' statesboolean padTouched[4];// keep statesboolean isMoveDetected; // if PIR triggeredboolean isCodeCorrect; // if code is goodbyte inputcode[PASSCODELEN]; // user input codebyte password[PASSCODELEN] { // the secret code is 3, 1, 23,1,2};int inputcounter;void setup() {Wire.begin(); // needed by the GroveMultiTouch lib// initialize the containersfor(int i 0; i 3; i ) {padTouched[i] false;}// initialize the touch sensorsfeelers.initialize();inputcounter 0;for(int i 0; i PASSCODELEN; i ) {inputcode[i] 0;}isCodeCorrect false;// initialize the sound recorderrecorder.initialize();// initialize motion sensor pinisMoveDetected false;pinMode(PIR, INPUT);pinMode(PIRIND, OUTPUT);}void loop() {if(digitalRead(PIR) && !isMoveDetected) {//Serial.println("Something ed) {recorder.beginPlaybackLoop(TRACK2);isMoveDetected true;}}if(isMoveDetected) {feelers.readTouchInputs(); // test read the touch sensors// loop through our touch sensors 1 to 4for(int i 0; i 3; i ) {// get the touch state based on pin #if(feelers.getTouchState(i)) {// flag the touch sensor statepadTouched[i] true;}else {if(padTouched[i]) {if(inputcounter PASSCODELEN) {inputcounter 0;}Toy Hacking Contest

BarkingDeskGuardDog16switch(i) {case 0:inputcode[inputcounter] 1;inputcounter ;break;case 1:inputcode[inputcounter] 2;inputcounter ;break;case 2:inputcode[inputcounter] 3;inputcounter ;break;case 3:delay(500);// check if input code is goodisCodeCorrect true;for(int i 0; i PASSCODELEN; i ) {if(inputcode[i] password[i]) {isCodeCorrect true;}}// check if shutdown code is correctif(isCodeCorrect) {// turn off alarmisMoveDetected ck();delay(5000); // delay to settle down}// reset user input codeinputcounter 0;for(int i 0; i PASSCODELEN; i ) {inputcode[i] false;}break;default:break;}delay(300);}// reset the touch sensor statepadTouched[i] false;}}}}Try to load this up to our Seeeduino and look at how it works.Do the LED light up and the sound recorder play TRACK 2 when it detects your movement?When we touch 1, 2, 3 and 4(enter), does the barking go on?When we touch 3, 1, 2 and 4(enter), which is the correct code, does the barking stop?When we touch 1 and 4(enter), does the barking go on?When we touch continuously (more than 4 touches without 4(enter)), does the barking go on?When we touch 4(enter) without any touches with the code numbers, does the barking go on?Toy Hacking Contest

d.Toy Hacking Contest

dmakesuretheyarenotloose.Goodjobwiththehardware!We will now make the buzzer notify us if we would enter a wrong key combination with 2 long beeps. If we arecorrect then we get 3 short beeps.Our code will look like below:Code available online Dog/blob/master/ 04 Final Code/ 04 Final Code.pde#include Wire.h // include I2C library#include GroveMultiTouch.h // include our Grove I2C touch sensor library#include GroveSoundRecorder.h // include our sound recorder library// define sensor pins#define SOUNDRECSEL1 2#define TOUCHINT 7#define BUZZER 8#define PIR 10#define PIRIND 11#define PASSCODELEN 3////////////Grove pin 2 for sound recorderarduino pin 7 for I2C touch interruptGrove pin 8 for buzzer signalpin 10 for PIR signalrecycle N/C pin from PIR to led test indicatorlength of passcode// initialize a recorderGroveSoundRecorder recorder(SOUNDRECSEL1);// initialize the Grove I2C touch sensorGroveMultiTouch feelers(TOUCHINT);// keep track of 4 pads' statesboolean padTouched[4];// keep statesboolean isMoveDetected; // if PIR triggeredboolean isCodeCorrect; // if code is goodbyte inputcode[PASSCODELEN]; // user input codebyte password[PASSCODELEN] { // secret code3,1,2};int inputcounter;void setup() {Wire.begin(); // needed by the GroveMultiTouch lib// initialize the containersToy Hacking Contest

BarkingDeskGuardDog19for(int i 0; i 3; i ) {padTouched[i] false;}// initialize the touch sensorsfeelers.initialize();inputcounter 0;for(int i 0; i PASSCODELEN; i ) {inputcode[i] 0;}isCodeCorrect false;// initialize the sound recorderrecorder.initialize();// initialize buzzer pinpinMode(BUZZER,OUTPUT);// initialize motion sensor pinisMoveDetected false;pinMode(PIR, INPUT);pinMode(PIRIND, OUTPUT);}void loop() {if(digitalRead(PIR) && !isMoveDetected) {//Serial.println("Something ed) {recorder.beginPlaybackLoop(TRACK2);isMoveDetected true;}}if(isMoveDetected) {feelers.readTouchInputs(); // test read the touch sensors// loop through our touch sensors 1 to 4for(int i 0; i 3; i ) {// get the touch state based on pin #if(feelers.getTouchState(i)) {if(!padTouched[i]) {// sound the buzzerdigitalWrite(BUZZER,HIGH);}// flag the touch sensor statepadTouched[i] true;}else {if(padTouched[i]) {// turn buzzer offdigitalWrite(BUZZER,LOW);if(inputcounter PASSCODELEN) {inputcounter 0;}switch(i) {case 0:inputcode[inputcounter] 1;inputcounter ;break;case 1:inputcode[inputcounter] 2;inputcounter ;break;case 2:inputcode[inputcounter] 3;inputcounter ;break;case 3:delay(500);// check if input code is goodToy Hacking Contest

BarkingDeskGuardDog20isCodeCorrect true;for(int i 0; i PASSCODELEN; i ) {if(inputcode[i] password[i]) {isCodeCorrect true;}}// check if shutdown code is correctif(isCodeCorrect) {// turn off alarmisMoveDetected ck();// sound buzzer 3 times for correctfor(int b 0;b 3;b ) (BUZZER,LOW);delay(100);}delay(5000); // delay to settle down}else {// sound buzzer 2 long beeps, means wrongfor(int b 0;b 2;b ) (BUZZER,LOW);delay(200);}}// reset user input codeinputcounter 0;for(int i 0; i PASSCODELEN; i ) {inputcode[i] false;}break;default:break;}delay(300);}// reset the touch sensor statepadTouched[i] false;}}}}Try to load this up to our Seeeduino and look at how it works.Do the LED light up and the sound recorder play TRACK 2 when it detects your movement?When we touch 1, 2, 3 and 4(enter), does it do 2 long beeps and the barking goes on?When we touch 3, 1, 2 and 4(enter), which is the correct code, does it beep 3 times, then the barking stops?When we touch 1 and 4(enter), does it do 2 long beeps and the barking goes on?When we touch continuously (more than 4 touches without 4(enter)), does it do 2 long beeps and it still barks?When we touch 4(enter) without any touches with the code numbers, does it do 2 long beeps and it still barks?Toy Hacking Contest

andStemBaseShield.We would have to consider the size of the dog against thecomponents that we would put in.Toy Hacking Contest

than1inchateachendofthecut.Be careful with handling sharp objects!Toy Hacking Contest

ghthaveauseforitlater.Toy Hacking Contest

nsorfirst.Toy Hacking Contest

e,wecanseethatthefeelersina2x2gridpattern.Toy Hacking Contest

ngitin Toy Hacking Contest

stuffitindeepthedog’shead,maybenearitsmouth.Toy Hacking Contest

entisthebuzzer.Toy Hacking Contest

themastheanchoringpoints.Toy Hacking Contest

onsarenotloose.Toy Hacking Contest

ustlikeAstroboy).Toy Hacking Contest

detection,soundandbuzzer)iftheyareallworking.Toy Hacking Contest

attachthebatteryyet!Toy Hacking Contest

BarkingDeskGuardDog34Materials:1anti- opofthebeaniebag/bubblewrap.Toy Hacking Contest

tomoftheSeeeduino.Woof woof!I am guard nd:- ‐ HowwillIarm/disarmthedogwhenitisnotinuse?- ‐ HowwillIintegrateanon/offswitch?- ‐ d that’s it! We now have our barking desk guard dog that we can use and scare off people who are trying to takesomething, lets say your chocolate bar, from your desk!I hope you enjoyed this guide!Toy Hacking Contest

BarkingDeskGuardDog36For questions, contact nity.wordpress.comThank you Seeedstudio for these great products!Toy Hacking Contest

When we touch 3, 1, 2 and 4(enter), which is the correct code, does the barking stop? When we touch 1 and 4(enter), does the barking go on? When we touch continuously (more than 4 touches without 4(enter)), does the barking go on? When we touch 4(enter) without any touches with the code numbers, does the barking go on? !!!

Related Documents:

If the dog is barking at people it can see passing by, try blocking the dog's view. An anti-barking collar may be useful for some, but not all. Teach the dog to stop barking on command. When the dog is barking give a firm command such as 'cease' and call the dog to you. Praise the dog when it stops barking. If the dog will not .

the dog barking, try some of these simple tips - every dog is different! Do not reward the dog when it barks. Don't let the dog inside or give it attention - instead, reward the dog when it is quiet. Teach the dog to stop barking on command - give the dog a command when it is barking and reward the dog

identify the correct address of the offending dog; Complete the 'Barking Dog complaint form' in the center of this booklet. keep a diary of the dog's barking habits for a period of two (2) weeks, noting the date, time, weather conditions and duration of barking, and the reason as well as the effect the dog's barking is having on

q Predatory barking - barking occurs when the dog is chasing prey, or confronting something that might be prey. q Territorial barking - the dog barks when in his yard, or in the car, in his crate when people or animals approach. q Separation anxiety - barking occurs when the dog's familiar people are absent.

Barking Dog 6/5/05 3:51 PM Page 7 Study the diary to establish barking patterns to try to determine the reason for the dog's barking. Confirm that other nominated residents are being affected by the dog's barking. Advise the dog owner of the complaint, discuss possible solutions and inform them of their responsibilities.

Dogs barking. Penalty: 200 to 5,000. As a dog owner, you are responsible for ensuring that your dog is not creating a public nuisance by barking excessively. Nuisance barking also covers public places adjoining the premises. Removal of dog droppings. Penalty: Varies. Dog droppings are a source of annoyance to other users of footpaths and .

Barking dogs; Dog faeces; Roaming dogs; Aggressive dogs. 5.1 BARKING Barking dogs can be a difficult issue to deal with as every situation is different. The Dog Control Act 2000 defines a barking nuisance as a noise that consistently occurs or continues to such an extent that it unreasonably Version: 2, Version Date: 10/09/2021

ACCOUNTING 0452/12 Paper 1 October/November 2019 1 hour 45 minutes Candidates answer on the Question Paper. No Additional Materials are required. READ THESE INSTRUCTIONS FIRST Write your centre number, candidate number and name on all the work you hand in. Write in dark blue or black pen. You may use an HB pencil for any diagrams or graphs. Do not use staples, paper clips, glue or correction .