The Tech Dog team: David Dmitruk (left), Sipeng Liang, Baret Barker, Jordan Wright
For our final project we decided to create a high tech dog collar that could address a range of different problems pet owners may face. Som
e of the issues we wanted to address were how to deal with a dog that will not stop barking without resorting to a shock collar, how to prevent dogs from being left overheating inside cars, and how to keep track of a dog that escapes from the owner. All of these sensors would be contained in a beautiful barrel design like that one pictured to the right.
To address these problems we came up with four features. a sound sensor connected to a speaker so that every time the dog barks you can give it a pre-recorded message to tell it to be quiet or simply bark back at the dog if you want to have some fun with it, a temperatures sensor connected to an alarm to alert the owner if the dog gets left in a car and overheats, a gps to track the dog, and an accelerometer connected to LEDs so that no battery power is wasted when the dog is not moving, and the lights can react directly to motion for a cool affect. However, for our prototype the speaker and alarm were replaced by a simple buzzer, and the gps location data was stored internally in the Arduino’s memory chip.
Once we had our plans set up we began construction. We started with the sound sensor. Originally we were intending to build the sound sensor circuit ourselves. The output voltage from the sensor was extremely small so we attempted to build an amplifier. In the end we had to scrap this idea, because we discovered that the amplifiers we use in lab need a negative power voltage (Vcc-) to function. It would not work when we connected it to ground, and we had no way of producing a negative voltage from the Arduino board. We ended up purchasing the sensors shown below. When we measured the output of these sensors we were getting a 32V output, so we build a voltage divider with a 1.5 kOhm and 8.2 kOhm resistor in series to bring the voltage down to the 5V that the Arduino can read. The output of this sound sensor was then coded to set off the buzzer when activated.
Next, we build our accelerometer. This used I2C communication, meaning it is only meant to communicate over a short distance with other devices, and it can allow communication between multiple “slave” and “master” chips. This was perfect for our application, because it only needed to send information to the LEDs that were located in the same location as the sensor. We coded the accelerometer, so that when motion was detected the LED’s would light up in a red, green, blue pattern. This meant no battery power was wasted by the LEDs when the dog was resting, and it is easier to see the dog when it is running around at night. The inside of the accelerometer contains capacitor plates attached to springs that move around due to acceleration forces on the sensor. The change in capacitance causes changes in voltage.
We also added a GPS to our collar, so that you can track the dog if it gets out of your sight. The GPS we added uses UART communication. It receives signals from satellites orbiting earth and uses the difference in time between the signals to know the coordinates of the device. We considered transmitting our gps location data to the computer using an XBee antenna, but it was expensive, and so we made due by simply storing the coordinates on the Arduino boards internal data chip.
The temperature sensor we used was (TMP36). It was fairly straight forward to implement. The voltage across it is directly proportional to the temperature, so we were able to relate the voltage output to a temperature. A simple if statement was added to the arduino code so that when the temperature reached a set point the buzzer would sound and the LEDs would flash read. The temperature to voltage ratio is shown of the graph to the right.
Finally, we connected an LED strip to the board. This was a little bit more difficult that anticipated. The LEDs needed 12 volts of power to operate rather than the 3-5V power that the arduino board can provide. This meant we need to use an external battery and transistors. To control the LED output 12 volts were connected to the annode, and then the lights were turned on by grounding their cathode. We connected a transistor to each of the three LED colors and connected the transistor to ground, so that the cathodes were grounded when they received power from the Arduino board. The 12 volt batter we used was smaller than the AA cartridge we had so we squeezed a copper wire between popsicle sticks wrapped with electric tape to slide in and connect the small battery to the terminals of the cartridge.
Once we had all our sensors fully operations we combined them all into a single PCB with the following schematic and layout. This allowed all of the sensors to fit into a smaller space that if they were laid out on a breadboard and it made the connections much stronger.
The cost of the project is broken down in the following chart:
We also calculated the power consumption. One thing to note is that each LED used 10 mA of power and the 12 V batter only provided 50 mAhr. This means that a set of lights could only last 30 minutes running continuously. This may be a problem if you have an active dog. If we were to do this project again we could have used multiple batteries of lower voltage in series or more 12 volt batteries in parallel to fill the other two spaces on the cartridge and provide power for longer.
The code can be seen on a separate page. I will comment more on this code later…