Can someone check a circuit for me please

L

Larry Green

Guest
Hi Folks,

I have recently been asked to come up with circuit for a hobby project and
it has been many, many years since I last dabbled in electronics and circuit
design.

After a lot of thought and investigation on the web I think I now have a
feasible design but for some reason one side of my brain is telling me there
is an error while the other side is saying everything looks good!

The main area for concern is in the push button/de-bounce resistor
arrangement. I have a suspicion that they may need reversing (i.e. the
switch needs to be at the top and the resistor at the bottom). My 'logic'
tells me it is wrong at the moment and the inputs will be 'high' at all
times, however my rusty electronic theory brain cells tell me that due to
current flow the circuit is correct as it stands. I am also concerned about
the location of D2 which is acting as a reverse polarity protection device
in case someone tries to connect the 9V battery backwards with the switch
still in the 'on' position.

Can someone please check it over and tell me which is correct and if you see
any other glaring errors could you point me in the right direction on those
too. The circuit is designed to randomly select one of two sound options
after a random delay. One push button will start the random sequence while
the other two will each play one of the sound options for identification
purposes.

The circuit can be found here......

http://www3.sympatico.ca/larry.green/circuit_diagram.gif

Thanks for any help you can give, once I have the circuit nailed I can
concentrate on programming the PIC (a totally new area for me but I am on
the learning curve.....lol).

Larry Green VE3YET
 
Larry Green wrote:

The main area for concern is in the push button/de-bounce resistor
arrangement. I have a suspicion that they may need reversing (i.e. the
switch needs to be at the top and the resistor at the bottom). My 'logic'
tells me it is wrong at the moment and the inputs will be 'high' at all
times, however my rusty electronic theory brain cells tell me that due to
current flow the circuit is correct as it stands.
As you have them, in the diagram, the input will be high when the switch
is open circuit, and low when the switch is closed. Is that what you
intended?

You could swap the switches and resistors, the inputs would then be high
when the switch is closed, and low when the switch was open circuit.
Either will work equally well just as long as you remember which way
round it is when you write the software. I.e. it is just as easy to
make the PIC do something when an output goes low or high.

You refer to the resistors as "de-bounce" resistors, they are not. If
you want to de-bounce the switch you will have to add some additional
components, but do you need to? Will it matter in your application if
you receive several low-high-low transitions when the switch is pressed
once? If yes you could do this in software.

I am also concerned about
the location of D2 which is acting as a reverse polarity protection device
in case someone tries to connect the 9V battery backwards with the switch
still in the 'on' position.
you could move D2 so that it will protect the LED, D1, as most LEDs have
a maximum reverse voltage ~5V

Can someone please check it over and tell me which is correct and if you see
any other glaring errors could you point me in the right direction on those
too.
What is the purpose of D3 R3 RA3? Are you using the LED voltage drop as
a voltage reference, or do you want to switch the LED from the PIC? If
you want to switch the LED then I would suggest that you connect the
resistor between the PIC output and the LED, not to the +5V supply.

--
-----------------------------------------------------------------------
To reply to me directly:

Replace privacy.net with: totalise DOT co DOT uk and replace me with
gareth.harris
 
"Larry Green" <larry.green@nospam.sympatico.ca> schreef in bericht
news:9fdlb.1745$VQ3.233626@news20.bellglobal.com...
Hi Folks,

I have recently been asked to come up with circuit for a hobby project and
it has been many, many years since I last dabbled in electronics and
circuit
design.

After a lot of thought and investigation on the web I think I now have a
feasible design but for some reason one side of my brain is telling me
there
is an error while the other side is saying everything looks good!

The main area for concern is in the push button/de-bounce resistor
arrangement. I have a suspicion that they may need reversing (i.e. the
switch needs to be at the top and the resistor at the bottom). My 'logic'
tells me it is wrong at the moment and the inputs will be 'high' at all
times, however my rusty electronic theory brain cells tell me that due to
current flow the circuit is correct as it stands. I am also concerned
about
the location of D2 which is acting as a reverse polarity protection device
in case someone tries to connect the 9V battery backwards with the switch
still in the 'on' position.

Can someone please check it over and tell me which is correct and if you
see
any other glaring errors could you point me in the right direction on
those
too. The circuit is designed to randomly select one of two sound options
after a random delay. One push button will start the random sequence while
the other two will each play one of the sound options for identification
purposes.

The circuit can be found here......

http://www3.sympatico.ca/larry.green/circuit_diagram.gif

Thanks for any help you can give, once I have the circuit nailed I can
concentrate on programming the PIC (a totally new area for me but I am on
the learning curve.....lol).

Larry Green VE3YET
Larry,

Some comments:
- Your green LED D1 is not protected by D2. When the battery is reversed it
may be blown as most LEDs do not withstand 9V.
- Your switches PB1-3 are right this way. The inputs of the PIC will be high
but that does not matter. The inputs of the PIC have very high input
resistances so there is no current flowing except fo a neglectable leakage.
You can change R's and PB's if you wish, but that is not usual. I think it
has to do with the old TTL circuits which inputs has to source current to be
pulled low. Anyway your software has to handle this as well as the debounce.
There is no need to use analog inputs. Digital will do better for switching
functions. So you also do not need a Vref that seems to be made by D3 and
R3.

petrus


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.525 / Virus Database: 322 - Release Date: 10-10-2003
 
"petrus bitbyter" <p.kralt@hccnet.nl> wrote in message
news:goklb.336520$lh.82209744@amsnews02.chello.com...
"Larry Green" <larry.green@nospam.sympatico.ca> schreef in bericht
news:9fdlb.1745$VQ3.233626@news20.bellglobal.com...
snip

Larry,

Some comments:
- Your green LED D1 is not protected by D2. When the battery is reversed
it
may be blown as most LEDs do not withstand 9V.
- Your switches PB1-3 are right this way. The inputs of the PIC will be
high
but that does not matter. The inputs of the PIC have very high input
resistances so there is no current flowing except fo a neglectable
leakage.
You can change R's and PB's if you wish, but that is not usual. I think it
has to do with the old TTL circuits which inputs has to source current to
be
pulled low. Anyway your software has to handle this as well as the
debounce.
There is no need to use analog inputs. Digital will do better for
switching
functions. So you also do not need a Vref that seems to be made by D3 and
R3.

petrus
Thanks petrus, I have already made a number of changes to the circuit which
cover most of your points (plus a few others). The D3 was in fact an error
and should have been tied to the OP not the +5V rail.

Thanks for your help.

Larry
 
"Gareth" <me@privacy.net> wrote in message
news:bn3s11$sjlds$1@ID-211380.news.uni-berlin.de...

What is the purpose of D3 R3 RA3? Are you using the LED voltage drop
as
a voltage reference, or do you want to switch the LED from the PIC?
If
you want to switch the LED then I would suggest that you connect the
resistor between the PIC output and the LED, not to the +5V supply.
It appears that D3 is turned off by the PIC pin. This would work, but
it uses allot of power and it would use more power when the LED was off
than when it's on. It also exceeds the maximum sinking current for the
pin bye a few mA. It should be driven directly by the PIN thru a larger
resistor (300-1k) IMO. Also he could save on resistors by using the
PORTB pins for the switch inputs and enabling the internal weak
pull-ups. MCLR needs to be tied to Vdd. I'm assuming he's planning on
using the internal oscillator as there is no XTAL indicated in the
diagram.

michael
 

Welcome to EDABoard.com

Sponsor

Back
Top