tigger03 wrote:
Hello BullwinkleII,
I am attempting to build an on-demand fish feeder based on your model (I appreciate you posting the schematic for it on your blog) and had several questions about the circuit construction and supplies needed.
What do the small rectangles connected to C2, C4, and B3 represent?
Would a zener diode (Radio Shack 276-0563) work for the flyback diode connected to the motor?
Would cadmium-sulfide photocells Radio Shack 276-1657 work for the light dependent resistor?
For the regulator, do you think +12VDC Voltage regulator Radio Shack 276-1771 would work?
Thank you very much

My project uses a PICAXE chip and there is some good information available on their site
Are you part of the school that's working on an aquaponics demand feeder project? If so, where are you based (just out of interest)
I'll invite some people to answer you questions because in spite of actually making the thing, I used all these other peoples brains to do it. Generally speaking, I find other people's brains work extraordinary well.
Can you quote the post referring to C2, C4, and B3 so I can tell which bits your referring to...
Or just use the latest version I can find on my system looks like this...
Attachment:
Demand feeder 2012 12 17 0312.jpg [ 162.27 KiB | Viewed 5481 times ]
The free PICAXE simulation software
9windows simulates, mac and linux is just an editor) is available here...
windows ...
http://www.picaxe.com/PE6mac and linux ...
http://www.picaxe.com/Software/PICAXE/AXEpadand the easy to read manuals can be found here...
http://www.picaxe.com/Getting-Started/PICAXE-Manuals/and the last version of the code ( I seem to remember this code threw some errors after running for a while but it still might be useful) I could find looked like this...
Code:
#rem
Demand Fish Feeder Picaxe 20M2 Version 2012 12 19 2330
{
----------------------------------------------------------------
NO RIGHTS RESERVED
----------------------------------------------------------------
This project is an open source demand fish feeder.
All aspects of the project are open source, including software, and hardware (both
electronics, and actual PVC delivery device) and are given freely to the world without
limitation or any claim to usability, functionality, or any claim to anything else.
Enjoy at your own risk.
The very long variable (symbol) names are an attempt to make the program readable in English
for people who are not familiar with code.
Report LEDs flash out their information using a long flash for 10s (actually long with a
tiny blip at the end), a short flash for single digits, and a medium length strobe for zero.
so...
23 is long long short short short
30 is long long long med strobe
#endrem
}
#NO_DATA 'sets the editor to NOT look for data during upload to save a second or two
#PICAXE 20M2 'The chip in use
''#SIMTASK 2 'tasks provide turn by turn psudo multitasking. This sets which task is
'simulated during debugging
'------------ Symbols ------------------------------------------
{
'Pins ----------------------------------------------------------
'Left hand side of the chip
Symbol FeedMotor = c.7 'the motor that turns an auger to diliver feed
Symbol FishActivatedLever = pin6 'a momentary switch the fish press when they want food
Symbol FeedIsAvailableLED = c.5 'an LED that tells the fish feed is available
Symbol ReportFeedsPerDaySettingLED = C.4
Symbol ReportFeedSizeSettingLED = C.3
Symbol IllegalFeedAttemptsLED = c.2 '
Symbol ReportHoursSinceDawnLED = c.1
'Symbol c.0
'Right hand side of the chip
'Symbol b.7
'Symbol b.6
'Symbol b.5
symbol ReportFeedsSoFarTodayLED = b.4
Symbol LightDependantResistor = b.3 'to make the dawn light required adjustable
Symbol FeedNowButton = pinB.2 'overrides the feed restrictions, and lights the fish light
'also used when booting to flag a normal start
Symbol SetFeedsSizePot = b.1
Symbol SetFeedsPerDayPot = b.0
'The following Symbol lines assign a word, byte, or bit sized memory location to a name
'veriables starting with s3_ indicate the variable is used in Start3
'--------------------------------------------------------------------------------------
'word variables use 2xBytes and store values between 0 and 65535 ----------------------
'-----w1 and up --------------------
Symbol UsedAsBitVariables = W0
''symbol FeedSizePotValue = w1
''Symbol FeedsPerDayPotValue = w2
Symbol FeedSizeAtTheMotor = w1 'in milliseconds
Symbol SecondsBetweenFeeds = w2
Symbol MinutesBetweenFeeds = w3
'-- do not overlap Word variables (above) and Byte variables (Below)----
'Byte variables store values from 0 to 255 --------------------------------------------
Symbol FeedsPerDayPotValue = b12
symbol i = b13
symbol FeedSize = b14
symbol FeedSizePotValue = b15
Symbol FeedsSoFarToday = b16
Symbol Start3SelectedLED =b17 'used in start3 to report using different LEDs
Symbol ItemToReportStart12 = b18 'used in start3 to report different reports
symbol ItemToReportStart1Start3 = b19 'used in start3
symbol Counter = b20
''Symbol NearlyADay = b16
''Symbol HoursSinceDawn = b17
''symbol LightReading = b18
symbol s3_IllegalFeedAttempts = b21
Symbol FeedsPerDay = b22
''Symbol s3_FeedsSizePotValue = b21
Symbol s3_Counter1 =b23
Symbol s3_Counter2 = b24 'used in start2
Symbol s3_counter3 = b25
Symbol s3_DataToReport = b26
Symbol s3_LedToUse = b27
'byte variables (above) range from b27 and down ---------------------------------------
'bytes b0 and b1 (w0) reserved as single bit flags -- bit 0 - 15 ----------------------
'Bit variables are b0 to b15-----------------------------------------------------------
Symbol IsFeedAllowed = bit0
Symbol AbnormalRestart = bit3
Symbol BootTypeSelected = bit4
symbol IsBootTypeSelected = bit5
'Constants------------------------------------------------------
'The NearlyADay variable is a variable so I can make them shorter when
' testing the program
''let NearlyADay = 23 '23 hours before we start chacking for dawn
' Initialise --------------------------------------------------
s3_counter3 = 1
'Fake inputs for debugging-------------------------------------=== DEBUG ONLY DELETE THIS
''let FeedSize = 15 '1500 = run the motor for one and a half seconds
''let FeedsPerDay =24 'large number for testing as I cant wait all day
}
Main: 'This is run when the device starts
pause 1000
''let BootTime = Time
Let IsBootTypeSelected = 0 'boot type not yet selected
let AbnormalRestart = 1'default to abnormal unless there is human intervention
Let FishActivatedLever = 0
let IsFeedAllowed = 1
let s3_IllegalFeedAttempts = 0
let FeedsSoFarToday = 0
high FeedIsAvailableLED
''let ReportPause = 4000
MainLoop: 'this section gets repeated throughout the a day.
{
'check to see if the required pause between feeds has passed
do
''let Time = 0 'reset and stert counting up to one hour again
let IsFeedAllowed = 1
high FeedIsAvailableLED
if FishActivatedLever = 0 and IsFeedAllowed = 1 then '1 is yes, 0 is no
Do Until FishActivatedLever = 1 :Loop 'pause here until the lever is released
low FeedIsAvailableLED
high FeedMotor 'turn on the feed motor
pause FeedSizeAtTheMotor 'leave it one for the number of milliseconds stored in FeedSize
low FeedMotor 'turn off the motor
let IsFeedAllowed = 0
low FeedIsAvailableLED
let FeedsSoFarToday = FeedsSoFarToday + 1
exit
end if
if FishActivatedLever = 0 and IsFeedAllowed = 0 then
Do Until FeedNowButton = 0 :Loop
pause 300
s3_IllegalFeedAttempts = s3_IllegalFeedAttempts +1
exit
endif
loop
pause 1000 ''to make sure variables get populated
For i = 1 to MinutesBetweenFeeds
pause 60000 ''should be 60000 to pause for 60 seconds each pass
next i
goto mainloop
end
}
'Main Subroutines ----------------------------------------------------------------------
{'---------------------------------------------------------------------------------------
'nothig to see here
}
'====================================================================================================================
Start2:
do
'read the value of the pots into the variables
ReadADC SetFeedsPerDayPot,FeedsPerDayPotValue
ReadADC SetFeedsSizePot,FeedSizePotValue
'Mess about with the various forms of the FeedSize to make it right for the motor or the report LED
''The pot returns values from 0 - 255 depending on the user input via a screwdriver
''The motor likes values in the thousands. 1000 = 1 second
''The report LEDs work best with values under 100
''So we adjust the values for the motor, and so the user can easily read changes made on the Report LED
Feedsize = FeedSizePotValue / 10
FeedSizeAtTheMotor = FeedSizePotValue * 20
'Adjust Feeds per day value so it reports better
FeedsPerDay = FeedsPerDayPotValue /2
Let MinutesBetweenFeeds = 1440 / FeedsPerDayPotValue '1440 minutes in a day
''if FeedNowButton = 1 and FeedsSoFarToday < FeedsPerDay then
''let IsFeedAllowed = 1
''endif
loop
'====================================================================================================================
Start3: 'third program flow reports the values of HoursSinceDawn, and FeedsSoFarToday in turn.
{
do
select s3_counter3
Case 1
s3_DataToReport = FeedsPerDay
s3_LedToUse = ReportFeedsPerDaySettingLED
goto s3_report
s3_counter3 = s3_counter3 + 1
Case 2
s3_DataToReport = FeedSize
s3_LedToUse = ReportFeedSizeSettingLED
goto s3_Report
s3_counter3 = s3_counter3 + 1
Case 3
s3_DataToReport = s3_IllegalFeedAttempts
s3_LedToUse = IllegalFeedAttemptsLED
goto s3_Report
s3_counter3 = s3_counter3 + 1
Case 4
s3_DataToReport = FeedsSoFarToday
s3_LedToUse = ReportFeedsSoFarTodayLED
goto s3_Report
s3_counter3 = s3_counter3 + 1
''Case 5
''s3_DataToReport = HoursSinceDawn
''s3_LedToUse = ReportHoursSinceDawnLED
''goto s3_Report
''s3_counter3 = s3_counter3 + 1
case 5
let s3_counter3 = 1
Endselect
loop
}
s3_Report:
{
pause 500 'pause for the desired time between each report
if s3_DataToReport = 0 then
goto FlashZero
endif
s3_Counter2 = s3_DataToReport/10 'isolate tens
for s3_Counter1 =1 to s3_Counter2 'flash tens
if s3_Counter2=0 then
goto Remainder
exit
end if
high s3_LedToUse
pause 800
low s3_LedToUse
pause 40
high s3_LedToUse
pause 40
low s3_LedToUse
Pause 780
next s3_Counter1
Remainder:
s3_Counter2 = s3_DataToReport//10 'isolate remainder
for s3_Counter1 =1 to s3_Counter2 'flash units
if s3_Counter2=0 then
goto FlashZero
end if
high s3_LedToUse
pause 200
low s3_LedToUse
pause 200
next s3_Counter1
goto SkipZero
FlashZero:
high s3_LedToUse
pause 30
low s3_LedToUse
pause 30
high s3_LedToUse
pause 30
low s3_LedToUse
pause 30
high s3_LedToUse
pause 30
low s3_LedToUse
pause 30
high s3_LedToUse
pause 30
low s3_LedToUse
pause 30
high s3_LedToUse
Pause 30
low s3_LedToUse
SkipZero:
s3_counter3 = s3_counter3 + 1
goto start3
'return <===== this and a DO, threw a stack error but only after working a few times
}