Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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
    sensor part with transistor.png
    22.1 KB · Views: 48
  • may30-apr.png
    may30-apr.png
    22 KB · Views: 45
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.
 

For the voltage on the IR diode you only need to calculate the proper R1 resistor:
Vm= main spupply voltage = 5V
Vd = Voltage on diode = 1.6V
Ad = current on diode = 50mA = 0.050A

R1 = (Vm - Vd)/Ad = (5 - 1.6)/0.050 = 68 Ohm

Yes, the problem of the IR sensor is because the PIC may drive components up to only a few mA, 25mA on most PICs. Your IR diode is rated 100mA so at half of that current should be given for it to work nicely. At 25mA it would merely start lighting. With a transistor you can increase the current as much as you need.

For series and parallel, i though you at least knew what they are and how to do it.. if not please search the elementary questions forum, I'm sure there is something about it.

Yes, putting the pin low or high means (respectively) GND or 0V, and 5V (TTL level) or 3.3V (MOS level). In your case, GND and 5V.



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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top