Arduino Controlled Autofeeders - The Planted Tank Forum
 1Likes
Reply
 
LinkBack Thread Tools Display Modes
post #1 of 26 (permalink) Old 11-12-2014, 10:50 PM Thread Starter
Planted Tank Obsessed
 
PhysicsDude55's Avatar
 
PTrader: (0/0%)
Join Date: Oct 2011
Location: Dallas, TX
Posts: 339
Arduino Controlled Autofeeders

*UPDATE* I got them all working! See post 24!

Here's the demonstration videos:
https://www.youtube.com/watch?v=YcOlSOA3d7k
https://www.youtube.com/watch?v=pJGf4B1kiHc

*Original Post*

I'm finishing up an autofeeder system that I made which run off my arduino based aquarium controller. You could also use any other sort of programmable controller such as Raspberry Pi, etc.

I used 2 different concepts which can be used to control 99% of any autofeeder that's on the market.

Method 1:

Tap into the "manual feed" button.

Most autofeeders have a "manual feed" button that when pressed, makes the feeder do a feeding cycle independant of its schedule. This button is just a 2 wire button, that when both wires touch, it triggers a feed cycle. The concept is to take apart the feeder, solder a wire onto both sides of the button, and hook those wires up to a relay that's controlled by your microcontroller.

For advanced users... I found that on both feeders I tested, one side of the button had +3 volts (battery voltage), and one side had ground voltage. For both feeders I found that if you take the +3V side and ground it, it will trigger the feeder. This means you can hook this directly up to an arduino pin, and keep the pin HIGH, and then bring the pin LOW for a few hundred miliseconds, and it should trigger the feeder. I tested this with an Arduino Due, which runs on 3.3V, the same as the feeders. To use a 5V Arduino such as a Mega or Uno you might have to add a resistor, or perhaps add 2 pnp diodes which would make 3.6 volts. You also need to make sure that the arduino and autofeeder have a common ground. Using a relay is definitely a safer and more surefire way of doing it. Its probably also possible to do with some sort of transistor, but I didn't test or attempt it.

Pictures:

First is a generic Petco brand feeder. I paid $30 for mine a few years ago, but now they sell for under $20! Its really a pretty good feeder, whether or not you use it with an arduino. Its kept my fish alive for over a month while I've been out of town.
http://www.petco.com/product/112644/...sh-Feeder.aspx

I soldered the orange and blue wire onto the backside of the manual feed button:


The 2nd feeder I think I got off ebay or something awhile ago. Its really quite crappy, and If I wasn't using an arduino to control this thing I would probably throw it away. It only has a switch for "12H or 24H feeding", and has no indication on it if the battery is dead. Not very safe to rely on to keep your fish alive, and almost no way of knowing at what hour it will actually feed your fish. Don't buy this thing.



But, it has a manual feed button, and I was easily able to automate it.

I took it apart and am looking at the printed circuit board. "S2" means "switch 2" which is the manual feed switch:


Sorry for the crappy pic (I took these over a month ago), but you can see I just soldered the blue and orange wires onto the back of the switch:



ALSO, while I was doing this I also converted both feeders to run off a 3.3V power supply instead of off batteries. I HATE battery controlled devices, especially one that would kill all your fish if it died or failed! If you've decided to already automate your feeder, you will already have wires running to your feeder, so you may as well just run 2 more wires.

You'll need to power the feeder off the same voltage as the batteries. Both of these use (2) AA batteries, which is about 3 volts. If you're using an Arduino, most Arduinos I have a +3.3V pin on them and you can power the feeder directly off the Arduino. Feeders don't draw hardly any power, so you won't overtax your Arduino voltage regulator. I used an external 3.3V wall wort power supply that I had on hand.

Simply solder + and - wires on the battery terminals of the feeders. This was really easy to do while I had them apart soldering the automation wires.

I then drilled a small hole in the cases for the wires to come out:





Method 2:

I don't have many pictures of this. I won't be able to take pictures until this weekend, at which time I'll update this thread.

