Using optocoupler in a project.

Discussion in 'The Projects Forum' started by gizmoe, Jul 3, 2016.

  1. gizmoe

    Thread Starter New Member

    Jul 2, 2016
    5
    0
    I would like to Thank All About Circuits for its existence and also apologize for my lack of knowledge and questions that I bear on everyone. My background is mainly with windows application development and automation. Ever since I discovered the microcontroller I have found myself learning more and more every day and the desire for a project. I finally found that project!...it will be used in an automotive application.

    The application consist of having three +12 volt inputs from the car, these inputs will also be the main source of power. On every input the LM2671 will power, supplying +5 volts. The +12 volt will drive an opto to supply power to the microcontroller (using an opto to allow quick discharge of the power to the microcontroller for cycle purposes) and the microcontroller input. Port-B will be use to drive LED’s.

    I have tested this circuit and it seems to work…I just want to see what anyone’s thought is on it. Is this even the correct way to do this, is there a better or more efficient way of accomplishing this?

    Any help will be greatly appreciated.
     
  2. TheButtonThief

    Active Member

    Feb 26, 2011
    219
    38
    I think you've over-complicated it.

    What values are resistors 5-7?
     
  3. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,571
    2,381
    Opto isolator coupling used, but then bypassed?
    5v zeners and a small resistor instead maybe?
    Max.
     
    Last edited: Jul 5, 2016
  4. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,546
    1,252
    If the only thing the switcher is powering is the PIC, then you probably can get away with a linear regulator with less complexity and noise.
    Since the 12 V inputs are common grounded with the opto output circuits (the PIC), there is no big reason for the optos. A resistor and zener diode on each line will level-shift the signals and protect the PIC.
    Depending on the PIC current, running its power through a small signal optocoupler might not be reliable long-term.

    ak
     
    gizmoe likes this.
  5. gizmoe

    Thread Starter New Member

    Jul 2, 2016
    5
    0
    Thanks for the feedback…ultimately this is going to drive a 7 x 7 dot matrix (2.1 Vf @ 30 ma each). I attempted to use a LM7805 but it was getting too hot, hence the use of the buck. The only problem I run into with the buck is when cycling power repeatedly the PIC hangs, I could only assume that it was being caused by the power supply not discharging. If I would wait a few seconds between power ups things would start ok.

    I have attached the circuit with the decade counter and the darlington transistor depicted.

    What values are resistors 5-7? – They are 10k.
     
  6. gizmoe

    Thread Starter New Member

    Jul 2, 2016
    5
    0
    Thanks for the feedback…ultimately this is going to drive a 7 x 7 dot matrix (2.1 Vf @ 30 ma each). I attempted to use a LM7805 but it was getting too hot, hence the use of the buck. The only problem I ran into with the buck was when cycling power repeatedly (1 sec. cycle) the PIC hangs, I could only assume that it was being caused by the power supply not discharging. If I would wait a few seconds between power ups things would start ok.

    I have attached the circuit with the decade counter and the darlington transistor depicted.

    What values are resistors 5-7? – They are 10k.
     
  7. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,571
    2,381
    Have you considered the zeners?
    Also why not use a single line LCD display, you did not state how many digits, but you have the opportunity to use spare characters for a fixed label/msge, etc.
    Also BTW there is a compact display that is 7 segment in nature but all in one, Varitronics VIM-332-DP
    http://html.alldatasheet.com/html-pdf/493860/VARITRONIX/VIM-332/600/1/VIM-332.html
    Max.
     
    Last edited: Jul 5, 2016
  8. Sensacell

    Well-Known Member

    Jun 19, 2012
    1,134
    268
    Opto-couplers are not necessary here, they are needed when you must have isolation.

    Since the input and output sections are tied together, there is no isolation in your circuit.
    Just replace them with a resistor voltage divider of high value to drop the voltage to be compatible with the digital input.
    Use a high resistance to protect the input from over voltage, the chip input has clamp diodes already, just need to limit the current.
    A small capacitor on the chip input can help slow the response down if you need to avoid multiple edges being detected.

    The first opto that switches Vdd is redundant, the chip is off anyway with no input.
     
    Last edited: Jul 6, 2016
    TheButtonThief likes this.
  9. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,546
    1,252
    My guess is that the 7x7 LED matrix is a single square of LEDs, not a multi-character display. If so, the PIC is sourcing all of the LED current which limits the peak value and hence the brightness. Also, that increases the current through V04.1, probably to a level that reduces reliability.

    ak
     
  10. gizmoe

    Thread Starter New Member

    Jul 2, 2016
    5
    0
    This is true...

    Thanks for the feedback. Time to take it back to the drawing board!
     
  11. gizmoe

    Thread Starter New Member

    Jul 2, 2016
    5
    0
    ...is this more of an overkill with what I started with???
     
  12. Sensacell

    Well-Known Member

    Jun 19, 2012
    1,134
    268
    You seem to love parts- lots of parts!

    You could eliminate many of those parts an achieve a better circuit.

    1) Ditch all the zeners- not needed.
    2) Run the PIC from the regulated +5- it won't crash if you run it from a clean Vdd.
    You also need a 0.1uf bypass capacitor on the PIC Vdd too- mandatory.
    3) Darlington's are slow and have a high saturation voltage, regular bipolar transistors will work better here, you don't need the gain.
    Just use a single PNP for the high side, with a single base resistor.
    4) What is the purpose of the emitter resistors on Q1-7? Are you trying to make a current sink?
    If you are limiting the LED current with resistors, (not shown in your schematic) the low side switch could also
    just be an NPN with a single base resistor.
     
Loading...