All times are UTC + 8 hours




Post new topic Reply to topic  [ 167 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9, 10 ... 12  Next
Author Message
PostPosted: Oct 10th, '11, 22:51 
Offline
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Mar 26th, '10, 20:46
Posts: 4592
Location: South Australia
Gender: Male
Are you human?: Yep
Location: South Australia
I've had a bit of a rethink as to how to implement the code on my new PICAXE 14M2 chip


because it has a feature that kind of fakes multitasking, I thought it would be a good way of simultaneously...

0. checking for changes in everything

1. checking for lever presses

2. reporting the number of feed so far


It doesn't really do these things simultaneously, but rather executes one line each in turn from these different processes.

The different processes are identified by

Code:
Main: (can also be identified as Start0)
   this a
   this e
End

Start1
    this b
End

Start2
     this c
End

Start3
     this d
End


So when the program runs, this a,this b,this c,this d would be run before this e

that is, each "start#" is run one command each in turn. This makes it much easyier to wait for a lever press, or pause for 15 seconds between each report of "feeds so far today" without interrupting the program flow.

The current state of my code looks like this for anyone interested...

Attachment:
Demand Fish Feeder 14M2 Ver 02-2011-10-11-0100.bas.zip [2.57 KiB]
Downloaded 154 times


Even if you're not interested, can someone let me know if that attachment works ok. It's zipped on linux, and I have no way of checking it on windows or mac, and wouldn't want to deprive anyone :)

_________________
-

My system

120 THINGS IN 20 YEARS - My blog about my learning adventure

My skills include being able to move slowly forward in time, and if I really concentrate, I can sometimes tell what I'm thinking.


Top
 Profile  
 
    Advertisement
 
PostPosted: Oct 15th, '11, 22:52 
Offline
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Mar 26th, '10, 20:46
Posts: 4592
Location: South Australia
Gender: Male
Are you human?: Yep
Location: South Australia
I've just spent the last 3 days trying to figure out why I cant translate the software that worked fine in the simulator, into something that worked in the real world.

it turns out...

1. a 1k resistor can look a bit like a 10k resistor
2. you need to connect components where they actually need to go rather than where they are not supposed to go.
3. in the simulator, a switch causes one switch event. In the real world a switch event is actually a chaotic random number of contacts that seem to have nothing to do with someone tapping a lever once.
4. when running the real world version on the chip, adding "debug" commands (these give feedback to your PC's monitor) causes enough of a delay to confuse you into thinking that one switch event is occurring when you tap the lever, but once you disconnect it from the computer and the debug commands, nothing could be further from the truth.

we live and learn

and learn

and learn

_________________
-

My system

120 THINGS IN 20 YEARS - My blog about my learning adventure

My skills include being able to move slowly forward in time, and if I really concentrate, I can sometimes tell what I'm thinking.


Top
 Profile  
 
PostPosted: Oct 19th, '11, 18:39 
Offline
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Mar 26th, '10, 20:46
Posts: 4592
Location: South Australia
Gender: Male
Are you human?: Yep
Location: South Australia
I'm working on timing of when fish should be allowed to feed.

I have a value that can be set (with a screwdriver so you cant do it by accident) to adjust the maximum number of FeedsPerDay.

I need to set the ForcedWait between feeds so the fish cant dump the lot all at once.
To do this I'm looking at something like...

ForcedWait = DayLength devided by FeedsPerDay

This will break the day into even segments of forced waiting time based on the set number of feeds.

But my fish like to eat once the water warms up a bit so don't tend to eat before brunch.

So I was thinking it should be based on dividing the remaining DayLengthy by the number of remaining FeedsPerDay.

so in the first case 12 feeds per day would mean they could hit the lever and get feed every 2 hours.

In the second case, if they didnt eat for the first 12 hours of the day, they could hit the lever and get feed every hour instead of every 2 hours.

Either way they couldnt get more feed than the user set as the maximum their system could prosess in a day...

------------
In the first case, if they didnt eat for the first 12 hours of the day, they would only have access to 6 feeds or half a days feed.

In the second case they could have all their feeds for the day whenever they wanted them.
-----------------

So, my preference is for the second case, but there is a potential problem. If the fish didnt feed for 23 hours, the lever would allow 12 feeds over the last hour. Then at dawn, would reset and offer another feed in two hours time.

So...

1. Should I set an absolute minimum time between feeds regardless of how many feeds they have had. Say 30 minutes or something, so (in this case) a full days feed MUST be spread over over at least 6 hours?

2. Or do you think a system could cope with having a full days feed delivered at the very end of the cycle, keeping in mind the next days feed wouldn't be delivered any faster than every 2 hours.

3. Something I haven't thought of?


Anyone, everyone?

I'm just looking for opinions.

_________________
-

My system

120 THINGS IN 20 YEARS - My blog about my learning adventure

My skills include being able to move slowly forward in time, and if I really concentrate, I can sometimes tell what I'm thinking.


Top
 Profile  
 
PostPosted: Oct 21st, '11, 12:18 
Offline
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Mar 26th, '10, 20:46
Posts: 4592
Location: South Australia
Gender: Male
Are you human?: Yep
Location: South Australia
Hhmm...

_________________
-

My system

120 THINGS IN 20 YEARS - My blog about my learning adventure

My skills include being able to move slowly forward in time, and if I really concentrate, I can sometimes tell what I'm thinking.


Top
 Profile  
 
PostPosted: Oct 21st, '11, 18:58 
Offline
Xtreme Contributor
Xtreme Contributor
User avatar

Joined: Jan 30th, '10, 01:16
Posts: 167
Gender: Male
Are you human?: yes
Location: London, UK
BullwinkleII wrote:
ForcedWait = DayLength devided by FeedsPerDay
...
So I was thinking it should be based on dividing the remaining DayLengthy by the number of remaining FeedsPerDay.
This implies that the feeds would be on the termination of the time period. ie the last feed time would be at sundown... when many fish stop feeding. Thereby if that final feed was triggered in would go uneaten.

I would suggest that the time period should be between the feeds meaning that you effectively need to increase the number of time segments by one. ie. FeedsPerDay+1

Quote:
[b]1. Should I set an absolute minimum time between feeds regardless of how many feeds they have had. Say 30 minutes or something, so (in this case) a full days feed MUST be spread over over at least 6 hours?
I would suggest that there should be a minimum time between feeds. If the fish don't trigger the feed then they basically lose out. It is better to err on the side of not feeding, than overfeeding.

_________________
Are you part of the Jungle?


Top
 Profile  
 
PostPosted: Oct 21st, '11, 20:40 
Offline
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Mar 26th, '10, 20:46
Posts: 4592
Location: South Australia
Gender: Male
Are you human?: Yep
Location: South Australia
DragonC wrote:
BullwinkleII wrote:
ForcedWait = DayLength devided by FeedsPerDay
...
So I was thinking it should be based on dividing the remaining DayLengthy by the number of remaining FeedsPerDay.
This implies that the feeds would be on the termination of the time period. ie the last feed time would be at sundown... when many fish stop feeding. Thereby if that final feed was triggered in would go uneaten.
.


Thanks for the input, but I dont follow this. I'm on some medication that's making me stupid, so it might just be that :)

The basic plan was to divide the day into even time periods - FeedsPerDay based on user preference as to how many.

The advanced plan was to make those divisions dynamic in that the gaps between feeds should get smaller if they didnt take the feeds early on in the day. So if they didnt feed for the first 12 hours, they could have twice as much over the next 12 hours.

so... MinutesRemainingInTheDay / FeedsRemaining = WaitTimeBetweenFeeds

_________________
-

My system

120 THINGS IN 20 YEARS - My blog about my learning adventure

My skills include being able to move slowly forward in time, and if I really concentrate, I can sometimes tell what I'm thinking.


Top
 Profile  
 
PostPosted: Oct 21st, '11, 20:47 
Offline
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Mar 26th, '10, 20:46
Posts: 4592
Location: South Australia
Gender: Male
Are you human?: Yep
Location: South Australia
Perhaps I need to learn a bit more about other fish. My silvers eat all day and night. They particularly like feeding at dawn and dusk.

In the wild when I go fishing, dawn and dusk are also good times to catch fish.

My thoughts were that any "time reset" should be based on roughly a 24 hour cycle, but biased towards resetting at a natural point in the day cycle rather than a human one. So I figured I'd allow the fish to feed over a 24 hour period, but reset the timer at dawn because its a real world event rather than a human imposed one from Greenwich.

_________________
-

My system

120 THINGS IN 20 YEARS - My blog about my learning adventure

My skills include being able to move slowly forward in time, and if I really concentrate, I can sometimes tell what I'm thinking.


Top
 Profile  
 
PostPosted: Oct 21st, '11, 20:56 
Offline
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Nov 16th, '06, 08:44
Posts: 27177
Location: Gerringong
Gender: Male
Location: NSW Australia
Even in aquaculture... fish aren't usually fed through the night...

_________________
>

Fresh By Nature - Distributor of Aquaponic Systems and Products in NSW
http://www.freshbynature.com.au


Top
 Profile  
 
PostPosted: Oct 21st, '11, 21:13 
Offline
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Mar 26th, '10, 20:46
Posts: 4592
Location: South Australia
Gender: Male
Are you human?: Yep
Location: South Australia
Really? My fish eat a lot at night.

In fact I would say, where temperatures compare, they are more active at night than during the day.

But I guess I am as well, so they may have just got it from me. I usually give them a small feed when I wander out to look at them. No doubt they can learn human timetables.

You catch a lot of fish in the wild at night though.

_________________
-

My system

120 THINGS IN 20 YEARS - My blog about my learning adventure

My skills include being able to move slowly forward in time, and if I really concentrate, I can sometimes tell what I'm thinking.


Top
 Profile  
 
PostPosted: Oct 21st, '11, 21:19 
Offline
A posting God
A posting God
User avatar

Joined: Oct 16th, '11, 06:12
Posts: 2016
Gender: Male
Are you human?: 0110010110
Location: Brisbane, qld
Just a few questions:
(I apologise for coming into this discussion so late, I have only just signed up to BYAP forum)

1. Will ALL AP fish learn to hit the feed lever ?

2. Is it ok to feed fish in summer the same schedule as winter ? (If the sun comes up at 7 in winter and that's the first feed, is it ok to do this in summer?)

3. Do you need to log all the time ? Or do you just want to monitor it for some time ?
The controller could just send the data out a serial port, and you connect a PC just to log while you are testing the system etc.

- You could just use the crystal for timing and also use the light sensor to (kind of) calibrate any time drift. HOWEVER if the system loses power it will take a full day or more to reset the time. An RTC (or microprocessor with internal RTC) and RTC backup battery or super capacitor is the best and simplest way to solve the time issue.

- writing to some sort of memory is not trivial with a small microprocessor, the electronics side is simple but it generally requires a file system implemented in the software. However I think there maybe be some solutions that can do this off the shelf. Not sure on cost though...

- 555 timer is probably not suitable to keeping time, it all comes back to what is generating the pulse, even normal crystals arn't the best with temperature fluctuations. Not sure on cost but all in one RTC is definantly the best way to keep time.
- Just another thought, it might seem a bit complex but you can get 2 way radio transceivers that you could use to talk back to a PC in the nearest building, then you could send logging information AND receive time sync updates every day/hour/minute..
-Could also be done with bluetooth or wifi (expensive)

_________________
My System


Top
 Profile  
 
PostPosted: Oct 21st, '11, 21:31 
Offline
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Dec 6th, '07, 01:13
Posts: 10323
Images: 0
Location: central FL
Gender: Female
Are you human?: YES at least mostly
Location: USA, Florida, Yalaha
The biggest danger about feeding at night (for certain types of fish at least) has more to do with dissolved oxygen and at least in pond aquaculture the dissolved oxygen levels go down over night so you don't want to risk add extra food that could make that situation go critical before dawn. Also the fact that few farm workers are going to be there monitoring fish over night and even if they were, it's hard to see.

I'm not too worried about that situation in my system under normal conditions. My catfish definitely eat best around dusk and into the early evening dark hours. Since the water cools off overnight they are usually a little less enthusiastic about the pre dawn feeding. A mid day feeding is the least likely to get attention unless I've really been starving them lately.

NO, summer/winter feeding amounts are going to be different. Feed amounts is definitely very temperature related.

_________________
Aquaponic Lynx
Main System
300 gallon System
Tower System
PeePonics


Top
 Profile  
 
PostPosted: Oct 21st, '11, 21:36 
Offline
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Nov 16th, '06, 08:44
Posts: 27177
Location: Gerringong
Gender: Male
Location: NSW Australia
TCLynx wrote:
NO, summer/winter feeding amounts are going to be different. Feed amounts is definitely very temperature related.


+1...

_________________
>

Fresh By Nature - Distributor of Aquaponic Systems and Products in NSW
http://www.freshbynature.com.au


Top
 Profile  
 
PostPosted: Oct 21st, '11, 22:26 
Offline
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Mar 26th, '10, 20:46
Posts: 4592
Location: South Australia
Gender: Male
Are you human?: Yep
Location: South Australia
SuperVeg wrote:
1. Will ALL AP fish learn to hit the feed lever ?



I have nothing but my own fish to go by, but Id say they will have no trouble. I think within a few weeks I could get gold fish running a maze in response to a stimuli. Really the only thing fish are good at is learning where to find food. And swimming. They seem pretty good at that.

I have nothing to base this on, and my guarantee is worthless, but all fish will figure it out.

I guarantee it.

I had a training plan all worked out, but my fish figured it out within a few days all on their own.

SuperVeg wrote:

2. Is it ok to feed fish in summer the same schedule as winter ? (If the sun comes up at 7 in winter and that's the first feed, is it ok to do this in summer?)



No, but I think yes with this system. ie it should be ok to run the same program summer and winter.

My thoughts were that I should feed based on a 24 hour period based on dawn as a reset time because that was easy to implement.

With silver perch, they are not so interested in food if the temperature is below about 16c. They really dont get excited until around 20c. I guess it's a sliding scale. Thats why I wanted to make my feeder demand based.

Currently I feed my fish based on the amount my grow bed can filter. I actually ignore what my fish want. They are the thing that is most able to be varied.

The final output of the fish and feed part of the cycle is nitrates. Nitrates you can safely bank, so they are the least of the things to worry about.

I feed at the moment by adding feed into a small bottle (I have a little system) up to a set line that I know my system can processes in a day. I then hand feed at various times each day and whenever I visit the system. I feed up to the maximum amount, but not more than that preset amount. If the fish dont eat it, they dont get their full maximum days feed.

That changes the nitrate levels, but keeps the nitrite and ammonia levels within the amounts my filtration can cope with.

Thats the basis of what I'm planning with this feeder.

That it should do the same thing as I do. Feed no more than a tested maximum daily limit, but other than that, give the fish the most feed they want but no more then they can have on any given 24 hour period. And perhaps more importantly, give it to them regardelss of when they want it, or when the human happens to be home.

I used to feed my fish twice a day. Morning and afternoon. But I found they often didn't want any feed until brunch because the water was too cold through winter.

So I started feeding then half a dozen times a day, and testing to see when they wanted it and when they didnt.

It turns out fish are complex.

I figured I'd leave it up to them.

Quote:

3. Do you need to log all the time ? Or do you just want to monitor it for some time ?
The controller could just send the data out a serial port, and you connect a PC just to log while you are testing the system etc.



logging isnt really on the agenda at the moment as far as I'm concerned other than to make the calculations as to how much more feed the fish can have in the rest of the day. Data logging is on TC's wish list and that will have to wait :)

Quote:
- You could just use the crystal for timing and also use the light sensor to (kind of) calibrate any time drift. HOWEVER if the system loses power it will take a full day or more to reset the time. An RTC (or microprocessor with internal RTC) and RTC backup battery or super capacitor is the best and simplest way to solve the time issue.


Having a pause in feeding after an abnormal event is really more of a feature than a bug. One plan was to have a 12 hour delay at bootup unless a button was pressed to say that the standard feeding regimen should proceed. I was thinking that a LED should flash when you turn it on for 12 hours unless you press the "resume" button.

Generally speaking, if there is a power outage or anything else abnormal, not feeding isnt such a bad idea.

I'm tending toward thinking that a 12 hour delay after an abnormal restart (one where there isnt a human to press the button) and then a reset at dawn should be a reasonable compromise.


Quote:
- writing to some sort of memory is not trivial with a small microprocessor, the electronics side is simple but it generally requires a file system implemented in the software. However I think there maybe be some solutions that can do this off the shelf. Not sure on cost though...



PICAXE has some pretty cool functionality there. And with wireless stuff. I think around $40AU for a pair of wirless parts to have one PICAXE board talk to another.

Serial out is also easy, so getting stuff into a spreadsheet is something I think even I could achieve :)

But it's not high up on my TODO: list at the moment.

Feel free to add it to yours :)

Quote:
- 555 timer is probably not suitable to keeping time, it all comes back to what is generating the pulse, even normal crystals arn't the best with temperature fluctuations. Not sure on cost but all in one RTC is definantly the best way to keep time.


I bought a RTC (real time clock) chip and all the stuff that goes with it, but I dont think I'll be adding it. The accuracy isnt really called for, and using a ... whatever those things are called... photoresistor(?) (light detecting doo-dad) should do the trick, and keep the feeder running on fishy time rather than human time.


Thanks so much for all the input.

It's too late to re-read this post and check to see if Ive said anything stupid and I'm not thinking straight anyway so dont be put off by anything odd.

Keep it coming.

_________________
-

My system

120 THINGS IN 20 YEARS - My blog about my learning adventure

My skills include being able to move slowly forward in time, and if I really concentrate, I can sometimes tell what I'm thinking.


Top
 Profile  
 
PostPosted: Oct 21st, '11, 22:40 
Offline
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Mar 26th, '10, 20:46
Posts: 4592
Location: South Australia
Gender: Male
Are you human?: Yep
Location: South Australia
I think this is all I need to get started and power up the beast.

I spent my time today making the actual PVC bit work, and it does. Ill put up a video tomorrow.

but in the meantime, here is my first circuit ...

Anyone knowing such stuff, please tell me what I need to fix before I solder it all up.

@SuperVeg, can you give me some feedback regardless, even if for some amazing reason, there is actually nothing wrong with it :)

Just let me know if there is anything obviously wrong with it or not.

I want to solder this bit up because I keep bumping bits on the breadboard and need the space to work out the infield adjustments with the pots for things like feed size and number of feeds per day, without bumping everything that's already working.

The components at top right are just stuff that hasnt been placed yet, and the red X's are cuts in the stripboard.

Attachment:
120 Things in 20 years - Electronics - demand fish feeder pebble breadboard 2011-10-22-0100.jpg
120 Things in 20 years - Electronics - demand fish feeder pebble breadboard 2011-10-22-0100.jpg [ 339.67 KiB | Viewed 2190 times ]

_________________
-

My system

120 THINGS IN 20 YEARS - My blog about my learning adventure

My skills include being able to move slowly forward in time, and if I really concentrate, I can sometimes tell what I'm thinking.


Top
 Profile  
 
PostPosted: Oct 21st, '11, 23:14 
Offline
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Mar 26th, '10, 20:46
Posts: 4592
Location: South Australia
Gender: Male
Are you human?: Yep
Location: South Australia
TCLynx wrote:
The biggest danger about feeding at night (for certain types of fish at least) has more to do with dissolved oxygen and at least in pond aquaculture the dissolved oxygen levels go down over night so... [stuff deleted].


What causes that?

I thought colder water held more oxygen than warmer water.

And would we see that with a pump fed aquaponics system?

_________________
-

My system

120 THINGS IN 20 YEARS - My blog about my learning adventure

My skills include being able to move slowly forward in time, and if I really concentrate, I can sometimes tell what I'm thinking.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 167 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9, 10 ... 12  Next

All times are UTC + 8 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group
Portal by phpBB3 Portal © phpBB Türkiye
[ Time : 0.666s | 18 Queries | GZIP : Off ]