makjee
Newbie level 6
Hello everyone, its my first post here. I have two separate issues in which I require your input, thanking you in advance. Low powered design is not a priority in this prototype.
1. I have a relay JQC-3F, 12V relay which has an internal resistance of 400 ohms at 12V meaning the drive current required to run the relay is 30mA. I selected a single 2N2222 which has a gain (hFE) of 75 at IC = 10mA and VCE = 10V and considering that I am passing 30mA from the collector I even selected hFE = 50 in calculating the base current which comes out to be 0.6mA. I connected the base of the 2N2222 using 330 Ohms resistor with 8051. Also I noticed that I was getting -1.75volts on the base when the 8051 was not inserted in the socket so I connected the base of 2N2222 with ground via another 330 Ohms resistor. Now the typical problem, if I dont have 8051 in the socket and manually give 5V using a jumper, the current consumption increases by 30mA and relay works. But as soon as I insert 8051 and program it to apply 5 volts to P1 (where 2N2222 is connected), the relay doesnt drive.
1a. What I dont understand is that if the absolute maximum rating for DC current for 8051 is 15mA and I am giving 7.5mA on one pin (5V/(330ohm+330ohm)) then why isnt a single relay being driven comfortably?
1b. Why must I resort to a darlington pair based transistor.
1c. Also please look at the schematic I provided and suggest if I can replace 2n2222 with a single package of transistor/darl. pair which will make me desoldering easy.
2. My second question is related to RS485. I am using SN75176 for receive and transmit, I am using two separate ICs (I want it that way). There is a master RS232-RS485 converter which sends the data to this slave (of which I have attached the schematic). The slaves turns the relays on and send ack back once feedback is achieved. The RS232-RS485 etc is working fine. The problem is... I have to have common ground for both master and slaves. In reality the master and slaves will be around 400 meters apart. I would like a local power supply for both master and slave without having to run the 400meter ground cable. So can you please advise as to how should I connect opto couplers to my RS485 cables to ensure battery/power isolation and complete working. (RS485 termination resistors will be changed to 100 ohms once I start testing on 400m cables ;-))
thank you and sorry for making you read the essay
View attachment rRLYDRV_RMT.pdf
1. I have a relay JQC-3F, 12V relay which has an internal resistance of 400 ohms at 12V meaning the drive current required to run the relay is 30mA. I selected a single 2N2222 which has a gain (hFE) of 75 at IC = 10mA and VCE = 10V and considering that I am passing 30mA from the collector I even selected hFE = 50 in calculating the base current which comes out to be 0.6mA. I connected the base of the 2N2222 using 330 Ohms resistor with 8051. Also I noticed that I was getting -1.75volts on the base when the 8051 was not inserted in the socket so I connected the base of 2N2222 with ground via another 330 Ohms resistor. Now the typical problem, if I dont have 8051 in the socket and manually give 5V using a jumper, the current consumption increases by 30mA and relay works. But as soon as I insert 8051 and program it to apply 5 volts to P1 (where 2N2222 is connected), the relay doesnt drive.
1a. What I dont understand is that if the absolute maximum rating for DC current for 8051 is 15mA and I am giving 7.5mA on one pin (5V/(330ohm+330ohm)) then why isnt a single relay being driven comfortably?
1b. Why must I resort to a darlington pair based transistor.
1c. Also please look at the schematic I provided and suggest if I can replace 2n2222 with a single package of transistor/darl. pair which will make me desoldering easy.
2. My second question is related to RS485. I am using SN75176 for receive and transmit, I am using two separate ICs (I want it that way). There is a master RS232-RS485 converter which sends the data to this slave (of which I have attached the schematic). The slaves turns the relays on and send ack back once feedback is achieved. The RS232-RS485 etc is working fine. The problem is... I have to have common ground for both master and slaves. In reality the master and slaves will be around 400 meters apart. I would like a local power supply for both master and slave without having to run the 400meter ground cable. So can you please advise as to how should I connect opto couplers to my RS485 cables to ensure battery/power isolation and complete working. (RS485 termination resistors will be changed to 100 ohms once I start testing on 400m cables ;-))
thank you and sorry for making you read the essay
View attachment rRLYDRV_RMT.pdf