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.

Junebug help??

Status
Not open for further replies.
Here you a ideal
 

Attachments

  • 18f1320.PNG
    18f1320.PNG
    9.4 KB · Views: 278
Not all small speakers are the same. I tried 3 of them all said 8ohm one was real loud
funny it was the smallest one. About 11/4 inch. A 3 inch one didn't make much sound
and a 2inch one was ok. but the smallest one was the loudest.
 
yo pommie I changed all

that was suggested but didn't get any sound out
I tinkered with the code until I got some sound.
I changed the 250 to 100 and nothing.
I added some more frequency code (see post) and got the PIC to perform
may not be perfect but it works
why??
dealing with amount of volume from pic (RB3)
connected larger speaker and yes it louder but speaker is toooo big
going / contemplating adding an LM386 amp
need power supply ideas that won't drain batteries while just sitting waiting for a deer to trigger the PIR
may just go with a 78L05 regulator and 6AA batteries(need 2 volts over what is needed)
should run for a long time
would like a longer sequence.
present one posted only lasts about 4 seconds
 
Burt,

You will get more volume if you feed the speaker from before the regulator.

Mike.
 

Attachments

  • mod.png
    mod.png
    30.8 KB · Views: 259
would like a longer sequence.
present one posted only lasts about 4 seconds

Try,
Code:
    If PORTB.0=0 Then       //if button 1 pressed
        For i = 1 To 200    //play 10 tones
            Tone=Rand(5)    //each tone is random frequency
            DelayMS(250)    //and for 0.25 seconds
        Next                //end for loop
    Else                    //otherwise
        Tone=5              //silence
        i=Rand(255)         //make rand more random
    EndIf                   //end if condition
Should last about 50 seconds as 0.25*200 = 50.

If you need longer than 255 notes then the variable i will need to be made into a word.

Mike.
 
cut copied pasted

and yes it is long
changed the 250 delay to 100 and it seemed to speed up.
tried several different combos but they didn't work
looking for suggestions for standalone battery supply
contemplating the 78L05 etc.
plus 6 AA batteries.
not sure how long it will run??
volum seemed to increase with the code you posted?? why??
 
If you change the 250 to 100 you are changing the length of the individual notes from 0.25 seconds to 0.1 seconds and so it speeds up. If you want it to slow down then use a bigger number - 500 will make each note 0.5 seconds long.

I've no idea why it would sound louder.

As for battery life, if you are using a transistor as suggested by Burt then it will only use lots of power when it is making noise. Once you get it working the code can be changed to make it use less power.

Mike.
 
I have tried Mike code just like I show you and it's loud like a smoke alarm. I have a box of small speakers all 8 ohms some are real loud some are not. The out put to the speaker is 5volts but the average is more like 2.5 to 3.5 volts.I would try it from the 6volt battery to the speaker which would give you maybe 4.5 peak volts to the speaker.
 
change code 4 less power??

now you really got my interest??
question for be80be
D1 and R1 = why?? just curious
I connected the speaker to the 9volts = more volum??
the PIR= I changed the pin out
had pin out for different PIR. 2n2222 as the PIR goes high on detect
use a LM78Lo5 as opposed to an LM7805
smaller, less current etc.
now just need some speakers a pc board and case
LOOK OUT DEER here we come
this will be great if it works
 

Attachments

  • Capture4-15-2009-8.51.59 PM.jpg
    Capture4-15-2009-8.51.59 PM.jpg
    133.7 KB · Views: 264
The diode keeps you from putting 13 volt to vdd when programming the chip I didn't put I ICSP header on there and the resistor pulls MCLR to VDD so it not floating
 
Like this with the ICSP header you don't need the transistor for the PIR a pic is a programmable transistor it can read high or low it don't care which it is. But make sure
your PIR out put is 5 volts mine are and they looked the same as what you posted. Yours may not be the same and you may need the transistor.
 

Attachments

  • 18f1320.PNG
    18f1320.PNG
    10.5 KB · Views: 264
Even if it put out more volts then 5 you could hook it to RA4 it's good to 8.5 I don't think
your PIR will swing that high. mine a 5 volts never hits 5 volts and at 9 it was 4.5 on the output
 
don't need the header??

I plan on soldering a dip 18 socket then inserting the PIC
program before inserting?? or not??
how to change code for less current draw??
perhaps I should keep the 29mm speaker as it has a clear plastic cover over the cone.
it keeps the windings in looks like??
have a start on pc board but need demensions for PIR
need to locate my calipers or research data sheet( not alot of info )
will be annoying them deer by Sunday
order my BMW next Friday-lol
 
You could use it later some one may want it to play a note when some walks up to the door
 
data sheet = no pin layout

need to measure or hard wire
specs power 4.5 - 20v
50ua
high level = 3v
low = 0
data sheet shows a transistor but if I don't need it??
 
All the PIR I have seen don't go over 5 volts out and they use the transistor to switch a relay
 
back to rat shack

going to plug into the ICD programming socket so I can test if the PIR will trigger RB3 programed to detect HIGH.
The PIR states that the output HIGH level is 3V
what dips and procedure to perform in circuit programming?
just turn dip switch 1-3 off and all others on
as for a speaker see previous post.
rethinking the amp.
still would like the sound prg to run faster as it now has lots of notes thanks POMMIE and be80be
 
Status
Not open for further replies.

Latest threads

Back
Top