Jump to content
mattpatt

My Own Version Of A "furfindr" Using Picaxe

Recommended Posts

**UPDATE** Changed the name of the topic. Going to use this thread to keep all info in one place.

 

 

I was wondering if someone had a snipet of code that shows how to use a momentary switch to select between different options using PICAXE. I'm working on a project and I need some way to select different modes so I would maybe press it once for mode 1, twice for mode 2, three for mode 3, etc. etc.

 

 

Thanks,

Matt

Edited by mattpatt

Share this post


Link to post
Share on other sites
 

I'm not aware of anyone trying that with picaxe as of yet. But that would be a nice option instead of dips...Sounds like a fun project to play with.

Edited by bowgod02

Share this post


Link to post
Share on other sites
 

Hi Ron,

 

I think I found it. mheimburg1 mentioned this in discussion about my time lapse camera project...

 

 

warmup:
w1=300
do while w1<0
if pin3=1 then inc b1
w1=w1-1
loop
goto standby

standby:
if b1=1 then pause 10000 endif
if b1=2 then pause 30000 endif
if b1=3 then pause 50000 endif

 

Push button once pause 10 seconds, twice 30 seconds, three times 50 seconds.

Share this post


Link to post
Share on other sites
 

Thats something like I was just thinking as well. Put the momentary to pin3 from your +V and have it read how many times it went high and save that value.

Share this post


Link to post
Share on other sites
 

I was just about to throw it on the breadboard with an led to test it. But I think your on your way with it.

Edited by bowgod02

Share this post


Link to post
Share on other sites
 

To fill you in on what I'm working on. I'm building my own version of a FurFindR. http://www.wasatchwild.com/teaser.html I recently purchased one (it hasn't come in yet) but it's limited to 4 different sounds and that's all. My idea was to make something similar with a PICAXE 20X2 (you could use a different one this is just what I had on hand) and a mp3 playback module so that I could run unlimited sounds and select differnet ones via a momentary switch. I found this mp3 module...

 

http://www.mdfly.com/index.php?main_page=p...products_id=284

 

(they had two in stock when I placed my order)

 

Among other things this module can be controlled via 4800 baud serial TTL and accepts standard SD cards. Not to mention the price! I ordered one and it came in yesterday. Got it breadboarded up last night along with some quick code and it sounds great! Now I'm going to add a LDR so that it only plays at night and a couple of momentary switches. One switch to control the delay between playing a mp3 and the other to select which mp3 to be played. I also need to figure out some type of small audio amplifier to drive my speaker as I'm using a amplified set of computer speakers right now. I need something that can run off 6v as I am planning on using a 6v lantern battery for the power source.

 

 

Matt

Edited by mattpatt

Share this post


Link to post
Share on other sites
 

Now that sounds interesting. I bought a bunch of stuff to do this last year and it's still in the drawer. One thing to consider with your code is that you will time out pretty quick wihtout a pause in the loop. Unless your really really fast lol.

Share this post


Link to post
Share on other sites
 
 

Got the LDR circuit breadboarded up and it seems to work. I used a LED and code from the manual to determine the approximate best settings for detecting when it's dark outside. Now I need to write the code for it so that the PICAXE will only tell the mp3 module to play at night. Once I get that going I will wire up the switches and test them. My plan is to add stuff one at a time, test each component, then add to the code and test. Still waiting on the 1 watt amplifier kit to show up.

Share this post


Link to post
Share on other sites
 

Very interesting project. Just briefly read some stuff about it. So, how do you select which song to play. The Picaxe sends the code to the player?

Share this post


Link to post
Share on other sites
 
Very interesting project. Just briefly read some stuff about it. So, how do you select which song to play. The Picaxe sends the code to the player?

 

The mp3 player can be controlled by serial TTL. The picaxe sends a command to the mp3 player telling it to play the specific song. In theory the way it will work will be when you turn the unit on you'll have a brief period where you can push a momentary switch one, two, three or four times to select a different mp3. The mp4 will play for however long it is then when finished will pause for 40 seconds and then play the mp3 over again. This will repeat as long as it is dark outside. Once it is light a command will be sent to the player to stop playing the mp3. When it becomes dark again it will start playing the mp3 again. To make it play all day you would just cover up the LDR with some electrical tape or something similar.

 

The mp3 player takes a standard SD card so if I want to experiment with different sounds I can do that by just replacing the card. A few of the sounds you could have would be cottontail distress, woodpecker distress, mouse squeek, etc. Anything that you would use to attract predators.

 

To start out with I'll probably do something simple and just have one mp3 on the card and not use a momentary switch. Then when I get that working I may add the switch and more mp3s. Another way to do it would be to keep things simple and not have a switch. Just have 4 or 5 small SD cards each with a different sound on it. When you want to change sounds just switch out the SD card. You can get small 128mb or 256mb SD cards for little to nothing on ebay.

 

I'm thinking about packaging everything inside a piece of PVC (not sure what size yet) much like the FurFindR.

 

Matt

Edited by mattpatt

Share this post


Link to post
Share on other sites
 

Making progress. I think I've decided to make things even simpler by eliminating the CDS/LDR and just use the LED to detect the light. I'm going to have one on the board anyway so why not use it for light detection as well. I know it won't be as sensative as a LDR but I'm not concerned about it. Just as long as it comes on sometime in early evening and goes off sometime in early morning that will be fine. I also picked up a Radio Shack mini amplifed speaker from my local used electronics store for $2 (they are $20 at Rat Shack). This thing runs off of a 9v battery. Sound is nice and loud and would work great for what I'm wanting to do but not sure about battery life. If it would just last a week that would be all that I need. I have rechargeable 9 volts so swapping them out wouldn't be a problem. The board itself is going to run off 6v rechargeable lantern batteries. I have plenty and they fit perfectly inside the PVC I'm going to use to house everything in. The 1 watt amp kit I ordered is coming from China so it'll be a few weeks before it comes in so I'm wanting to get something going now to test while I wait.

Share this post


Link to post
Share on other sites
 
 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×