I had 2 REALLY CRAPPY feeders that I got for "free" on an ebay auction for fake plants (don't judge me, I was young, we all make mistakes). They're Penn Plastic "Daily Doubles". These things are junk.



What I did is take off the feeding drums, and mount them on stepper motors controlled by an Arduino.

I got a 5 pack of stepper motors with driver boards for ~$12 on Fleabay.

I wrote a simple piece of code that rotates the drum to dump the food and then returns it to the original position. It was easy to do if you've ever messed with Arduino type stuff.

I used an Arduino Uno that I had laying around, since my main Arduino didn't have enough extra pins to run the stepper motors. So I have a single wire that connects my main arduino the Uno that tells the Uno to run some code to turn the stepper motor to feed the fish.

Like I said, more pictures on this later.

PROGRAMMING

I programmed this on a schedule using my Arduino. I might try to write some code to add this feature to AnotherHobby's iAqua controller, but I don't have a 3.2" screen, so it would be hard for my to add any sort of graphic interface to make it work. I'm also not familiar with his code and I don't know which pin(s) would be best to use.

I don't have pictures of my complete setup right now, but will add some and a video this weekend hopefully.

I added a schedule to let you choose up to 4 feeding times per day. Then, on a separate screen, there is a manual feeding option. The way I coded it, whenever you manually activate the feeders using the manual feed screen, it turns off the next feeding schedule (up to 3 scheduled feedings). So, in essence, you can manually feed the fish whenever you want, but the controller will realize when you have, and will only let the fish be fed the proper amount of feedings per day.

I set my tank up so that the fish are fed at 9am and 7pm. In the morning, I can manually feed the fish at say 7 a.m. before going to work, and the Arduino will "cancel" the 9am feeding since it knows the fish were already fed. Then, I can come home at say 5pm and manually feed the fish, and the controller with "cancel" the 7pm feeding since it knows the fish were already fed. This way you get to watch the fish eat, and the auto feeders will never overfeed your fish (as long as you program the feedings correctly).

You could also manually feed them 2 or 3 times (or whatever you set your limit to) and it will stop the next 2 or 3 feedings. This could be useful if you're trying to see how much your fish can eat in 1 day to adjust feeding amounts, or if you're trying to make sure slower moving fish get their food, etc.

The code is pretty simple, here's how it basically works:

Code:
int manualfeedings = 0;  
//how many times the manual feedings have been activated
const int maxfeedingsallowed = 3;
//how many manual feedings you allow at once

if(manual button touched)
{

//only lets you manually feed if you're below your set limit
if(manualfeedings < maxfeedingsallowed) 
{
activateFeeder(); //activates the autofeeder
manualfeedings++;
}

}

if(time for scheduled feeding)
{
//only activate the feeder if the fish haven't been manually fed
if(manualfeedings == 0) activateFeeder(); 
else manualfeedings--;
}
napaeozapus and napaeozapus like this.

DIY Enthusiast


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by PhysicsDude55; 03-04-2015 at 04:13 AM. Reason: added information
PhysicsDude55 is offline  
Sponsored Links
Advertisement
 
post #2 of 26 (permalink) Old 11-12-2014, 11:01 PM
Planted Tank Enthusiast
 
PTrader: (0/0%)
Join Date: Aug 2014
Location: Edmonton, Alberta, Canada
Posts: 797
Nice work PhysicsDude55. I was going to be doing just this and now it will be easy, thanks for posting!
robsworld78 is offline  
post #3 of 26 (permalink) Old 11-13-2014, 02:18 AM
Planted Tank Guru
 
kman's Avatar
 
PTrader: (1/100%)
Join Date: Dec 2013
Location: Los Angeles
Posts: 2,350
Yes, nice job. And thanks for posting the link in AH's thread!

Unfortunately, I would definitely have to use method #2 for my feeder of choice (http://www.amazon.com/Fish-Mate-F14-Aquarium-Feeder/dp/B000YK5W18/), since it's the slide carousel type and not the usual rotating drum type (also, no manual feed button). I'd need to replace the existing motor / timer with a new Arduino-controlled one. I'm sure it can be done (and I'll bet AH's code for running the dosing pumps, and tracking remaining levels onscreen, and displaying time to next feeding, etc., could be adapted to this motor with some slick results), but I'm not ready to tear apart my feeder just yet. IT would be quite different from the method you're using for the drum feeders, even if ultimately the motor would be controlled in a similar manner.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

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

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
kman is offline  
 
post #4 of 26 (permalink) Old 11-13-2014, 02:36 AM Thread Starter
Planted Tank Obsessed
 
PhysicsDude55's Avatar
 
PTrader: (0/0%)
Join Date: Oct 2011
Location: Dallas, TX
Posts: 339
Quote:
Originally Posted by kman View Post
Yes, nice job. And thanks for posting the link in AH's thread!

Unfortunately, I would definitely have to use method #2 for my feeder of choice (Fish Mate F14), since it's the slide carousel type and not the usual rotating drum type. I'd need to replace the existing motor / timer with a new Arduino-controlled one. I'm sure it can be done (and I'll bet AH's code for running the dosing pumps, and tracking remaining levels onscreen, and displaying time to next feeding, etc., could be adapted to this motor with some slick results), but I'm not ready to tear apart my feeder just yet. IT would be quite different from the method you're using for the drum feeders, even if ultimately the motor would be controlled in a similar manner.
Ah interesting. When I said "works on 99% of feeders" that exact feeder was the 1% that I had in mind!

Unfortunately, after reading up on how this feeder works, I'm not sure that you could easily control that feeder with an arduino without using a stepper motor type approach.

On the feeders that I converted to the stepper motor, they would spin REALLY slowly throughout the day, and after I opened them up, I found a clever contraption in them that would basically oscillate the battery voltage across an electromagnet which would slowly spin a magnetic rod that had a gear connected to it which was attached to like 10 other gears to slow down the speed a ton which slowly spun the feeding drum. Those feeders also ran off 1 AA battery (1.5V).

Since the F14 feeder also has a single AA battery, and says that it slowly feeds over a 4 hour period, I'm guessing it uses the same technique, very slowly spinning a gear using an oscillating electromagnetic field. There's no real way to speed this up so that it will feed while you're watching. You'd have to either somehow attach a small motor to one of the gears, or attach a stepper motor to the drum.

The stepper motor idea probably isn't a great one for that F14 feeder either, since the food comes out from the bottom of the drum. It was pretty easy on the feeder I used since the food came out the side of the drum.

Sorry

Only other advice I have is..... the petco feeder is only $15 if you buy it online or buy a clone of it on Fleabay.

Bump:
Quote:
Originally Posted by kman View Post
I'm sure it can be done (and I'll bet AH's code for running the dosing pumps, and tracking remaining levels onscreen, and displaying time to next feeding, etc., could be adapted to this motor with some slick results).
You have a good point that the dosing pump output could really easily be converted to a feeder output. That's a great idea.

DIY Enthusiast


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
PhysicsDude55 is offline  
post #5 of 26 (permalink) Old 11-13-2014, 03:10 AM
Planted Tank Guru
 
kman's Avatar
 
PTrader: (1/100%)
Join Date: Dec 2013
Location: Los Angeles
Posts: 2,350
I'd probably pay close to $100 for a reliable, controlled and scheduled version of the Fish Mate with a nice display, etc. It's not the money. (else god knows I'm in the wrong hobby!)

The problem with the drum style feeders is they're not reliable for putting out small, precise amounts of food, especially with flake food, which is hard enough for human fingers to get a reliable volume!

The carousel-style feeder with 2 weeks of pre-measured feeding "doses" (I only feed once per day so the 14 slots give me 2 weeks) is the only thing I've found that I'm comfortable with. The 60P is a small tank, and overfeeding while away on vacation could lead to a disastrous nitrate spike pretty easily, and with no one around to monitor it... *shrug* I like knowing the exact amount I want goes in EVERY time. On a bigger tank, it would be less problematic, but for the little ones, more precision is needed, IMO.

One of these days I might tear one down and experiment with replacing the motor with some sort of drive mechanism, but I'm hoping being lazy means someone else will figure out a clever solution before I have to go that route.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

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

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
kman is offline  
post #6 of 26 (permalink) Old 11-13-2014, 03:51 AM Thread Starter
Planted Tank Obsessed
 
PhysicsDude55's Avatar
 
PTrader: (0/0%)
Join Date: Oct 2011
Location: Dallas, TX
Posts: 339
Ah yes I see your dilemma. Wish you had better options.

My feeders are on a 105g tank with a good cleaning crew, so I just dump the food in. No worries about precision on my part

DIY Enthusiast


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
PhysicsDude55 is offline  
post #7 of 26 (permalink) Old 01-19-2015, 03:58 PM
Newbie
 
PTrader: (0/0%)
Join Date: Jan 2015
Location: portugal
Posts: 4
any new about this?
freskhu is offline  
post #8 of 26 (permalink) Old 01-26-2015, 04:00 AM
Planted Tank Guru
 
kman's Avatar
 
PTrader: (1/100%)
Join Date: Dec 2013
Location: Los Angeles
Posts: 2,350
Not sure what PhysicsDude55 is up to. (any updates?) I picked up a second Fish Mate 14 so I can tear it apart, but I haven't gotten into it yet.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

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

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
kman is offline  
post #9 of 26 (permalink) Old 01-27-2015, 10:36 PM Thread Starter
Planted Tank Obsessed
 
PhysicsDude55's Avatar
 
PTrader: (0/0%)
Join Date: Oct 2011
Location: Dallas, TX
Posts: 339
Haven't made much progress on this.

I accidentally hooked up the 3.3V input on the feeders to 12V and blew the circuitry. The rotating motors still work, so I plan on directly controlling the motor and getting input from the limit switch to make them work.

The stepper motors do work, but its basically impossible to have them rotate 360 degrees exactly.

I had originally written the code to make them rotate about 240 degrees, and then rotate the same amount backwards, so that they wouldn't get "misaligned", but this didn't prove to be effective. After a few weeks of usage, they were off by 60 degrees or so. Stepper motors by nature just aren't accurate enough to do a lot of rotations without being calibrated at some point.

I'm probably going to use some sort of limit switch on the stepper motors. So basically the arduino will rotate the stepper motor/drum until a notch in the drum hits a limit switch, and then that will send a signal to have the arduino stop the rotation.

That's how store bought feeders work, and its probably the most reliable method.

In a related note, I recently took apart a wall clock and discovered that the rotating mechanism that I found in the "Daily Double" feeders (and the Fish Mate feeders) is identical to what inside the clock. Basically, those feeders are reliable in their timekeeping because they have a quarts clock running them. Just an interesting tid bit of information.

DIY Enthusiast


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
PhysicsDude55 is offline  
post #10 of 26 (permalink) Old 01-27-2015, 11:42 PM
Planted Tank Guru
 
kman's Avatar
 
PTrader: (1/100%)
Join Date: Dec 2013
Location: Los Angeles
Posts: 2,350
Doh! I hear you re accidental connections. I cooked a Mega the other day, mis-connecting a shield that was powered up.

Also, I learned something funny: If you accidentally connect your dosing pump wiring to the temp sensor headers it fires up the dosing pumps! WTF?!? I had no idea that kind of juice was flowing through the temp sensor!


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

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

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
kman is offline  
post #11 of 26 (permalink) Old 01-28-2015, 12:46 PM
gog
Algae Grower
 
PTrader: (1/100%)
Join Date: Oct 2014
Location: Philly
Posts: 39
I've seen some DIY feeders made with a small auger and a motor http://www.instructables.com/id/Auto...Fish-Feeder-2/
I can see that being easily controlled by an Arduino. You could run the motor for a different time to change your dose. I don't have the means to build or try it but its an idea I've been kicking around.
gog is offline  
post #12 of 26 (permalink) Old 01-28-2015, 01:19 PM
Children Boogie
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 16,743
I killed my $250 CO2 sensor. So we've all been there
mistergreen is offline  
post #13 of 26 (permalink) Old 01-28-2015, 07:20 PM
Planted Tank Guru
 
kman's Avatar
 
PTrader: (1/100%)
Join Date: Dec 2013
Location: Los Angeles
Posts: 2,350
Quote:
Originally Posted by gog View Post
I've seen some DIY feeders made with a small auger and a motor http://www.instructables.com/id/Auto...Fish-Feeder-2/
I can see that being easily controlled by an Arduino. You could run the motor for a different time to change your dose. I don't have the means to build or try it but its an idea I've been kicking around.
That's a really clever build! Super simple, too.

Sadly, again, not something us guys with small tanks can take advantage of. Only works with big pellets, in a situation where precise amounts aren't important.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

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

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
kman is offline  
post #14 of 26 (permalink) Old 01-28-2015, 07:41 PM
Children Boogie
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 16,743
An arduino controlled stepper motor can very precise. I can see a precise feeder being made.


Sent from my iPad using Tapatalk HD


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
mistergreen is offline  
post #15 of 26 (permalink) Old 01-28-2015, 07:51 PM
Planted Tank Guru
 
kman's Avatar
 
PTrader: (1/100%)
Join Date: Dec 2013
Location: Los Angeles
Posts: 2,350
Quote:
Originally Posted by mistergreen View Post
An arduino controlled stepper motor can very precise. I can see a precise feeder being made.
That apparently hasn't been PhysicsDude55's experience thus far, but perhaps you just need a higher end stepper motor?

I'm thinking something involving either gears, or some sort of rotation tab that a little arm would push along until it gets to the point that it rotates out of contact. That's the only way I've thought of that I'll be able to precisely turn a carousel on command.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

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

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
kman is offline  
Reply

Tags
None

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the The Planted Tank Forum forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode



Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome