Phone line controller v2 - 6 releja

Rasprava o PIC mikrokontrolerima, PIC projekti i drugo vezano za PIC-eve...

Moderators: pedja089, stojke369, [eDo], trax

masoud
Pocetnik na forumu
Pocetnik na forumu
Posts: 28
Joined: 13-02-2009, 22:12

Re: Phone line controller v2 - 6 releja

Post by masoud »

common Crystal for mt8870 and PIC ?!?
in the circuit there is no crystal for the PIC!
only there is a connection between crystal and pin9 of PIC.

the relay is ok. i checked it by 9v.
the LED was ok! flashed and went off! it burnt! i should replace it.

i put all available pi*s from my board!
because of high resolution, i couldn't put IMG codes. please wait to load...
some points:
1-it's a beginner made! please don't scorn it!
2-it has no switch, i used a piece of wire in the back.
3-if you want, i'll put the pcb file( in .LAY format)
board:
http://i39.tinypic.com/ta57ar.jpg" onclick="window.open(this.href);return false;
pcb:
http://i40.tinypic.com/2ep0m07.jpg" onclick="window.open(this.href);return false;
designed pcb:
http://i43.tinypic.com/2hgb8f8.jpg" onclick="window.open(this.href);return false;
User avatar
pedja089
Administrator sajta
Administrator sajta
Posts: 7876
Joined: 20-02-2007, 14:50
Location: Beočin -Srbija

Re: Phone line controller v2 - 6 releja

Post by pedja089 »

check you power supply. you shud have 5V between pin 19 and pin 20 on pic.
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3509
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Phone line controller v2 - 6 releja

Post by trax »

It looks OK. But, I really don't like the wire connection between crystal and the PIC. Because of that, it might not oscillate at all (the PIC might not work properly).
If your LED didn't blink when you supplied the board with power, than the PIC is really not working.
Give us a screen-shot of your PIC programmer if you can, so we can see what options you checked during programming, because maybe you still didn't program it properly.
So, the only problem you need to solve is to get the PIC working.
masoud
Pocetnik na forumu
Pocetnik na forumu
Posts: 28
Joined: 13-02-2009, 22:12

Re: Phone line controller v2 - 6 releja

Post by masoud »

TANX ALOT FOR ANSWERS!

you first said the PIC should have a crystal. and now say the wire which connects crystal to pin9 PIC is the cause of problem. :!: i mixed up! ... :| so what should i do?

do you mean that i disconnect this wire? so pin9 of PIC will be alone!
i attached them by 2 seri jumpers, (they are ditinct in board picture, two jumpers under the MT8870) so i can delete it, ...otherwise i should scratch pcb line!!

disconnecting :idea: ...! i'll send result...%
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3509
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Phone line controller v2 - 6 releja

Post by trax »

No, I am not saying you should disconnect it, I am saying that I don't like the way you connected it: with a jumpers. If you disconnect it, it really is not going to work :)
So, try replacing crystal, maybe it is not working.
masoud
Pocetnik na forumu
Pocetnik na forumu
Posts: 28
Joined: 13-02-2009, 22:12

Re: Phone line controller v2 - 6 releja

Post by masoud »

bad bad LED! GOD damn it!

when i was detaching it, snaged to pcb cuprous line and rend it.... :cry: :cry:

.... so bad! however, i replaced another healthy LED,(i checked before).
i connected a direct short wire between crystal and pin9 PIC.
i replaced an New crystal.

now, by switching power supply, the LED goes ON after Some Seconds. it goes OFF after some time. on and off unregularly! when goes OFF, i press the Optocoupler and it lights again.(Not blinking)
but, when i ring it, as same as before, no event, no relay action, no thing....
the only diffrence with before is that i have a lighting LED... :? ???

what's your idea? may i check connections again? how? i can check soldering connections by a tester, but how to check Caps, VDR, Trans ad more...?

[may i'll be busy for 2weeks, and can't post again... excuse me, but reply me! :wink: TANX ]
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3509
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Phone line controller v2 - 6 releja

Post by trax »

First, remove the VDR, who knows if it is working at all.

Secondly - great, the PIC works. The LED should blink just once when power-up. It will blink again only when RING is detected (when the phone rings). So, give it a call and it should work (if your optocoupler part with zeners work).

If the PIC blinks LED irregularly than it is re-setting itself for some reason. Did you put the right resistor-value to it's MCLR pin? 10kOhms, right?

Triple check everything again :)
masoud
Pocetnik na forumu
Pocetnik na forumu
Posts: 28
Joined: 13-02-2009, 22:12

Re: Phone line controller v2 - 6 releja

Post by masoud »

1-how can i test VDR? it's 450V! what's the sign of a healthy VDR?

2-YES!! it works! the LED goes on just power on.
i have 4 optocouplers! i'll test it with all of them. i wish it works! i changed zeners to 51v before, according to your advice.

3-re-setting?! why? yes, there is a 10Kohms(1/4w) Res between MCLR(pin1) and Vcc(5v).

ooooooohhh! so tired of checking, checking and checking.... :(
User avatar
Smjesko
Stariji član
Stariji član
Posts: 4012
Joined: 26-12-2005, 17:12

Re: Phone line controller v2 - 6 releja

Post by Smjesko »

@masoud, living a life of an electronics technician is not easy - you have to get used to it :!: :D
masoud
Pocetnik na forumu
Pocetnik na forumu
Posts: 28
Joined: 13-02-2009, 22:12

Re: Phone line controller v2 - 6 releja

Post by masoud »

Smjesko! I know! electronics living is hard, but electronics troubleshooting is harder!!! :D
User avatar
Feko
Stariji član
Stariji član
Posts: 4394
Joined: 23-07-2008, 06:18
Location: Hrvatska, Slavonija, Selo moje malo...

Re: Phone line controller v2 - 6 releja

Post by Feko »

Once you become versed in electronics, you will be able to easily pinpoint the fault, but you can't acquire knowledge and experience overnight :wink:
masoud
Pocetnik na forumu
Pocetnik na forumu
Posts: 28
Joined: 13-02-2009, 22:12

Re: Phone line controller v2 - 6 releja

Post by masoud »

Hi again!

i changed optocoupler with another one (and another brand!).
when power goes ON, the LED blinks for about 2 seconds.
then,
wen I called that line, the LED lights. by every ring, it goes OFF and ON! But some irregular blinks happen, which doesn't match ring series?!?!

I measured the input pins of the Relay, when the LED lights, it goes up to 5v, which isn't enough to active relay...!?
how many rings it Needs, to hang up the phone? what is default?
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3509
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Phone line controller v2 - 6 releja

Post by trax »

Great, it all works. Don't worry if the LED doesn't match the ring on your phone.

Default: 2 rings
Default password: 1234

I know it doesn't work, you used 12V DC relay, instead of 5V DC relay. You can see in my picture what relay I used, and what relay you used...
Attachments
PB050005.JPG
Phone line controller v2 picture
(780 KiB) Downloaded 28 times
masoud
Pocetnik na forumu
Pocetnik na forumu
Posts: 28
Joined: 13-02-2009, 22:12

Re: Phone line controller v2 - 6 releja

Post by masoud »

YES!!

You are right. i'm so crazy! i saw 5-s on relay and the +5 vcc connected to relay in schematic, but i bought a 12v one!
i should change it. but i have no access to electric shop until 4 next days.. :( because of my classes...

DEAR TRAX, YOU MADE ME MANY BIG HELPS. BEFORE, I THOUGHT THAT I HAVE NO SUPPORT IN MAKING AND TROUBLESHOOTING :oops: ... BUT, NOW, I BELIEVE THAT YOU ARE A REAL SPONSOR AND FRIEND. :D :P 8)
TANX ALOT
masoud
Pocetnik na forumu
Pocetnik na forumu
Posts: 28
Joined: 13-02-2009, 22:12

Re: Phone line controller v2 - 6 releja

Post by masoud »

IT'S WORKING!!!! :D :D :D

I found a 5v relay in my components box. replaced it with 12v one.
then i called the line!
it was WORKING!
after two rings, the relay hang up!
i heared beep!
entered 1234... and then beep...1...beep...beep.beep.beep.....!!!!
they were my life most exciting beeps!! :D

but still there is a problem. the second relay ( which is on the control and sense unit) does not act. however i hear beeps (2 and 3 for On or Off). but that relay has no action...

the 'BE' voltage was 5.5v, same as the datasheet. which voltages (of BC547 or PIC outputs) i should measure? should go to saturation?
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3509
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Phone line controller v2 - 6 releja

Post by trax »

Great to hear it works :D

Well, did you connect the relay properly to BC546/7 transistor? Did you really? :P

Instead of relay and transistor circuit, you can put LED after 4k7 resistors (the other end of LED should be connected to GND, and disconnect the BASE of transistor. That way you can test every "relay bank".

By the way, use this new HEX for the PIC:
Attachments
new_hex_phonelinectrl_v2.zip
New hex for PhoneLine Controller v2. No major modifications.
(1.77 KiB) Downloaded 210 times
masoud
Pocetnik na forumu
Pocetnik na forumu
Posts: 28
Joined: 13-02-2009, 22:12

Re: Phone line controller v2 - 6 releja

Post by masoud »

i have BC547 datasheet.

PIC pin> 4.7k RES> 'Base'
All Emitter are GND.
Collectors> Relay input pin (the other pin is 12v)

the BE voltage is 5.5v. if i replace a LED, it would be light forever!??!

what's the diffrence between this new .hex file and the last file?
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3509
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Phone line controller v2 - 6 releja

Post by trax »

No difference in code, just in EEPROM section. You don't have to re-program it if you don't have the programmer.

Here is the schematics for testing relay outputs...

P.S. Try without 1N4001 (1N4007) diode that is in parallel with relay, maybe it's broken so your relay doesn't work...
Attachments
LED_instead_of_relay.png
led instead of relay for phone line controller
(33.71 KiB) Downloaded 17 times
masoud
Pocetnik na forumu
Pocetnik na forumu
Posts: 28
Joined: 13-02-2009, 22:12

Re: Phone line controller v2 - 6 releja

Post by masoud »

i did what you say by LED.

it acts right. by 0> OFF. and by 1> ON.
but the transistor and relay combination still is not working...

can i decrease the 4.7k Res to a lower one.?
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3509
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Phone line controller v2 - 6 releja

Post by trax »

You don't need to. It must work with 4k7 if your transistor and relay are OK :!:

You can experiment though :)
Post Reply