Christmas present for my daughter - IOT Pet feeder with camera - 3D printed

195 views
Skip to first unread message

Paul Morley

unread,
Dec 12, 2016, 2:07:51 AM12/12/16
to Node-RED
I would be most gracious for any advice I can get.  This thread could lead to a series of questions but it's all for a good cause.  My daughter doesn't like leaving her new kitty at home for long so i'm endeavoring to build her an IOT pet feeder that will have a camera on it so she can see her kitten when she's not there.  I plan on printing the feeder itself with my 3D printer (Lulzbot Taz 5) and I have that design underway already.  I've been reading and testing various IOT sw and hardware tools and have a descent handle on a variety of components that I believe i'll be able to stitch together to pull off this project.

I'm a solutions development manager for an enterprise sw company by trade and work very closely with multiple scrum teams of developers and am therefore fully indoctrinated into programming concepts and practices although disappointingly, have not had the time to learn to code to a point I could call myself proficient yet.  

I will share my progress along the way for anyone who is interested and would be very grateful for any and all help.  Just as a reference, here are some of the items and level of experience I have.
  • Arduino Hardware - multiple form factors (nano, micro, uno) multiple on hand
  • ESP8266-12E development board - multiple on hand
    • Experience with straight Arduino sketches on these as well as ESP Easy to control a variety of sensors IO pins over MQTT etc
  • Raspberry PI (multiple on hand)
    • Some experience with 
  • OpenHab - for home automation
  • MQTT
    • Firm grasp of all concepts and have installed brokers (Mosquito) on RPI, Windows and Mac
    • Also have done some functional experiments with adafruit.io, AWS IOT and Microsoft Azure for IOT 
  • Node-red (beginner but reading feaverishly)
  • Arduino coding (beginner to intermediate knowledge)
  • General electronics (many parts on hand for a project like this)
  • Mechanical CAD design Fusion360 - Intermediate 
  • 3D Printing (Lulzbot TAZ5)

At the moment, my plan is to design and print all parts of the feeder (multiple parts glued or screwed together).  (my printer has a roughly 1 cubit foot print volume).  It will be large enough that I can house the RPi and or Aruduino in a cavity back of the body.  

The high level requirements of the project are the following:
  • Storage vessel capable of holding 4-6 cups of food (enough for 3 days of food for the pet)
  • Lower portion of vessel will be cone shaped with an opening at bottom to facilitate portioned feedings (currently under design)
  • Distribution of food may be accomplished with screw drive (still working on design)
  • The feeder will be connected to wifi network
  • External internet access to the feeder will require authentication
  • Feeder will have a web based front-end served from the RPI3
    • Front end will be straight forward with a few basic buttons for dispensing food (hopefully 2 portion sizes) full and half meal portions
    • Another button to start a camera on the feeder that will allow the owner to see if/when the pet approaches the feeder
At the moment, i'm thinking that Node-Red is my best candidate to accomplish all of the front end needs via the dashboard as I think I have enough general understanding to link dashboard buttons to routines that will trigger the motor rotation and dispense the food. 

Currently i'm having trouble figuring out a way to display the pi camera within the dashboard to help facilitate taking the picture.  Can anyone make a recommendation?  I've installed the node-red-contrib-camerapi but am having trouble figuring out how to present it in the dashboard.

Thanks in advance for any help.  

Mike Biddell

unread,
Dec 12, 2016, 3:11:22 AM12/12/16
to Node-RED

Paul

Don't know whether the Pi camera can do FTP on motion, but to get my IP camera e-mailing me when someone comes on my drive (or you could use push bullet  for push notification), I use node-red-contrib-ftp-server. It's a simple solution to motion notification, not requiring any additional hardware. All the standard IP cameras have FTP on  motion.

Mike

Julian Knight

unread,
Dec 12, 2016, 4:29:06 AM12/12/16
to Node-RED
Sounds like a great project and I hope it goes well.

I don't have a Pi camera but a quick search turned up quite a few examples of remote access to the camera and streaming the camera feed. 

If you want a stream, it might be easier to set that up separately using one of the examples. You could probably just leave the stream live all the time when away (with some simple login). Would be good enough to get going for Christmas anyway and could be upgraded later if you decided you wanted something more subtle.

Simon H

unread,
Dec 12, 2016, 1:27:19 PM12/12/16
to Node-RED
Hi Paul,

I've not played with video in Red, but....

some time ago I re-created this: https://ianrenton.com/hardware/raspberry-tank/
using an MK802 ('android' stick).
For the video, look down to the bit on mjpegstreamer.
The mjpegstreamer was easy to setup with (in my case an eyetoy) as a separate url.  If you put Red behind a webserver, then the webserver can serve (proxy) both Red dashboard and mjpegstreamer on the same port which you can make available externally, and with security configuration which may be familiar (depending upon your webserver experience :). ).
I'm sure you can put the mjpegstreamer's url inside a red dashboard item; even if you have to put it in an iFrame of some sort...

Please drop a link to your feeder design when you're happy with it; I have a cat which is literally hungry ALL the time - my wife would love to call 'feed the cat' to Alexa (getting one for xmas; seems like a breeze to link it to red, maybe with a philips hue simulator in between), and for Alexa to activate the auto-feeder and ring a bell to inform the cat that the food is there!!!.

looking forward to hearing about your success....

Simon






Csongor Varga

unread,
Dec 13, 2016, 1:59:50 PM12/13/16
to Node-RED
Would it be easier to use a separate IP camera and integrate its video feed to the dashboard using the ui template node? I think these cameras usually have some javascript viewer. Or use VLC's activeX plugin to display an RSTP feed.
Have you considered adding two way audio? I have seen that on commercial pet feeders. Could be useful call the kitty if not around. If not, add another button on the UI to play some sound file locally.

