Hacker News new | comments | show | ask | jobs | submit login
How I taught my dog to text me selfies (twilio.com)
278 points by gregorymichael on Mar 26, 2015 | hide | past | web | favorite | 70 comments

Used to train dogs at a local shelter in my free time. It was honestly one of the most fun parts of my week.

We used clicker training, and it always impressed me how even the oldest of dogs could learn new tricks (har har) if you found what motivated it, and then incentivized a specific action based on that motivation.

Even more fun was finding a really smart dog who you could teach to do the craziest stuff. Had one who probably learned 25ish tricks in his short time at the shelter. He was so motivated to learn. It was a pretty easy sell to the right adopter when you showed them you could point your finger at the dog, yell "HANDS UP" and he'd sit up with his paws in the air, you'd yell "BANG" and he'd fall over dead. How could you ever resist?

Example (not my video): https://www.youtube.com/watch?v=lky1xsqYGUo

I did the same for mine: https://www.youtube.com/watch?v=COIVkkHxNR0 (this isn't the bang video, but she knows the commands for "what do you want?" "point" "go home", etc).

I also taught her verbs and nouns, and could say "point ball" and she would point to her ball, or "fetch ball" and she would fetch it. Same with "bone", "rope" and a few more toys.

"clicker training" is also stimulus control. And, I would guess without know more about the actual procedure, differential reinforcement.

How would one train a dog to do something like the Hands Up routine? I've never had a dog, so I'm not sure how I'd get the whole motion across to the dog.

You want to get the dog really comfortable with sit, stay and a "warm clicker" (Basically just get them used to the click noise = treat). Once they're good on those, have the dog sit as you hold the treat above them in a way that makes it so their nose is pointing straight up and they start to stretch their body to try and reach for the treat. Keep doing this until their paws start coming off the ground as they sit back on their hind legs. Click and treat repeatedly so they know this is what you want them to do.

Do this repetitiously until they start getting used to putting their paws up then start working on getting them to sit like that for a few seconds. As a reminder lots of clicks and treats to let them know they are doing what you want. At this point you can start introducing the voice commands.

After they have stay down, you can move into "bang" by once again holding a treat in a way that they fall to the ground, then immediately click and treat again repeatedly. Then you start working on getting them to roll over in the same motion. It's ok to sort of push them with your hands a bit to show them the physical motion you are looking for as long as you click and treat in little increments to show them that what they're doing is "good."

Probably too long winded, but if you look up "bang" dog tricks on YouTube there are a lot of handy guides. My final advice is to pay attention to how much fun you think your dog is having. Some love mental stimulation, others not as much. If the dog is losing interest, then it's probably time to call it quits for the day, as they'll stop thinking the training is fun.

Really, it's quite humorous how close human psychology is to that of my dog.

It al reminded me a lot of programming in general. For example, unconscious assumptions:

Once saw a dog that only wanted to perform the tricks in the training ground but not for example at the owners home: the dog had assumed that the combination of (command for the trick && location+training ground) was the trigger. That was fun to see. Other examples included dog trainers that could only successfully give the command while wearing the red coat he was wearing while training the dog, etc.

I don't know the correct way, but for my dog it was a progression from sit -> shake hands -> give me ten. I would just move her into the position I wanted then give her praise and/or a treat. Repetition and praise.

I have discovered that my labrador would kill himself trying to figure out how to solve differential equations if he knew he could get a bite of ginger bread for it :-).

That said, having raised a puppy that was destined for guide dog training, the trick is early on getting the dog to understand that you are asking it to do stuff. That is a big part of puppy training, and once trained, the dog will look for you to ask it to do new things, and knows that if it figures them out quickly you will reward it. It has been one of the more amazing experiences in my life.

I feel like my dog has way more potential than I have the ability to unlock. Any resources you'd recommend on training?

Well besides the guide dog's puppy raising guidelines (which are fairly long and detailed) we took him to an agility school after he was career changed[1] which used a device that make a 'click' sound (clicker) which was used to tell the dog "yes that exact thing" and treats. Apparently that is pretty common (but I was not aware at the time). But between the two experiences I don't think there is anything I couldn't train him to do, if I can communicate exactly what it is.

