 Get the audience early. Okay. Hi, I'm Joel Potishman, and my talk is UX for cats and dogs. So here's what happened. I'm a software developer and product manager in Brooklyn, and we have three cats and a dog. They're all rescues. And my daughter started college in the fall, 3,000 miles away, out in California, and she misses our pets. She especially misses our cat, Blintz. She really loves Blintz. He's a complete goober, and a picture of Blintz brightens any day. And frankly, we all love Blintz. I work from home, and half of my day is sending her pics. I've asked her, like, I know you're going to be in college, you're going to be independent, you know, I don't want to bother you, it's like, no, send me more cat pictures. So I was sending her a lot of cat pictures, and then so I wondered. And as a wise person once said, embedded in every technology, there's a powerful idea. And the powerful idea here is, could our pets send us selfies? Well, maybe powerful is not the right word, but at least amusing. And the answer I think to this was probably. And so I started thinking about how I would go about doing this. And I realized that if I could train our pets to associate a particular sound with treats, I could get somewhere. So then I would have to build a device that could play that sound. I could wait for them to come running into the source of that sound, take a picture of them while they're waiting for the treats that were coming, because that's how I was going to train them, dispense those treats, and then send us a picture. So that was the idea. And I'd like to point out that my wife and son violated the well-actually rule, because this slide originally had Pavlov and classical conditioning, and they corrected me that it was operant conditioning. So just, but it happened at home, so I think I'm okay. Anyway, so the hardware designed for this. I decided to build this on a Raspberry Pi, which hopefully most of you know about. It's just a $35 little computer. And the idea would be I'd attach a speaker, and a camera, and a servo. And a servo is just a little motor with a chip in it that you can control from a computer, and it would be connected to some sort of mechanism that would dispense treats. And that was the basic idea for the hardware. The idea for the software was going to be I'd use Node-8 and Express, ECMAScript 2017, Async-08, and all the modern fanciness. And then the Raspberry Pi hardware extensions that I would need to talk to servos, the GPIO, General Purpose Input Output Extensions, and the camera for the Raspberry Pi. And then the last piece, and it's a piece that was critical to this working, was the Twilio API. And I did not know Twilio was going to be a sponsor when I submitted this talk, but as long as I did, thank you, Twilio, for sponsoring Bang, BangCon. Feel free to give me account credits and swag and whatever you've got. And of note, of the past two slides, everything I've shown you, I use Node and Express a little bit and none of the other things at all. So I was in way over my head, which is always the right way to start a project. So here's my first attempt at the mechanism. This is the feeder mechanism to feed the pet treats out. This is, if this didn't work, I got nothing. So this is the thing I tackled first. And you could see I started with a PVC ball valve. It's a plumbing part. And I figured I'd just rip out the guts of it, put a little plastic rotor, and it would just feed the treats through, and I'd be home free. And here's my first test of my first draft of my motor. Nothing came out. And I was sad. And that was the bottleneck. I looked and realized that this valve, this piece of plumbing hardware, unsurprisingly, is meant to be watertight. And I don't need it to be watertight. I need it to be Temptation's cap-sheet tight. So it got caught on the edges and the rubber seals and things like that. So I'd found refactoring through violence. I used a rotary tool. I ground the thing out. I had PVC dust everywhere. And I made it nice and smooth inside. And the smooth interior prevented the treats from getting stuck. But the treats were still jamming on the rotor. And I realized that this was because the rotor, which is a piece of foam, the treats go halfway in. It's kind of like sticking your foot under your door. You can't close the door. I needed a door that would sweep past your foot without taking your foot off. And so what I did was I shaved it away and I sliced it away and I cut notches in it so it was kind of like foam fingers. And it allowed the rotor to go past the treats. The treats were in the way. No problem. It'll go around. It'll approximately work. And here, in this case, tolerances were terrible and that was perfectly fine. And eventually, and here you see the first test of the completed mechanism. This is very exciting. I was so excited that day. So excited that day. This is the culmination of a weekend. I was saying to my wife, look, look what it did. And again, I had never done any of this before. So initially, I started off with this rats nest. I had all kinds of wires and breadboards and USB chargers and USB cables and things like that. And I realized as I was going that I had to power the servo, because I had to power the servo separately from the Raspberry Pi because they draw too much power and it would blow out the pie, that I could replace everything you see in that yellow L shape on the left by splicing into the USB wire. All this stuff went away. So I had no idea what I was doing. And as I was going, I'm like, wait, all of this stuff can go. There is nothing quite like the feeling of refactoring hardware. It's quite a rush, I recommend it. Meanwhile, I have the other half of the project, which is the users. Now, the whole project is predicated on these treats being really, really motivating to them. So it's no surprise that they tried to get into it. So I figured I may as well leverage their interest early. And that's where I started user training, early and often. And I hope the audio works for this because it's critical to this. Here you see different stages. I allowed a lot of time for this because I didn't know how long it would take. But 24 hours, they were like, OK, this is the thing now. So I hope you all get to work with users as motivated as I did. And we have two other cats. And Bob was a late adopter. But he was a great pen tester. And that leads me into security. So the security design of this is you see it's this box sitting on a shelf. The door on the side, it slides up. The eye hooks and screws that slide up. There's a clamp at the bottom that holds the thing in place. And when that's done, the only attack vector is this little slot on the front, which is too small for their paws. And it's kind of off a cliff. He can't reach into that from the shelf. So the audit logs do not show any violations. And then, again, we started off with a mess. And here we have the finished mechanism. Here you can see the various subsystems in action. First plays a sound, waits for them to run in, takes a picture, runs the servo, talks to Twilio, dumps the treats out. This cracks me up every time. So let's do it live right now. They always say live demos and working with animals are the most reliable thing you can do. So if I just type selfie, because my kids are also going to be the users of this, I wanted them to be nice. So it'll tell them, you didn't say please. So selfie please. And if all goes well, and I don't run out of time, you should take right now, this has gone up to Twilio. Twilio is posted to my app in the Raspberry Pi. It's calling the pets into the kitchen, playing sounds. It's taking a photo of them. Treats are coming out. It's posting back at the Twilio. Twilio is figuring out if what I did was acceptable, sending it to SMS. And it should be coming through here. Hopefully, it takes like 20, 30 seconds. So how about bang bang con? Everyone having a good time? Whoops. Let's see. I'll come back to it. It'll work, it'll work, it'll work. Sometimes it's slower than others. How am I in time? 128. OK, I'm good. All right. Well, if you look here, you see previous runs. I have so many pictures of my pets, and this is some testing where I was deliberately doing it without them, and there's me. But you could see they were very compliant with the whole system. OK, so let's go back to here. So here's what it looks like when it works. And we didn't get to use this slide. But in summary, you should definitely build this. This was so much fun. I had no idea what I was doing. It was so much work. But you should definitely build this. It's brought our family closer together. My daughter can get pictures of the cats when she wants to. And I have so many things. I just barely got this thing done. And these are all the things that I'm going to be like, oh, I've got to do this. I've got to learn how to use transistors for switches. And I've got to, because you have a very tight energy budget. You have very tight processing. There's only this many pins. You can't run hardware pulse width modulation to drive a servo with the audio. Tell them to talk to you about that afterwards. All I want to do is go back and work on this right now. Scope creep is a lifestyle choice. Anyway, the source code is up on GitLab, not GitHub. I'm trying that out now. It's going to be updated a bunch more. I'm going to post more pictures and things like that. Thank you very much, and enjoy the rest of the talks. Thank you. Thank you. Thank you.