CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Electronics > General Electronics Discussion


General Electronics Discussion Discuss basic electronics, power supplies and anything else electronic related here.


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 08-17-2009, 04:02 PM
 
Join Date: Aug 2009
Location: England
Posts: 17
deanbayley is on a distinguished road
Switching Relay From Optocoupler Output

Hi Guys,

If you look at the attached schematic the blue box represents the driver board...

The rest of the circuit is what i've come up with, please could someone with a better electronics knowledge tell me if it'll work?

D.
Attached Thumbnails
Click image for larger version

Name:	schematic2.jpg‎
Views:	219
Size:	34.6 KB
ID:	86812  
Reply With Quote

  #2  
Old 08-17-2009, 04:31 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,539
Al_The_Man is on a distinguished road
Buy me a Beer?

It looks like that would work, I notice you have not used the isolation the Opto brings, but if you are using the PC 5v and 12v then it does not really matter.
I tend to use the 2N7000 for most interfacing, it does not require any current to operate like the 2N3906, et.al
Al.
__________________
CNC, Mechatronics Integration and Machine Design.
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
Reply With Quote

  #3   Ban this user!
Old 08-17-2009, 05:24 PM
 
Join Date: Aug 2009
Location: England
Posts: 17
deanbayley is on a distinguished road

Hi Al,

The 5v source is regulated from the 24v used to power the controller and the 12v source will be the same...

There is no electronic link between the parallel port and the controller...
Reply With Quote

  #4  
Old 08-17-2009, 05:40 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,539
Al_The_Man is on a distinguished road
Buy me a Beer?

If you have 24vdc, I would have tended to use that throughout, 24vdc relay etc.
Also I would suspect you can eliminate R3 completely and it should still work OK.
You did not say what control system you are using.
Al.
__________________
CNC, Mechatronics Integration and Machine Design.
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
Reply With Quote

  #5   Ban this user!
Old 08-17-2009, 05:51 PM
 
Join Date: Aug 2009
Location: England
Posts: 17
deanbayley is on a distinguished road

Hi Al,

R3 is inside my controller, the controller was included with my desktop cnc machine, controlled by Mach3, I need to operate some existing relays / solenoid valves and they are all 12v...

Please could you describe how i would connect the 2N7000?

D.
Reply With Quote

Sponsored Links
  #6  
Old 08-17-2009, 06:10 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,539
Al_The_Man is on a distinguished road
Buy me a Beer?

You could connect pin 4 of the opto to 5v+, pin 3 of the Opto to a 1k resistor, the other end of which is connected to common.
Opto pin 3 also to the gate of the 2n7000.
2N7000 source pin to common. Drain pin to the 12v or 24v relay.
Al.
__________________
CNC, Mechatronics Integration and Machine Design.
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
Reply With Quote

  #7   Ban this user!
Old 08-17-2009, 06:26 PM
 
Join Date: Aug 2009
Location: England
Posts: 17
deanbayley is on a distinguished road

Hi Al,

The reason i put the blue box around the original schematic was to show the components i have no control over..

Most of the parts are SMD and i don't really want to start altering the board, If the opto had been wired to source rather than sink i would've connected it to a ULN2003, it has the protection diodes built in and can sink 500ma..

Can the 2N7000 be driven from a sink?

D.
Reply With Quote

  #8  
Old 08-17-2009, 06:51 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,539
Al_The_Man is on a distinguished road
Buy me a Beer?

Yes, the sink configuration you have would also work with a 2N7000, it is just the logic would be opposite, you could change that with the relay contacts if necessary (N.C or N.O).
That was the reason I changed the Opto to a source device.
Th 2N7000 is a voltage operated device rather than current, 0 to 5v, with I believe a switching voltage of around 3.5v on.
Al.
__________________
CNC, Mechatronics Integration and Machine Design.
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
Reply With Quote

  #9  
Old 08-17-2009, 07:58 PM
Gold Member
 
Join Date: Mar 2003
Location: United States
Posts: 2,717
Mariss Freimanis is on a distinguished road

Your circuit cannot work because the opto collector load 1K goes to +5VDC while the emitter of your PNP goes to 12VDC. When the opto is off, current flows from the PNP base, through the 10K and to your 5VDC supply through the 1K. The 3906 can never turn off.

How to fix it:

1) Change the opto collector 1K to 10K and take it to 12VDC instead of 5VDC.

2) Use an NPN (3904). Emitter to GND, Base to opto collector and 3904 Collector to relay coil connected as a pull-up load to 12VDC.

Option (2) uses the fewest parts: 1K pull-up and an NPN transistor. Option (1) requires a resistor change (10K instead of 1K) and moving the resistor end to 12VDC instead of 5VDC.

If you use option (1), the 100K resistor does nothing useful because it's too large. Change it to 10K.

Mariss
Reply With Quote

  #10   Ban this user!
Old 08-17-2009, 10:15 PM
 
Join Date: Aug 2009
Location: England
Posts: 17
deanbayley is on a distinguished road

Option 2 it is:

Like that?

I don't see how that can work, I thought NPN's we positively switched?

Or is this pulled high by the 1K all the time until pulled low? (which is fine, and i would never have thought to do..)

It would actually make sense because there is a NOT gate before the opto...

D.
Attached Thumbnails
Click image for larger version

Name:	schematic3.jpg‎
Views:	114
Size:	30.5 KB
ID:	86838  
Reply With Quote

Sponsored Links
  #11  
Old 08-17-2009, 10:23 PM
Gold Member
 
Join Date: Mar 2003
Location: United States
Posts: 2,717
Mariss Freimanis is on a distinguished road

Lose the superfluous 1K to 5VDC and you have it. How it works:

No opto LED current means no opto collector current. All the current flowing through the 10K goes into the base of the 3904 and turns it on.

Opto LED current causes the opto collector to shunt the 10K current to GND. The opto collector drops below 0.7V which turns the 3904 off.

---------------------------

If you want the relay coil off when there is no opto LED current:

Take the opto collector to 12V. Place a 10K from opto emitter to 3904 base. Use another 10K from 3904 base to GND. Keep the rest of the circuit as is.

Mariss
Reply With Quote

  #12   Ban this user!
Old 08-17-2009, 10:31 PM
 
Join Date: Aug 2009
Location: England
Posts: 17
deanbayley is on a distinguished road

Is there no other way around getting rid of the 1K?

It is a 0805 on the controller board, and i need this circuit 3 times which means removing 3 resistors from a brand new controller thus invalidating the warranty..

Thanks to everyone for all the help btw!

D.
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VFD switching a relay and kickback voltage z28tt Phase Converters and VFD 5 12-05-2008 06:26 PM
Any plans for optocoupler circuit for parallel port? mbwittig CNC Wood Router Project Log 3 01-31-2007 06:09 AM
Pwm switching miro Gecko Drives 0 01-23-2007 03:22 PM
Need Datasheet NEC PS2510-4 Optocoupler CJL5585 General Electronics Discussion 6 12-07-2006 05:55 PM
optocoupler; opto-isolater dhprc2 General Electronics Discussion 1 06-02-2003 12:19 PM




All times are GMT -5. The time now is 04:50 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361