[SOLVED] sending serial data via optocoupler

Status
Not open for further replies.

kookooli

Junior Member level 3
Joined
Jul 10, 2014
Messages
30
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Visit site
Activity points
235
Hi,
I'm trying to send serial data from one micro to another mirco via optocoupler.
my sending speed is 9600bit/sec.
i'm using H11L1 optocoupler.it's speed is 1Mhz(from datasheet)..
but it doesnt work .
Can anyone help me ?
 

Could you post a schematic or any detailed specification about the circuit?
 

Hi!
Try a parallel resistor on the optocoupler led. This will help discharging led capacity and speeding up the falling edge of signal.
 

Hi!
Try a parallel resistor on the optocoupler led. This will help discharging led capacity and speeding up the falling edge of signal.
Unuseful. Should work without any resistors. Don't forget that output is an open collector type. Thats's all for this moment. No schematic = no solution.
 

It works for me.
 

Attachments

  • opto transmission.rar
    78.3 KB · Views: 178
  • opto transmission.png
    49 KB · Views: 526
Sorry! I'm not kidding. In my circuit I used 3m long wires and this solution worked for me.
 

@Easyrider

Opto inverts the UART data hence the NOT gate. Show your circuit. I tried as you said but no data was displayed on VT.
 

You kidding too? VCC -> 220Ohm (should be 330) -> LED-A -> LED-C -> PC6.
Well, it is very funny with all of you here, but I have no time for such discus.
 
@Easyrider

No, I was not kidding. You are right. It works. I had made a mistake. I had connected opto cathode to Rx line instead of Tx line.

But what is the use of using opto on UART ?
 

Attachments

  • opto transmission.png
    36.8 KB · Views: 364
In your case it is useless too. Optocouple giving you a possibility to isolate mcu from terminal or other mcu. You will be able to use different power sources with independend grounds. How to you possitioning yourself as a h/w designer if you don't understand such basic things?
 
@Easyrider

You are brilliant. I never thought that 5V MCU can be interfaced to another 3.3V MCU using opto isolator. I have to find SMD versions of opto's so that I can easily interface 5V device to 3.3V device like interfacing PIC to SIM900.
 

Optocouple giving you a possibility to isolate mcu from terminal or other mcu. You will be able to use different power sources with independend grounds.
I never thought that 5V MCU can be interfaced to another 3.3V MCU using opto isolator.
The emphasis is on "isolation" and "independend grounds". Neither condition applies with a simple mixed 3.3V/5V supply system. That's why Easyrider83 designated it a useless optocoupler application.

I must confess that I have seen a number of useless optocoupler circuits in industrial products, cases where e.g. a simple BJT could have replaced the optocoupler. I never figured out if the designer didn't know that the optocoupler was superfluous or if the circuit had been previously designed with isolation and the optocoupler was kept out of easiness.

The problem in the original post might involve isolation, but we don't know. We are yet missing a schematic.
 
I think using opto is good when isolation is not important but voltage level translation is required. Instead of using two BJT for voltage level translation, opto in smd package will be cheaper ? Have to try with PIC + SIM900 circuits.
 

You'll find the answer in the discussion above. Wrong signal polarity.

By the way. Connecting both sides of the optocoupler to same ground, are you presenting one of those useless optocoupler circuits mentioned by Easyrdider83?
 

See datasheet of opto. If Opto input diode needs 1.6V and 30mA then (5V - 1.6V) / 30 mA = 113E. Power dessipated in resistor = P = VI = IIR = (5 - 1.6) * 30 mA = 102 mW. You can use 1/4W.
 

You'll find the answer in the discussion above. Wrong signal polarity.

By the way. Connecting both sides of the optocoupler to same ground, are you presenting one of those useless optocoupler circuits mentioned by Easyrdider83?

what do you mean by wrong signal polarity ?
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…