[1] Seriously, that is what the Guide dog folks call it when a dog washes out of the program, in our case it was for a skin allergy which would have been undetectable for a blind person to notice, not for his lack of trainability.

In addition, check out Sophia Yin's website[1]. It's chock-full of free videos and articles. She also wrote an excellent book[2], which I highly recommend to all dog owners. I train dogs as a hobby (agility with my own dog, plus I do volunteer work for puppy and obedience classes). As a warning, dog training is highly addictive for both you and the dog!

[1]: http://drsophiayin.com [2]: http://drsophiayin.com/howtobehave

Chiming in - Karen Pryor's Clicker Training is really tough to beat: http://www.clickertraining.com/

Kikopup's YouTube channel has lots of good stuff about reward-based training too: https://www.youtube.com/user/kikopup

My wife doesn't have an HN account, but I showed her this article and here's her comment...

Great article! As a behavior analyst, let me name the research-supported behavioral interventions used here - stimulus control (pairing the word "light" with the behavior), most-to-least physical prompting (forcing the paw on the light), and differential reinforcement (reward for pressing the light; no reward for not pressing the light).

That is so cool! Thank you for sharing.

1. Train dog to press button

2. Train dog to press button when bell rings

3. Connect bell to the internet

4. SaaS dog selfies

5. Profit!

And if you want to get some free press, have the button activate a "retweet" of what ever is currently at the top of the dog's twitter feed (have it follow a lot of celebrities)

Actually not a bad idea. Set up a site and make it easy to donate $1 or some low amount

You guys should read about this artist's exhibit, where he has himself shot by a paintball gun hooked up to the Internet: http://en.wikipedia.org/wiki/Wafaa_Bilal

Don't do this to the poor dog.

Got me intrigued. Here's a link to Bilal's page on the project: http://wafaabilal.com/domestic-tension/

People on the Internet will know you're a dog if you text them selfies.

Cheap stylish wooden boxes for cheap is the biggest thing about this. Definitely will consider cigar boxes for my next project.

I've also had luck with 3.5" HD enclosures, they were as cheap as the drive without enclosure and with a bit creativity make for very nice looking enclosures for electronic projects.

Another pro-tip I picked up is using match-boxes for storing electronics (resistors, connectors, small modules). They are cheap and you can tape/glue them together to create arrays of small boxes. The sides are clear thus perfect to write what they contain.

your match-box protip is known for at least half a century to everybody who was even remotely interested in electronics in USSR :)

Did the OP get permission from the dog to use those copyrighted photos?

Looks like this isn't actually a problem: http://www.theguardian.com/technology/2014/aug/22/monkey-bus...

