apr9600 power supply

Status
Not open for further replies.
i just wanted to confirm,i though it is like that,just don't want to miss any possibility for troubleshooting,because it is not working -.-
 

so, the base current is 25mA? so i must get 2-3 hfe in order to drive the IR LED? and u said R2 is to limit the current on base, since it is 25 mA, why R2 is needed?
Ic=Ib*hfe
so is that Ib=25mA?if so,why need resistor to limit it?
is that i choose 40 hfe(min) transistor and hence i use R2 to limit the base current to about 1.5mA?so the voltage come out from PIC is 5v?refer to thread 18, I=V/R , V is 5v or the 1.6v?
which model of transistor is suitable? =.= sorry for too much questions...

the prescalar 1:4 and 1:256 what is the main different?is that speed?if i wanted to use 1:1, how to configure since the datasheet only mention minimum is 1:2?is that assign PSA is assign to 1( for WDT ) and hence it will have 1:1?
 
Last edited:

Post your latest circuit. My Hi-Tech is v9.80. See datasheet of your PIC for OPTION_REG settings. See what functions of OPTION_REF are selected if value is 0x81.

Prescalar 1:1 means you are dividing your clock by 1.

If clock is 4 MHz then with prescalar 1:1, clock for timer will be 4 MHz. If 1:256 then clock for timer will be 4 MHz/256. Which PIC are and what clock are you using?

You were told to generate IR burst of 38 KHz using two timers, one for 38 KHz and another for 2 or 3 ms delay between the bursts. Did you do that?
 
Last edited:

1st,tell me about the R2 of current switching transistor then only i can put the value for it,if not, this is the schematic. i don't understand, mine is mplab IDE v8.90. I'm using pic16f877a and 20Mhz, so which 1 is better for me?1:256?or 1:1? or 1:4? and,is that 2 timer necessary?u mean use another timer to create pulse signal but not continuous signal?
and, the code you provided, is without initial the pwm, is that need to be activate? if yes, use timer 1 or 2 is better than 0? i don't know,please explain...
and also the code you attached under interrupt having

PORTBbits.RB0 = ~PORTBbits.RB0;

what is this mean?

these are the seperate schematic for sensor and apr9600. for the apr9600, do i need to connect the pin 1-9(except 8) to ground if i manually recording(not connected to mcu yet)?
 

Attachments

  • sensor part with transistor.png
    22.1 KB · Views: 65
  • may30-apr.png
    22 KB · Views: 69
Last edited:

about R2:
Supposing the PIC is outputting a TTL (5V) high level and a maximum current of 25mA. Also, consider a transistor that has an hfe (also called Beta) of 10.
The current on the Collector pin of the transistor, which will be the same in the IR diode, can be calculated like this:
Ic = Ib * hfe
So, to get 70mA of current on the IR diode you can find out how much current you have to give on the base:
Ib = Ic/hfe = 0.070/10 = 0.0035 A = 7mA
So now you know that on transistor's base the current must be 7mA, and you must obtain it by calculating the proper R2 resistor, using Ohm's law: V=R*I.
You know V which is the TTL output of the PIC, 5V, and you know I which is 7mA. So now you can calcualte R2:
R = V/I = 5/0.007 = 714,28 Ohm
The nearest standard resistor value is either 680 Ohm or 820 Ohm. Obviously, this is only an example with the specifications given before, but you'll have to calculate the same using the proper values of the components you'll be choosing.

about PORTBbits.RB0 = ~PORTBbits.RB0;
This instruction inverts (negates) the value of the RB0 pin. If it is 1 then it'll become 0, and if its 0 it'll become 1.

EDIT
still about R2:
Basically, for your task, *any* transistor is good. Even if you calculate the Ic for say 500mA or more, the R1 resistor will be limiting the current that can flow through the IR diode; so even if the transistor allows more current to flow through, only the current calculated with the R1 resistor will be flowing. You only have to make sure you don't directly connect the transistor base to the PIC output, a current limiting resistor (R2) has to be put anyway. With the calculations above only make sure the Ic is not going below the one you need (70mA or whatever else).
 
Last edited:

ok thanks!

and for the coding part,do i need any pwm?or just follow the code jayanth provided in thread 8?that code will do?i thought need to configure ccp1con,tr2 and so on...

and please see on this datasheet of receiver, on page 1, for the IR emitter it connected with 1 AND gate to the base,what is the AND gate for?

why need to invert the port b?can i just give RB0 =1 ? no need invert? what is the purpose of invert?
 
Last edited:

The code should be fine, the output is on RB0.

The logic gate is the same as the transistor circuit provided above. The logic gate ICs are made so they can provide some more current than micro controllers, which makes them suitable for current consuming tasks. The circuit in the datasheet is totally replaceable with the one I provided.

The purpose on inverting the port instead of manually setting the value is that it can easily be done with fewer instructions. To achieve the same result "manually" you'd have to use an if like this:
Code:
if (RB0 == 0)
   RB0 = 1;
else
   RB0 = 0;
 

ok,so after do this,i need to create a delay to make a pulse signal,how much time of delay is needed?13us on and 13us off?
 

No need to create any delay, the timer interrupt will provide the proper delay between pulses.
 




if i connected like this,i will get 5v on my emitter which the operating voltage is only 1.6v, how to reduce???
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…