Using optocoupler in a project.

Thread Starter

gizmoe

Joined Jul 2, 2016
5
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.
 

Attachments

AnalogKid

Joined Aug 1, 2013
11,037
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
 

Thread Starter

gizmoe

Joined Jul 2, 2016
5
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.
 

Thread Starter

gizmoe

Joined Jul 2, 2016
5
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.
 

Attachments

MaxHeadRoom

Joined Jul 18, 2013
28,682
Last edited:

Sensacell

Joined Jun 19, 2012
3,442
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:

AnalogKid

Joined Aug 1, 2013
11,037
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
 

Thread Starter

gizmoe

Joined Jul 2, 2016
5
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
This is true...

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

Thread Starter

gizmoe

Joined Jul 2, 2016
5
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
...is this more of an overkill with what I started with???
 

Attachments

Sensacell

Joined Jun 19, 2012
3,442
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.
 
Top