1. 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.
    Dismiss Notice

Hello....

Discussion in 'Microcontrollers' started by just angel, Apr 26, 2003.

  1. just angel

    just angel New Member

    Joined:
    Apr 26, 2003
    Messages:
    7
    Likes:
    0
    Location:
    -----------------
    Good afternoon everybody... How are you all?

    I have a question... so if anyone can answer it I will be so grateful.. (I am an electrical Engineering Student)

    I am working on a project that needs the use of a microcontroller..

    I chose PIC 16F877, and the program language is assembly...

    in my project I have some relays that needs to controlled with the MC..

    can anyone give hint about how to write the program which will do that.. :oops:

    Thanks alot... :)
     
  2. kinjalgp

    kinjalgp Active Member

    Joined:
    Oct 28, 2002
    Messages:
    1,851
    Likes:
    3
    Location:
    INDIA/USA
    Ths depends on what ondition you want to drive the relays. If you simply want to turn them on with PIC, just make the port pins at logic 1. The relay should be connected in cllector loop of any medium power NPN transistor (like BC547) and its base should be connected to port pin of PIC through 4.7k resistor.
     
  3. just angel

    just angel New Member

    Joined:
    Apr 26, 2003
    Messages:
    7
    Likes:
    0
    Location:
    -----------------
    Thanks alot...kinjalgp :p

    But I know all of these...

    My question was about the program that should I write...

    oh.. yes .. I will change the program language to BASICpro.

    so ... can anyone provide with some hint...

    this is the first time I am dealing with microcontrollers :shock: ..
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Chippie

    Chippie New Member

    Joined:
    Mar 8, 2003
    Messages:
    991
    Likes:
    9
    Location:
    Good 'ole England

    the program for the pic is structured on what you want to happen....

    what instructs the pic to operate a relay?
    what instructs the pic to operate all the relays?

    these are just examples...

    a little more information would help......
     
  6. pebe

    pebe Member

    Joined:
    Sep 24, 2002
    Messages:
    354
    Likes:
    1
    Location:
    Ellon - Scotland
    Re. chngibg to Basicpro. Stay with assembly. In may be a bit more difficult to start with. But once you have learned the instruction set, you will find it easy.

    Assembly usually gives a more compact code than basic.
     
  7. just angel

    just angel New Member

    Joined:
    Apr 26, 2003
    Messages:
    7
    Likes:
    0
    Location:
    -----------------
    Hello everybody

    O.K ... my project is about measuring the beta of the transistor..

    first of all the program should identify the type of the transistor (PNP or NPN) okay..

    so when i put the BJT on its place in the circuit the microcontroller should change the polarity of the input voltage...according to the type of the BJT..
     
  8. just angel

    just angel New Member

    Joined:
    Apr 26, 2003
    Messages:
    7
    Likes:
    0
    Location:
    -----------------
    Hi...

    Why no one is answering my question.... :cry:

    I will really appreciate any answer...

    Thanks alot...
     
  9. kinjalgp

    kinjalgp Active Member

    Joined:
    Oct 28, 2002
    Messages:
    1,851
    Likes:
    3
    Location:
    INDIA/USA
    This is what you can try for testing whether the transistor is NPN or PNP
    1) Apply 5V to collector through a 10k Resistor
    2) Apply 5V to base through 10k resistor
    3) Ground the Emitter
    4) Check voltage at collector
    5) If it is 0 (in digital sense) then make base voltage 0.
    6) Now again check for collector voltage. If it is 5V (or high) then the transistor is NPN
    OR
    7) Ground collector through a 10k Resistor
    8) Apply 0V to base through 10k resistor
    9) Connect Emitter to 5V
    10) Check voltage at collector
    11) If it is at ~5V then make base voltage = 5V.
    12) Now again check for collector voltage. If it is 0V (or high) then the transistor is PNP
     

    Attached Files:

  10. just angel

    just angel New Member

    Joined:
    Apr 26, 2003
    Messages:
    7
    Likes:
    0
    Location:
    -----------------
    Thank alot...kinjalgp...

    Yuor explanation is very good...

    but.. can you provide me some help on how to write the program that will do that... using the PIC BASIC with PIC 16F877...

    :roll:
     

Share This Page