Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Programmer Needed PIC12f683

Status
Not open for further replies.
You are a legend it works perfectly.
Good to hear. Do the squawks occur in a varying or constant pattern? What I mean is: does it sound like squawk, rest 1, squawk, rest 1, etc. or is it squawk, rest 1, squawk, rest 5, squawk, rest 3, etc.?? It's supposed to be the latter, but the simulation I ran gave me bad results after the first tone (NTS: looked like the simulator was rolling past a return at the highest address).

...can you suggest how to make it a little bit louder.
a) Try using a different output transistor. e.g. BC337.

b) Using the transistor in common-emitter configuration instead of emitter-follower (what you had) will increase the output power.

e.g. for a 6V power supply, 8ohm speaker, assume 50% duty cycle:
emitter-follower output power: 5.3^2/8/2 = 1.76W (assuming 0.7V VBE)
common-emitter output power: 5.8^2/8/2 = 2.1W (assuming 0.2V VCE saturation voltage - depends on output transistor)
So that's almost a 20% increase in useful power due to a more efficient output driver. It only requires 1 resistor onto your current design.

c) If that's still not loud enough, use a 4 ohm speaker. That will double the current draw, thus doubling the power. You output transistor may have to be upgraded to handle the increased peak currents.

d) Use a bigger speaker. Or use a horn speaker. Really depends on costs and size constraints, I guess.
 
Here's the c code you asked for. If the comments aren't sufficient, I can explain any section you point out.

I compiled it using an old version of the HITECH PICC, so if you recompile it, you may get different timing and/or operation, but you could just simulate it or test it in circuit to find out.

You said the something about using the BC337: the sound became louder but also harsher/scratchier. The device is playing a 1-bit sound file so sound quality's going to be bad always. You may be able to make it sound a little nicer (get rid of some of the higher freqs) if you use an RC filter to the transistor. It might also be possible to increase the sampling frequency to improve the quality a little. I'll have a play when the pic arrives.
 

Attachments

  • birdcall.c
    8.7 KB · Views: 140
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top