RFABulous Dog Food Bowl
RFABulous Dog Food Bowl
RFABulous Dog Food Bowl
The dog bowl uses infrared motion detection. This was deemed to be lacking in the aspect of interference. If the bowl were in direct sunlight or around certain fluorescent bulbs it would not work correctly. We also need a way to determine the approximate distance of an object so that the bowl will not open if a person walks by the sensor, only when a dog walks directly up to the bowl.

Hacking the dog bowl is easy. Follow these steps to prepare the bowl.

1. The bottom of the dog bowl has 6 screws that must be removed. Flip the dog bowl upside down and remove these screws.
2. Unscrew the screws holding in the circuit board and the infrared devices.
3. Remove the cables that connect the circuit board to the other devices on the bowl.
4. Take out the infrared module and circuit board.
5. Use the drill to drill out the "eyes" in front of the bowl where the infrared LEDs were (this is where the ultrasonic sensor will go).


Step 2: Assemble the circuit

RFABulous Dog Food Bowl
RFABulous Dog Food Bowl
RFABulous Dog Food Bowl
RFABulous Dog Food Bowl
The circuit consists of a buffer (used as a logic level shifter), a quad analog switch to switch between the serial ports, 4 transistors for the H-bridge, and a couple discrete components.

The circuit will allow the MSP430 to communicate with the modules and allows for the micro-controller to open and close the lid.

Next assemble the circuit on the breadboard.

Optional -A PCB can be drawn and printed so that the project is more professional and compact.
RFABulous Dog Food Bowl
sch+brd.zip38 KB

Step 3: Download the Android app for the dogbowl

RFABulous Dog Food Bowl
RFABulous Dog Food Bowl
RFABulous Dog Food Bowl
An Android app is used to chose one of the 3 modes. The default mode is auto-dog detection.

The distance of the bluetooth communication depends on the environment and strength of the Android bluetooth hardware. In testing, the range was around 100 feet.

Simply download the app and install it on the Android phone. Open the app and chose the bluetooth device labeled "linvor." The app will say connected and it may now be used to control the dog bowl.

Each setting will switch between different dog pictures and sounds.

The android phone can also scan the RFID tag to automatically open the app and enable bluetooth (make sure the android phone has NFC communication enabled).
RFABulous Dog Food Bowl
dog_bowl_app.zip1 MB

Step 4: Compile the code and download it to the MSP430

RFABulous Dog Food Bowl
Energia was used for this project.

The code is posted below. Simply compile the code and program it to the micro-controller


----------------------------------------------------------------------------------------------------------------.

#define READ 0x01

int count = 0;
int rval;
int dval;
int dvaltemp =1;
int runs = 0;
int dvalcount =0;
const int pingPin = P2_6;
const int pingReceive = P2_1;
const int m1 = P2_3;
const int m2 = P2_4;
const int sb = P1_5;
const int sr = P1_3;
const int ledpin = P2_5;
int rfidtagclose = 0;
int close =0;
long countt=0;
int open =0;
long duration;
long inches;
long cm;
int rfidtag = 0;
int temp=0;
int bowlopencnt =0;

char btread ='A';


void setup()
{
Serial.begin(9600);
pinMode(sb, OUTPUT);
pinMode(sr, OUTPUT);
digitalWrite(sb, LOW);
digitalWrite(sr, LOW);
pinMode(m1, OUTPUT);
pinMode(m2, OUTPUT);
pinMode(ledpin, OUTPUT);
pinMode(GREEN_LED, OUTPUT);

}