Pretty cool! Soon you can teach her to text you when your dryer finishes its cycle (;

That was an awesome project using pretty much the same tech! For those who haven't seen it:


That's a pretty decent idea for a project, but I would have instead hooked into the buzzer signal.

The author over-complicated his solution, but that doesn't make it invalid.

My landlord wouldn't love me very much if I started taking apart my dryer to hook a mysterious wired object to the buzzer...

i thought the same thing until i read the actual instructions:


it uses an accelerometer to detect the motion of the washer. no need to dissect your large home applicances!

Didn't even know about this when I wrote the comment. Now I'm a little more inspired to look into hardware hacking. Thanks!

I'm starting to think we as a society might be focusing our efforts incorrectly

A lot of comments about training dogs. Anyone has any experience training cats here? I have found them to be too moody for something like this.

My wife has clicker trained our cats based on what she found on youtube videos. You need a smart cat (Ours are bengals) who loves treats and a lot of time but it's very doable. Our cats can both do the following tricks: Sit, Stand, High five, Turn around, Roll the ball, and Knock over the object

Training cats is in my experience more about actually forcing the cat into a position with your own hands to get it to grasp what you're trying to do.

Cats are not as magnetized to treats as dogs are, they tend to want to keep their feet at the same place.

That said: getting a cat to roll around on command is a great feeling.

Nice, I guess author does not have a kids yet. It is fun to teach 1 year old howto use phone.

edit: author has a kid, congrats

If you look closely in the background of that video, you'll see a Mamaroo. She's only four months, so for the time being the dog is way more trainable.

Curious, have you read anything / have any concerns about introducing your kids to screens that early? I'm so afraid I'm rewiring her brain too young when I see her staring at my phone.

From what I've read, most known damaging screen time studies have been with non-interactive TV and extrapolated to other digital screens. I'm under the impression there will be more screen time for my kids than there was for me and I try to steer that towards problem solving and interaction, as opposed to consumption time. My daughter (3) loves to take pictures with my phones and tablets and crop, color, add the silly effects. Somehow ( and probably misguidedly) I view this as better than putting her in front of a movie.

In my view, it is probably more important to control the specific activities more than the blanket "screen time".

There is nothing conclusive about that. We are more concerned about other things.

In moderation its ok. No ads on phone, and no screen before bed. Some basic games and some kids shows. She knows howto navigate Total Commander and just started recognizing some letters.

And she drops phone for playground or for play with friends any time.

I'm curious too as I also have a 4 month old and I can't find any well sourced studies with any solid conclusions.

Hello everybody on this page,i want to thank God for using Prophet Suleman as my source of savior after 9 years of my marriage and my lover left me alone for 6 months,Have just been heart broken until i go in contact with Prophet Suleman after i saw a ladies testimony on how she was helped by this same Propht Suleman,So i decided to get in contact with him and when i told him all my problems he laughed and said this is not a problem that everything will be ok in 2 days time.Exactly the 2nd day my husband called me i was shocked and what surprise me the most was that his behaviour was normal as the man i got married to.Am so grateful to dr Kasee for what he did for me, if you wish to contacting him Email: prophetsuleman@gmail.com

Cute (and great looking dog). Would be nice to have a way for us to subscribe to Kaira's selfie feed.

That program looks so simple. Never wrote a program for an Arduino before but I guess its time now.

Funny as it is, you'll be spending more time figuring which components to buy and which ones you actually need. And eventually figuring out how to build enclosures/boxes for you projects. Power supply also seems to be a difficult topic to get right if you're building wireless projects.

There are tons of examples, tutorials, libraries available for Arduino, and keep in mind once you're done with prototyping you can just buy the Atmega328P (5$) and if you add an ESP8266 (5$) to the mix you can make anything wireless.

Depending on what you're doing, you may be able to get by with just the ESP8266. The ESP-07 modules break out all of the gpio pins, and the NodeMCU firmware lets you program it in Lua.

This reminded me of a weird little web-comic-ish thing about a guy who taught his cat to text: http://louisvsrick.com/

Honestly, this headline would be perfect for False Medium: https://twitter.com/falsemedium

Awesome stuff. Now, how do we train dogs to bring us beer :)


Thank you. Much appreciate that. It was a ton of fun -- first foray into hardware hacking.

so, where are they ?

You can see them in the youtube video, but good point -- a lot of folks don't watch those. Let me add them to the article.

edit: Added. Thank you.

"How I taught my dog how to market twilio.com"

SMS is all very interesting but it is not 2013 any more so there is no need to send an SMS (paying people on the way) when you can just send an email. It still pops on the person's phone as a new message (at least in Android world, no idea how those iPhones work). Email also has better delivery, speaking as someone in a poor reception area I cannot reliably receive messages, however, wifi works pretty good at home and I can get emails with that whereas wifi does me no favours for SMS.

A few years ago I did have SMS for my own version of an uptime monitor, however, when my credits ran out I didn't miss the SMS messages at all (my script also emailed). That led to my 'discovery' that being able to send an SMS from a bit of code might be impressive however it is also not that useful in the first world. Maybe this product is better suited to dogs in the developing world somewhere.

