Go Down

Topic: Interfacing with OPTO isolator TTL (Read 9028 times) previous topic - next topic

tiak

Hi

I hope someone can help me, this is a part from a post from the old forum, but i still need to get it working.

The problem is that i have to interface my Arduino UNO with a Heat energy meter, the meter has a interface where i won't to connect my arduino to,
but i can not get any response from the meter, so i think the problem is to "drive" the OPTO isolator.

So now i tried to connect my arduino to the Heat meter with a resistor but no result.

From Arduino                              Heat meter
       Pin0  <= 10kOhm resistor  <= Data Out "J1=7" from the interface.
       Pin1  => 10kOhm resistor  => Data Req "J1=6" to the interface.
       GND                                  GND

I got the schematic over the heat meter where i do the interfacing, but they told me with a TTL i have to put in a 1 k Ohm resistor and a 4,7 k Ohm pull up resistor.
So i did following.

But this did not work, i talk again with the company and they think that a pull op resistor on the TX from the arduino will help, but i don't not know what size and how to connect it.
So i hope someone have a idea or another way to get i working.

Jesper
Datasheet over the opto isolator http://pdfcast.org/pdf/1716003-sharp-pc357

shelleycat

So what does not work?
- the output from the Arduino?
-the input to the arduino.
If the output (from Arduino), change to a sketch (such as Blink)/output line where you are pulsing the opto-isolator slowly, then measure the current through the transistor.  If that does not show anything, change to supplying 5V though a 1K resistor to the transistor and measure the current in that case.  If that does not work, your opto-islolator may not be working.  If you can measure the current, is it enough to pull the input to your device up and down a full swing - is the resistor too small?
If the input, what is the spec for the output from your device?  Do the current measuring thing on the input side with +5 and 0V supplied.  How much current?  How much voltage swing are you getting on a slow signal?  Is that enough to pull the arduino input up and down.

In other words, try breaking the problem down into small, testable pieces.

drone

#2
Feb 05, 2011, 06:26 pm Last Edit: Feb 05, 2011, 08:20 pm by drone Reason: 1
Some obvious problems:

* Is the device using inverted TTL?  Why are you bringing RX low when the other side brings that pin high? (Hint: connect RX to the Emitter and +5V to the Collector, but keep your pull-up in place.  You will most likely need an appropriate current limiting resistor for the Collector on the OK.)
* Where is 1KOhm calculated for the TX resistor?  The max forward voltage of the led is 1.5V, the max forward current is 50mA, therefore: (5-1.5)/0.05 = 70 Ohms.  However, the arduino pins can only supply 40mA, so drop it down to 35 or so - (5-1.5)/0.035 = 100 Ohms.


!c


Grumpy_Mike

Quote
However, the arduino pins can only supply 40mA,


No. The arduino will get fried if you try to pull more than 40mA from it. It is very easy to do this.
You can pull several hundreds mA from the output pins as shown by my experiments:-
http://www.thebox.myzen.co.uk/Tutorial/LEDs.html

You should not take more than 30mA in any good design.

The 1K series resistor is too high, you should use something between 200 to 500 ohms.

drone


Quote
However, the arduino pins can only supply 40mA,


No. The arduino will get fried if you try to pull more than 40mA from it. It is very easy to do this.
...

You should not take more than 30mA in any good design.

The 1K series resistor is too high, you should use something between 200 to 500 ohms.


(I'll make sure to add the words "safely, briefly" next time I say that.)

To be in-spec with the data sheet (1.2-1.4V at 20mA), that should be closer to 200 than 500, otherwise you're still going to have issues.  At 500, you're getting close to the min CTR.

!c


tiak

#6
Feb 06, 2011, 08:01 am Last Edit: Feb 06, 2011, 08:38 am by Jesper Reason: 1
Hi

Tanks for all the recommendations.

shelleycat
Quote
- the output from the Arduino?

- the input to the arduino.

I don't know if it's the output or indput since i can't get any answer from the device.

Quote
your opto-islolator may not be working.


The opto-isolator is working just fine, i can use my computer with a special cable from the supplier to check the communication.
so im sure this is not the problem, and also sure my request code from the arduino to the meter is right.

I will do some testing as you recommended.  

Drone
Quote
Is the device using inverted TTL?


I'm not sure but i don't think so. If i use my computer to test the request to the meter i have to use a special cable.
Inside the DB9 connector for the pc there is a small PCB for level converting.

The converter connect also to the same interface with the opto-islolator as the arduino with only TX RX and GND, but off curse if i try with the arduino i remove the connection for the PC.
But for the question about inverted TTL i think maybe a schematic from this converter can help to get the answer about the inverted TTL.

Fig1 The schematic of the converter but this is only used if i use the computer to communicate with the meter.


Fig2 Interface card with the opto-islolator.


The Jack-Side in the picture above "Fig1"is the connection for the interface card i posted bellow.
So Jack-Side
Fig 1 terminal K1 go to Fig 2 Arduino side terminal J1=6
Fig 1 terminal K2 go to Fig 2 Arduino side terminal J1=7
Fig 1 terminal K3 go to Fig 2 Arduino side terminal J1=5 GND

Quote
Why are you bringing RX low when the other side brings that pin high?


To be honest about that.. i don't know got it recommended from the suppler, i don't have i high knowledge of electronic.

Quote
Where is 1KOhm calculated for the TX resistor?


Also for this point i got it recommended from the suppler.
k
I will try the change of the resistors as you recommend and keep in mind the restriction from Grumpy_Mike, so i will get back  :)
Jesper

tiak

Hi
Quote
Is the device using inverted TTL?

I just got confirmed that TTL is inverted from the supplier, and the explanation for that is if i send HI ind to the opto-isolator, the opto-isolator go HI and pulls the internal TTL signal Low, the internal TTL voltage is 3.6v just info.




tiak

Hi

Now its working  XD.
But first off all i will thanks everyone for the help i got ;)

I fount some old OPTO-Isolator i it was the same as they use on the interface, so i did a small test,
and followed the hint from drone  :).

From drone
Quote
*(Hint: connect RX to the Emitter and +5V to the Collector)


Idid that on the TX from the arduino to the meter and changed the resistor from 1kOhm to 220 Ohm.

And it now im happy..

Jesper


Go Up