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.

Circuit check please?

Status
Not open for further replies.

kybert

New Member
Hi,

The attached image is my finished circuit, which i would like your views before sending off for PCB manufacture.

Please feel free to comment on the design.

Operation:

The input is +12V from a mains adaptor, the circuit must opperate when the mains fails becuase it is a timer/clock counter.

The input is fed into X1 and IC1 78L05 regulator provides a smoothed 5VDC supply for the PIC. A battery backup is provided via a 3V lithum battery, and the two supplies are mixed via 2 diodes, so when the 5V reg output turns off because of a power failure, the battery will power the circuit.

The PIC can opperate down to 2.2V so 3V battery - 0.7 diode = 2.3V = OK ?

Caps C1 and C4 are typical values, and are not calculated, so their values may be wrong? The supply is via a regulated DC adaptor.

Q2 provides a sence for the pic so the PIC knows if it is using batteries or the 12V adaptor. When this sence is activated (Q2 off, GP0 pulled high via internal pullup), the PIC does not enable the output transistor (PNP) Q3, and goes into low power mode.

Q3 basicly switches the adaptor supply to the output. I needed a low dropout at the output (X2 connector), so i used PNP. Is it connected correctly? Correct resistor values for R6/R9 ?

The LEDs just show the supply states, except LED3 which will flash when the PIC detected a brownout during battery operation. The flashing will start when the adaptor power is restored to indicate that the clock (implimented in software in the PIC) maybe incorrect and will need resetting.

SL1 connector allows for in-circuit programming of the PIC, which will use PIC ports GP0 and GP1. Because the programmer will place 5V on these lines (clock and data) i have added a 1k resistor (R4) to my pull-low circuit. Will this be OK?



Any remarks are greatfully welcome.



Joe
 

Attachments

  • timer1.jpg
    timer1.jpg
    72.5 KB · Views: 504
1. The PNP transistor never can't switch off from PIC output. If You really need to switching in positive rail, need additional NPN transistor from PNP base to GND (with inverted PIC output).
2. In D1 and D3 positon use schottky diodes for smaller voltage lost.
3. If the Q3 pull down the PIC input, no need the resistor in collector (i hope, this input have programmable internal pull-up resistor)
 
Q2 does pull down the PIC input (internally pullup inside the PIC), but this pin is also used for programming (5V) so the 1k resistor prevents the programming signal short to ground via Q2.

If the PIC output is low, Q3 should turn on, right? and when the PIC is on then Q3 should turn off? I dont understand why an additional transistor is required here. Could you explain?

Joe
 
O.K. The PNP emitter sitting on +12V. When the PIC output is low, the transistor conduct, no problem, but for OFF-state need almost same voltage on base as on emitter. The pic out can go up to +5V, so remain almost 7V fot PNP opening!
 

Attachments

  • timer1_605.jpg
    timer1_605.jpg
    32.6 KB · Views: 458
Revised version shown in my image now. I added the transistor fo rthe PNP switching, chanded to schottky diodes, and changed the value of the Q2 base resistor.

How's this?


Joe
 

Attachments

  • timer1_138.jpg
    timer1_138.jpg
    64.1 KB · Views: 440
Looks fine. I forgot the base resistor R7, but You corrected it. Maybe the 330ohm too low for a darlington.
I don't see any failure.
 
1. There is absolutely no need for a voltage divider on the emitters like you're doing. (R9,R10,R11) Just one base resistor will do the job.
2. There is no need for a PNP Darlington. Darlingtons are used when your source doesn't give enough base current without an additional stage. Well, the NPN transistor is already such an additional stage. No need for Darlington!
3. Read your spec sheet for acceptable operating freq when you've got less than 5v for Vdd. Or other such gotchas. There are some pretty serious limitations in dealing with the lower end of the part's Vdd. Also check the errata sheets for the revision of the part you have.
4. Be aware that a CR2032 has a max rated continuous output of only 4mA, and a pulse rating of 20mA. The base current for those bipolars comes off the battery as well as the PIC's supply current. Not that LED flashlights don't push way past that rating, but they're not as sensitive to the voltage off the cell (and you're already pretty close to the lowest Vdd the part could be configured to operate in). Check the spec sheet to see if it suits your needs.
**broken link removed**
5. Read the spec sheet for the Schottkeys you use. They can have substantial leakage current, especially at higher temperatures. This will drain your battery while there is no Vin to the reg.
 
Hi,

Thanks for the advice, here is my reasoning, please correct my ignorance.

1. R9, 10 and 11 are used as pull low resistors for the transistors, otherwise the transistor acts as a linear device, turning neather on nor off becuase the base is floating, right?

2. Hi, the darlington is simply by mistake, i chose a 2A power transistor and thats what the symbol looked like in the schmatic program.

3. I read the datasheet, over and over just to make sure that the device can opperate down to the required voltage. It browns-out at 2.1V so 3V-0.33V(max drop on the diode) = 2.67V which should be ok. The device can opperate upto 4MHz at 2V (but uses lots of current!)

4. Then the detect circuit ( Mains / Batt Detect ) is not pulling GP0 to ground, the device will turn off all the leds, and enter a low power state until GP0 returns high. The GP0 pin is internally pulled high.
In this condition, the only curtrent in the circuit should be that used by the PIC, which is max. 28uA at 3V/Fosc=32k.

I've checked the datasheet for leakage current, but it is not mentioned? What am i looking for?

[edit]
The reverse current is 0.5uA at 25 degsC, which should be ok, right?
 
kybert said:
Hi,

Thanks for the advice, here is my reasoning, please correct my ignorance.

1. R9, 10 and 11 are used as pull low resistors for the transistors, otherwise the transistor acts as a linear device, turning neather on nor off becuase the base is floating, right?

R9, 10 and 11 are good practice to add, the circuit 'may' be OK without them, but it definately will be with them. The output of a logic gate is only guaranteed to conform to TTL levels, it's quite possible that the higher limits of a TTL LOW level could switch the transistors ON without R9 and R10 - generally PIC's are extremely good about this, but it does no harm to conform to good design practices. Likewise R11, this prevents any slight leakage of the lower NPN transistor turning the PNP transistor ON, again it's considered good design practice.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top