Yeah, i love twilio, but its value is in integrating with legacy services or customers who are stuck on old technologies. Using it to build new services around SMS/MMS that don't need to be built on SMS seems a little backwards.

"so we take this awesome system, it takes pictures that we upload it to dropbox, a perfectly acceptable destination for pictures. and then, for some strange reason, instead of sending an email or just leaving it there in dropbox or doing any of the other great things we can do with pictures, we make an MMS"

Both of you missed something big about SMS/MMS:

It's not really a messaging system, it's a push notification system that everyone who has a smartphone is subscribed to.

You probably have a phone that can accept MMS, and a corresponding phone number.

Lets say I turn this into some kind of guard dog system (bear with me). Imagine someone wanders onto my property. I'd rather get a text/mms than an email which might get lost in my inbox.

Individual systems might be great at specific things (motion detection, security systems, etc.).

Dogs are living beings, they can be trained by average humans to do new things that your typical security system never imagined.

> " I'd rather get a text/mms than an email which might get lost in my inbox."

That is what I thought. But actually, in practice, once one has moved from some old Nokia brick to a modern smartphone, the assumption is wrong. SMS has its place for sending someone a quick text but it is going the way of FAX, to be only used in some arcane circumstances.

With SMS the delivery was not as good as email. As mentioned, there is perfectly good wifi where I live but marginal phone signal. In theory I could find some remote mountain where there is only 2G but even then emails get delivered at least in header form.

The other thing is that when I had my SMS notifications I had to buy credits in advance. If the monitored sites were completely down and notifications were being sent to three people then those credits could run out quickly. So there was that unnecessary dependency on a third party service that had some credits to pay for in order for it to work. Totally non-strategic!

If we think of the dog and the selfies, say the dog just happens to tap the button every few seconds. That could be expensive with SMS but free on email.

You can also build some backup into the email approach, you can cc your private email as well as email your work one. There is none of the 140 character message length nonsense either.

Plus, who doesn't check their phone every 6 minutes or so?

To be slightly unfair, TFA is marketing spam. Even the box is over-engineered, you can get wifi PTZ cameras for small change on eBay and a few of them have an input for a switch so you can take 'selfies' with them, no wheel reinvention needed.

You misunderstood the GP. Instead of using Twilio, you can send an email directly to the phone number, and it works the same as SMS (more or less).

> Lets say I turn this into some kind of guard dog system (bear with me). Imagine someone wanders onto my property. I'd rather get a text/mms than an email which might get lost in my inbox.

You can't have push notifications for certain subjects or email addresses? If you're going to make home security part of this, you might as well set up your email to be accommodating to it as well. If you're gonna use email.

Is there any evidence the Dog is actually aware that he's "texting (or otherwise sending) a selfie" -- or even knows what a selfie is -- in any meaningful sense?

"How I taught my dog to thwack his paw on a big red button in response to a keyword signal" might be a better title.

Is that your response when someone has their dog "play dead"?

"Does the dog understand what death is? Is the dog aware of it's own mortality?"

"How I taught my p-zombie to look things up in a giant room filled with books in Chinese, using the Twilio API"

The title doesn't say "How I taught my dog to understand that it is recording and sending a self-portrait."

Does it matter? It's funny/cool whether or not the dog understands what a selfie is.

Parent has a point. If you can teach your dog that the button is a way to communicate with you when you're out of the house, that would be awesome. I suppose something like having a few signs it can hold when pressing the button, maybe? Training that would be incredibly hard, I'm guessing, but if possible, it would be amazing.

Great idea. My original plan envisioned something like:

  - I text into her number while out of the house
  - Twilio sends HTTP request to Arduino 
  - Piezo buzzer sounds 
  - Kaira has to hold the button for X seconds
  - Servo rotates auto treat dispenser
In the end, simplicity won out. That said, those are far from insurmountable challenges.

A friend of mine (Hi Erick!) is working on http://puppod.com/

> In the end, simplicity won out.

But the overly ambitious title remained.

GROAAAAAAN, don't be a sourpuss!

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact