Oh-Zap
Sneak Peek - Fish Feeding Timer
Swimmy Timer
Here's a sneak peek at the next upcoming project.
Quick history: My wife and I keep asking each other if our daughter's fish named "Swimmy" was fed. Sometimes we remember but usually not. So the other day she had a brilliant and simple solution: make an led/timer indicator. My first reaction as she was sharing in detail how she thought it might work best was, "Wow she's hot! Oh and this idea is brilliant! Maybe I do have a future maker wife here!"
Her Idea was super simple, a red LED, a green LED, and a switch. Red means Swimmy hasn't eaten, green means he's got a full belly, and the push button switch to start a timer and turn on the green LED. The new Picaxe 08m2 has a built in "time" function which counts in seconds. When set to 16 hours or 57,600 seconds, the red LED turns back on and green goes off.All this on 2 AAA batteries in a small little project box.
Here's a shot:
In the next couple days I'll post the code and schematic.
This code is explicitly released under the GPL. And this page is licensed under a Creative Commons Attribution 2.5 License.
Now Available Cammy v.1.0 kits - Click Here
Cammy v.1.0 Living Room Webcam Tracking
It wasn’t long ago that my wife and I had our first child and if you have any kids you probably know the excitement of playing, teaching, changing diapers, staying up late at night and all those great memories. For us, my daughter's “Papa” lived on the other side of the country so he didn’t get to see her often; although, he came out whenever he could. To help keep Lucy, my daughter, and Papa connected on a more regular basis he got us both a webcam. This was amazing. We already had a computer hooked up to our LCD in the living room so the whole family could chat and being able to see each other on the big screen was great. Except if you know kids then you know how long they will actually sit in one place for the camera. About 30 seconds! My wife or I would constantly be getting up to follow Lucy around the living room with the camera as she showed Papa her rocking horse over there, and her toys in the toy box over here, and then this on the other side. You get the point. So born from a very real need came this following project which we still use to this day. We call it Cammy (you know, 'cause everything you tell a kid HAS to end in “e”: blanky, raggy, dolly, booby- my wife hates that last one).
Aside from the servos, this project barely costs over $10, and you can use any remote that has Sony code. For us, I just programmed an extra function button to switch to Cammy control and then picked the buttons I wanted to use to control it. I will show you how to do exactly the same thing; it really is very easy. On with the project... If you wish to skip the long walls of detailed text, there is a step by step process at the very bottom just for you.
First, here’s a list of all the components you will need to build this out.
Parts List:![]()
1 x Picaxe 08M
1 x IR Receiver
2 x Mini Servo (Hobby Store)
1 x 2 X 3 project board
1 x Project case (Radio Shack)
1 x Bracket for camera to servo
1 x 8 pin DIP socket
3 X 330R Resistor
1 x 220R Resistor
1 x 4.7K Resistor
2 x .01uF Capacitor
1 x Female USB plug
2 x 3 pin male headers
Also not shown is an 8 pin dip socket so you can take out the Picaxe chip, a 4.7K resistor for the IR Receiver, a project case.1 x 3 pin femal header (optional for ISP).
Schematic & Board Layout
The following schematic does not include the proper setup for in-circuit programming. I will include a new schematic with the ISP connections soon.
Download the code here Cammy Control.zip
Code:
output 1 'Setup pins 1 & 2 as output pins for servos
output 2 '
input 3 'IR input pin
output 4 'LED or optional pin i/o
symbol spospan = b1 'Servo Position holder for pan servo
Symbol spostilt = b2 'Servo Position holder for tilt servo
symbol servo1 = 1 'Pan Servo
symbol servo2 = 2 'Tilt Servo
symbol led = 4 'LED
symbol servomin = 80 'Servo minimum travel 75 is typical min
symbol servomax = 220 'Servo maximum travel 225 is typical max
symbol deadctr = 140 'Servo 1 & 2 center position
symbol fulllt = 80 'full right servo position - adjust for your full left button, max is still servomin-max from above
symbol fullrt = 220 'full left servo position - adjust for your full right button, max is still servomin-max from above
symbol panspeed = 7 'adjust this for speed of pan servo 2-10 is nominal
symbol tiltspeed = 2 'adjust this for speed of tilt servo 2-5 is nominal
;// IR Remote Button Data - adjust numbers acording to your remote found by debugging buttons
symbol incrt = 52 'Right Button Increment
symbol inclt = 51 'Left Button Increment
symbol posrt = 96 'Full Right Position
symbol posctr = 101 'Center Position
symbol poslt = 99 'Full Left Position
symbol incup = 116 'Up Button Increment
symbol incdown = 117 'Down Button Increment
spospan = deadctr
spostilt = deadctr
main:
setfreq m4
pulsout servo1,spospan 'Send new position to pan servo
pulsout servo2,spostilt 'Send new position to tilt servo
high LED
infrain2 'wait for new signal from remote
;debug infra 'uncomment to debug remote buttons
;goto main 'uncomment to debug remote buttons
setfreq m8
low LED
if infra = incrt then 'the following finds out what button was pushed then assigns the proper servo pulse to holders spospan & spostilt
spospan = spospan+panspeed min servomin max servomax
elseif infra = inclt then
spospan = spospan-panspeed min servomin max servomax
elseif infra = incup then
spostilt = spostilt+tiltspeed min servomin max servomax
elseif infra = incdown then
spostilt = spostilt-tiltspeed min servomin max servomax
elseif infra = posctr then
spospan = deadctr min servomin max servomax
spostilt = deadctr min servomin max servomax
goto posctrsub
elseif infra = poslt then
spospan = fulllt min servomin max servomax
goto posltsub
elseif infra = posrt then
spospan = fullrt min servomin max servomax
goto posrtsub
end if
Goto main
posrtsub:
for b0 = 1 to 17 'start a loop long enough to get the servo from one side to the next
setfreq m4
pulsout 1,fullrt 'move to central position
setfreq m8
pause 20 'wait 20ms
next b0
pause 20
goto main
posctrsub:
for b0 = 1 to 10 'start a loop long enough to get the servos centerd
setfreq m4
pulsout 1,deadctr 'move to central position
pause 20
pulsout 2,deadctr 'move to central position
pause 20 'wait 20ms
setfreq m8
next b0
pause 20
goto main
posltsub:
for b0 = 1 to 17 'start a loop long enough to get the servo from one side to the next
setfreq m4
pulsout 1,fulllt 'move to central position
pause 20 'wait 20ms
setfreq m8
next b0
pause 20
goto main
Construction
I’m going to leave you to get all the parts put together on the board, just use the schematic and start with one piece at a time. Once you get everything soldered in place, lets go ahead and program our chip.
Download the code and open it in your programmer. Before we send this to our Picaxe, we need to figure out what the button codes are for your remote. The nice thing about the Picaxe chips is their built in IR receive functions to accept any Sony Code. If you are going to use a universal remote, then pick the function button you want to use, like VCR or something.Then, using your remotes manual, program it to use any Sony device. Now we are going to use our new board and Picaxe to tell us what the button codes on our remote are. Plug in a USB cable to power the board, then plug in your programming cable. Next un-comment the code where it is bold up above. Now go ahead and program the chip with this code. When done you should see the debug window pop up. Go ahead and point the remote at the IR Receiver and press a button. What does the debug window say for b13? If you see no change then something is wrong. Otherwise the number you see is the button code. Go through each button you want for the following functions: Up, Down, Left, Right, Center, Full Left, Full Right. The last 3 are great for getting somewhere quick, like chasing your kid from one side to the other.
Once you have the button numbers, enter them in to the code corresponding to their function and comment out the 2 lines from before. Now program your chip and see what it does. It should move the servos. You may need to swap the left and right numbers to adjust to the mirror effect.
Constructing the case and bracket to fit the camera took a bit of thinking through. Ever camera is going to be a bit different and might be a bit challenging to solve but I believe you can do what it takes to get it worked out. I would love it if you would leave photos and comments about how you made yours to help others make there's. Towards the bottom are pictures of how I did mine to give you a starting point and maybe some ideas to complete yours.
Conclusion:
I hope you find this project useful as my family and I have. If you have any questions ask away, I'll do my best to answer them. Please know that I am by no means an expert or profesional and only know what I know from the good ol' internet. Suggestions and creative critisism are more than welcome. Also I have already completed the initial work on Cammy v.2 which brings IR learning mode and 7 Seg LED output on an 18M Picaxe to make programing the remote of your choice even easier. Stay tuned for that release as well.
Step by Step Breakdown:
- Solder parts together on board
- Download & open Picaxe code
- Uncomment the 2 lines that are bold and say uncomment
- Program chip
- Program your remote with device function for Sony code i.e. pick VCR button and make it work with Sony VCR's
- Pick your buttons for the following actions:
- Left
- Right
- Up
- Down
- Center
- Full Left
- Full Right
- Press each button on remote, aiming it at Cammy and note the numerical code in the debug window on PC. Write down code.
- Change code to reflect new button data in Cammy code
- Comment code back -
- Program Picaxe
- Test button operation and servo performance
- Adjust code to perfect speed, distance, direction of buttons and servos.
- Complete assembly of Cammy and mount
- Track that Kid...or Cat...or!
Side Notes of what I'd do different:
For starters I would find quieter servos, at least the pan servo. It moves fast enough that it's not too annoying to the person on the other end but a metal geared servo wouldn't hurt.
I actually mounted my IR Receiver on a separate board that I could bring closer to the front of the case for better range. It's a good idea to get that sensor pushed to the front as much as possible.
Another thought I had was having an inline USB to eliminate needing to take up 2 ports.
This code is explicitly released under the GPL. And this page is licensed under a Creative Commons Attribution 2.5 License.
Main Menu
Oh-Zap Login
| 38.6% | | Israel |
| 36.7% | | United States |
| 3.2% | | Canada |
| 2.9% | | United Kingdom |
| 1.5% | | Germany |
| 1.4% | | Australia |
| 1.2% | | India |
| 0.8% | | Czech Republic |
| 0.7% | | Denmark |
| 0.5% | | Japan |
| Today: | 28 |
| Yesterday: | 21 |
| This Week: | 49 |
| Last Week: | 99 |
| This Month: | 370 |
| Last Month: | 391 |
| Total: | 2084 |