Actually, I would also be interested in seeing your feeder mechanism. Is that some sort of trap door on worm screw design. I know if is off topic, just hide in under yours Node-Red question :)

Mike Biddell

unread,
Dec 14, 2016, 5:04:18 AM12/14/16
to Node-RED
Paul

It does sound a great project. I have a bird cam in the garden, which my granddaughters love, and we often turn the cam on, saying I wonder a bird is in the box, it was that which started me thinking about using an IP camera and motion sensing, so that we get notification that a bird is in the box. Ironically, I have implemented it for my drive, but not the bird box !!!! I think your project would benefit from motion notification, so that you know the kitten IS there and you are not constantly monitoring the camera in the hope that it is !!!!

Mike

On Monday, 12 December 2016 07:07:51 UTC, Paul Morley wrote:

Julian Knight

unread,
Dec 14, 2016, 5:14:44 AM12/14/16
to Node-RED
Why not go further and add GPS tracking to the cat with a live "Cat Map" :-)

Easy enough to build a small, GPS enabled cat wearable based on an ESP8266 so that it connects to your home Wi-Fi when in range and captures GPS data periodically when out and about, you can use the GPS data to turn off the Wi-Fi to save battery. Or alternatively using an Arduino Nano with BlueTooth.

Mike Biddell

unread,
Dec 14, 2016, 7:30:51 AM12/14/16
to Node-RED
Jules

Love it.   Not a solution for me though !!!! Have you ever tried catching a blue tit ???

Mike

Paul Morley

unread,
Dec 14, 2016, 9:02:35 AM12/14/16
to Node-RED
Thanks for suggestion Mike.  I hadn't considered the FTP approach but good that's a good idea.  I'll install that node and take a look.  

Csongor Varga

unread,
Dec 14, 2016, 9:22:38 AM12/14/16
to Node-RED
I have also seen IP cameras that have an HTTP request, where the response was the current image. That would be even easier as you don't have to look for the latest filename.

Paul Morley

unread,
Dec 14, 2016, 10:01:58 AM12/14/16
to Node-RED
Thanks for suggestions Csongor.  The separate IP cam is a good idea and I may try if I can't get some form of streaming to work.  I think i'm going to try mjpeg streamer and the UI template.  I've actually had a little experience with it on the RPI as I use Octoprint for my 3D printer and it is integrated with that solution.  

I definitely want to do 2 way audio as well although may not get that done in time for Christmas.  I even thought of 2 way video as well but that may even be more challenging.  

She leaves her kitty in her room during the day so there's not very far for it to go.  I will try and have some type of sound as well but I suspect the sound of the drive dropping the food in the dish will get the Alphie's attention.  

Here's a short vid of the design at this stage.  It's a worm drive to move the food forward.  The container at the top is removable for cleaning.  I haven't printed a proto yet but will be soon.  I'm working out the motor design atm and will share another vid of that later.  I plan on putting the rpi and other electronics in the base area.  

Csongor Varga

unread,
Dec 14, 2016, 10:07:24 AM12/14/16
to node...@googlegroups.com
Excellent design, thanks for sharing. When I suggested two way audio I meant an IP camera which has 2 way audio. So the audio part is handled by the camera, but that means that the ActiveX component of the camera needs to be integrated into the UI which may not be easy and you cannot customize that... Decisions, decisions

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/YnzXo_jNd7s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/d62c2cb3-2451-4012-b555-a9e6a62873d0%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Mike Biddell

unread,
Dec 14, 2016, 12:03:16 PM12/14/16
to Node-RED
IP camera viewer by Robert Chou does two way audio for most IP cameras
To unsubscribe from this group and all its topics, send an email to node-red+u...@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Julian Knight

unread,
Dec 14, 2016, 3:08:54 PM12/14/16
to Node-RED
"I even thought of 2 way video as well"

Love it!

The Pi might be able to handle it though network bandwidth and latency is always a challenge. Maybe you could add a screen and run Skype? https://eltechs.com/run-skype-on-raspberry-pi/

Mike Biddell

unread,
Dec 14, 2016, 5:45:55 PM12/14/16
to Node-RED
Yeah... on receipt of an ftp file, you simply add email node next and you get mailed the motion detect image, or you could push it to your phone

Paul Morley

unread,
Dec 14, 2016, 7:18:06 PM12/14/16
to Node-RED
That's a great addition.  I'll for sure add that.  

So i've had a nice little breakthrough on getting the raspberry pi camera working on the Dashboard.  I happened upon this wiki for RPi-Cam-Web-Interface.  I was quickly able to install and got my pi cam running and it's also hosted from the pi.  This solution has a ton of features for manipulating your camera and even has a full suite of motion sensing functionality built in.  It also has a minimal stream that i was able to quickly figure out how to embed in an html node and I think i have the beginning of my camera solution.  It even has pan and tilt controls built in, so i may try that as well.  So now i'm trying to figure out how to make a button on the dashboard envoke the html node so that it's only showing when I want.  Surely that's possible??

Again, thanks for all the feedback so far.  I'm going to spend more time on the cad design tonight and will provide an update to let you know where it stands hopefully tomorrow.

Jörg Wende

unread,
Dec 15, 2016, 7:38:00 AM12/15/16
to Node-RED
Just to collect ideas
- what about re-using a candy dispenser like here: https://medium.com/ibm-watson-developer-cloud/how-to-build-a-candy-machine-with-feelings-922285a475c8#.1xafednos
- rpi and camera: https://www.ibm.com/blogs/research/2016/11/calling-makers-meet-tj-bot/
Happy hacking 😎
Cheers
Joerg
Reply all
Reply to author
Forward
0 new messages