void loop()
{
if( count < 40)
{
digitalWrite(sr, HIGH);
Serial.print("!RW");
Serial.write(byte(READ));
Serial.write(byte(32));

if(Serial.available() > 0)
{
rval = Serial.read();
if (rval != 1)
{suppressAll();}
}



if(Serial.available() > 0) {
rval = Serial.read();
Serial.print("1st:");
Serial.println(rval);


}

if(Serial.available() > 0) {
rval = Serial.read();
Serial.print("2nd:");
Serial.println(rval);
if(rval == 149)
{
rfidtag = 0;

}
}

if(Serial.available() > 0) {
rval = Serial.read();
Serial.print("3rd:");
Serial.println(rval, HEX);
}

if(Serial.available() > 0) {
rval = Serial.read();
Serial.print("4th:");
Serial.println(rval, HEX);
Serial.println("-----------------");
}

delay(3);
//delay (11);

}
else
{
digitalWrite(sr, LOW);
}


if (count >45)
{
digitalWrite(sb, HIGH);
delay(10);
temp = Serial.read();
// Serial.println(temp);
if (temp == 65 || temp == 66 || temp == 67)
{
btread = temp;
// Serial.println(btread);

}
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(5);
digitalWrite(pingPin, LOW);

pinMode(pingReceive, INPUT);
duration = pulseIn(pingReceive, HIGH);
dvaltemp = Inches(duration);
// Serial.println(dval);
delay(10);
if(dvaltemp 0)
{
dvalcount = 0;
}


}
else
{
digitalWrite(sb, LOW);
}
count++;

if (count > 55)
{
count =0;

}

if((btread == 'A' && dval == 1 && rfidtagclose == 0) || btread == 'C')
{
bowlopencnt =0;
}

if(bowlopencnt {
digitalWrite(m2, HIGH);
digitalWrite(m1, LOW);
digitalWrite(ledpin, HIGH);
}
else
{
digitalWrite(ledpin, LOW);
digitalWrite(m1, HIGH);
digitalWrite(m2, LOW);
}

dvalcount++;
if(dvalcount {
dval =1;
}
else
{
dval =0;
}
if (dvalcount >300)
{
dvalcount = 295;
}

bowlopencnt++;
if(bowlopencnt>30)
{
bowlopencnt =20;
}


rfidtag++;
if(rfidtag < 250)
{
rfidtagclose = 1;
dvalcount = 290;
}
else
{
rfidtagclose = 0;
}

if (rfidtag>300)
{
rfidtag = 310;
}

delay(3);
//Serial.println(dvaltemp);


}
long Inches(long microseconds)
{
//calculation for speed of sound
return microseconds / 74 / 2;
}


void suppressAll()
{
if(Serial.available() > 0)
{ Serial.read();
suppressAll();
}
}


------------------------------------------------------------------------------------------------------------


This code can be optimized for the desired application.
RFABulous Dog Food Bowl
dog_bowl.zip4 KB

Step 5: Use the bowl

RFABulous Dog Food Bowl
RFABulous Dog Food Bowl
RFABulous Dog Food Bowl
RFABulous Dog Food Bowl
Now that the code is installed on the MSP430 and the hardware is set up, the bowl will now be operable.

After the first prototype was made, a second more optimized model was constructed. All of the electronic circuitry was implanted in the bottom of the dog bowl where the original circuit board was.

We also purchased more powerful RFID tags so that the distance of the tags to the scanner could be increased. The tags were then attached to two dog collars. The red collar has the "wrong" dog tag on it while the black collar has the "right" tag attached. The video below shows the original prototype bowl and the 2nd prototype in action.

http://www.youtube.com/watch?v=H9_31WN-UaA

Step 6: How it works

RFABulous Dog Food Bowl
The MSP430 uses a UART port to communicate with both the bluetooth module and the RFID reader. The Android App is a Bluetooth client that initiates the connection. The app sends a byte of data to the bluetooth module. When the "automatic dog mode" button is pressed, an "A" is sent over the bluetooth channel. The "open override" sends a "B" over the channel and the "close override" sends a "C".

The Ultrasonic module is sent a high pulse from the MSP430, this tells it to make an ultrasonic sound pulse. The ultrasonic sensor listens for the return echo. The time delay in the echo is used to calculate the distance of the object that reflected the signal. This is based off of the speed of sound.

Since both the bluetooth module and RFID reader communicate to the MSP430 using UART and the MSP430 only has a single UART port, the port must be split up with the switch IC. For half of the loop the MSP communicates with the bluetooth module, and for the other half of the loop, the MSP communicates to the RFID reader.

The H-bridge allow the MSP to control the motor. The MSP cant source enough current to diretly power the motor so the transistors, configured in an h-bridge configuration, act as current amplifiers.

A significant portion of the code is to control the timing of each event.
 
 

Tag cloud

make build easy simple arduino making homemade solar laser printed portable cheap mini building custom cardboard wooden create super lego turn paracord chocolate your paper light intel