help with project

Discussion in 'The Projects Forum' started by tjstudy, Mar 14, 2009.

  1. tjstudy

    Thread Starter New Member

    Mar 14, 2009
    5
    0
    hi,we r doing the automatic room light controller with visitor counter using at89s52..i have enclosed the circuit for receiver,transmitter..i have also enclosed the code..but when the program is dumped in the controller and executed the display is random..also there is no decrement taking place..please point out the mistake in our code..thanks
     
  2. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    I haven't seen the code yet but first you have to correct your circuit.

    You are using a single 330 ohm resistor to limit the current for the whole display. This is wrong, you have to put one resistor for each display segment. Also, if the displays are common anode you will need a PNP transistor and not a NPN as shown.
     
  3. tjstudy

    Thread Starter New Member

    Mar 14, 2009
    5
    0
    sir,

    we have rigged up the whole hardware part of the circuit and tested the seven segment display by providing a negative voltage to each of the segments..it worked well so we reckoned there was no problem with the hardware part of project..anyway we will test it with the changes you have suggested.could you also take a look at the code and give your comments..thank you for the help sir.
     
  4. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    If the code was in C I would be glad to help. :p

    Also, a PIC does not output a negative voltage. I think it worked because you were testing each segment independently.
     
  5. tjstudy

    Thread Starter New Member

    Mar 14, 2009
    5
    0
    yes sir we were testing the segments independently..but may i ask you what would be the result of the above connection in case the code were to be correct..i mean should the segments not glow at all if we use an npn transistor??
     
  6. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    One would glow for sure, bright or a fade depending on the display and transistor characteristics.
     
  7. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Just to clarify what Mik3's saying, the resistors need to go between the Atmel's I/O pins (33 through 39) and the cathodes of the 7-segment displays. Only one resistor per I/O pin is necessary since you are multiplexing the displays.

    R5 and R9 need to be removed; Q2 & Q3 need to be replaced with PNP transistors, emitters connected to +5v.

    It won't work properly as you have it connected now. You might see something, but it would look garbled.

    Also, you need a reverse-EMF diode across the coil of the relay K1; without it you will get a very large reverse polarity voltage spike that may destroy Q1.
     
  8. tjstudy

    Thread Starter New Member

    Mar 14, 2009
    5
    0
    well that is what is actually happening so i guess that is the problem..we will do the above said changes and try out the circuit.i thank both of you for the help sir.will get back to tell you the result.
     
  9. tjstudy

    Thread Starter New Member

    Mar 14, 2009
    5
    0
    sir,

    we have changed the circuit as you said..adding a pnp resistor..the display has improved a bit but we still hae a problem..that is the numbers are getting incremented..but not by 1..it is showing 11,41,72 and so on..the same with decrement..could it be the fault in the code only??
     
  10. vyas.rahul9

    New Member

    Apr 14, 2009
    1
    0
    hiiiiiiiiiiii............
    my friend,

    i am working with the same projecttt as you...........
    can any one send me the working of transmitter & receiver section of aUTomatic room light controller with visitor counter...........
     
  11. emu8051

    New Member

    Jul 9, 2009
    1
    0
    hi, well its ok I may help you in this
     
  12. brinznick

    New Member

    Nov 5, 2009
    1
    0
    Wat is the transistor can be used to replace the cl 100?
     
Loading...