Skip to content

samwelkinuthia/Dog-care-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

DOG CARE SYSTEM

Dog care system with sound recognition, feeding mechanism and supporting web application.

About

A demo project that simulates a dog care system with the three functionalities above. Sound classifcation is done for the "bark", "growl" and "whine" sounds that can each be used to determine the dog's mental/physical state. Scheduling is done for deworming, feeding and grooming.

Project diagram

Screenshot from 2022-01-09 21-43-38

The servomotor can be attached to a dog feeder with rotating dispense. More info about the servo can be viewed on this repo.

Installation

1. Raspberry pi audio classifier setup

  • Use edge impulse to train an audio classifier model.
  • Create a mongodb atlas account and create a database.
  • Follow the steps in the mongodb docs to obtain the connection string.
  • Follow the steps in the servo control repo to setup the Raspberry Pi - Servomotor control.
  • Clone the sound classifier repo on the pi and follow the steps in the readme. Open a terminal and install edge-impulse by running npm install edge-impulse-linux -g --unsafe-perm.
  • Ensure SoX is installed.
  • Download your model file from your Edge Impulse project/account with: edge-impulse-linux-runner --download modelfile.eim
  • Connect a microphone and run node classify-audio.js modelfile.eim <microphone name>

2. Web app setup

  • Clone this repo on your machine.
  • Install required dependencies by running npm install in both the server and client folders.
  • Obtain mongodb connection string and twilio api keys from mongodb atlas and Twilio
  • In the server folder, create a .env file, add the following entries and replace:
ATLAS_URL = <your mongodb connection string>
TWILIO_ACCOUNT_SID = <your twilio sid>
TWILIO_AUTH_TOKEN = <your twilio auth token>
  • Edit server.js and add your twilio details
function sendSms(message) {
  client.messages
      .create({
        body: message,
        from: 'YOUR TWILIO ACCOUNT NUMBER',
        to: 'TWILIO CONNECTED PHONE NUMBER'
      })
      .then(message => console.log(message.sid));
}
  • Install nodemon globally by running npm install -g nodemon
  • In the server folder run nodemon server.js
  • In the client folder run npm start and navigate to https://localhost:3000

Pre-Requisites

  • Edge impulse modelfile
  • Node Js
  • SoX