Translating digital inputs to analog voltage

drjohsmith

Joined Dec 13, 2021
852
But my fault units do not connect to ground in a „no error“ scenario. They are simply open - floating. Please correct me if im wrong.
Just joined this thread
Read through the posts from the OP, and Im less than clear what they want,

Where are the fault indications coming from ? can you share a part number and picture please
Are the outputs of the fault indicators differential i.e. two wire, or single ended referenced to ground
can you clarify please what indicates a fault, a voltage, a current, a ground or what

Are these faults liable to be over long wire s?
are these wires ESD safe ?

What is the part that you want to connect into ?
a part number / picture please


Basically
if you signals are from a way away, the voltage will not be 24 v due to voltage drop , and the ground will not be common,
you could also well be having to look at ESD / Voltage offset , such as an opto isolation

If you want to know which input is the fault, and you can't connect them all independently into your receiver
then you need to encode the fault signals
Simple answers, this could be by multi voltage ( the ADC ) , or by time ( the switch selector )

If all you need to do is to detect a fault has happened,
then your into a "wired OR" input
This could be with just resistors, or with diodes / and one resistor,
Depends upon what the fault signla is ( high or low )

Just a last thought
the "Majority" of "fault" indicators I have seen, are "open collector" output
i.e. they have no voltage out, but rely upon a voltage being sent to then, via a pull up resistor
 

Thread Starter

Salomonander

Joined Mar 31, 2022
40
im still a bit confused with this…. Am i understanding correctly that the resistor ladder sits before the fault switches inputs? And i then connect all outputs together and feed them to the gsm with a parallel 50k resistor to ground?

in case more than one fault switch is engaged, will the voltage of these two then add up and mess with identifying the correct one?
 

crutschow

Joined Mar 14, 2008
34,418
in case more than one fault switch is engaged, will the voltage of these two then add up and mess with identifying the correct one?
Yes.
It's not possible to avoid that problem with that small resistor network.
If you used both ASM A/D inputs you would likely be able to identify which of two simultaneous faults occurred, but no more than two.

Using the two D/A converters, as I discussed in post #40, would allow you to detect any number of simultaneous faults.
 

Thread Starter

Salomonander

Joined Mar 31, 2022
40
Thanks. Still trying to understand how to hook this up with the DA converters…. Sorry im not that good with electronics. I dont get how that combination can indicate me more than one fault and how it would show me, which fault units are active. Give me some time - ill get it eventually :)
 

crutschow

Joined Mar 14, 2008
34,418
I dont get how that combination can indicate me more than one fault and how it would show me, which fault units are active.
The two 8-bit D/A outputs generate an output voltage that goes from 0V to 10Vdc with 39mV minimum steps for each 1-bit LSB change of the binary sequence.
Thus there are 255 distinct voltage levels for all possible 8-bit input combinations.
This voltage is detected by the GSM module A/D input to convert the analog back to digital so you can determine which of the 255 levels is being generated.
From that you can calculate which of the 8-bit fault inputs are active for anywhere from 1 to all 8 inputs.

For example if faults 2 and 5 where active, the binary input is 00010010 or 18 decimal to the Phoenix module.
For this, the module generates an analog output of 18/255 * 10V = 706mV
This is then converted by the ASM 15-bit A/D converter back to digital (.706V / 60V *32767 = 386 decimal).
Divide that by the difference in resolution between the two converters (post #40) to get the original input, 386 / 21.4 =18.0 decimal, or 00010010 binary, showing that the fault was indeed 2 and 5.

Make sense?

Edit: Since I don't know how you are monitoring the ASM remote output data, I have no idea what instrumentation you would have to convert the ASM data to indicate the fault location(s).
 
Last edited:

Thread Starter

Salomonander

Joined Mar 31, 2022
40
Thanks mate. I appreciate the explanation, it sounds like a perfect solution. But this is way above my experience level. I know nothing about binary code. No chance ill understand it… I can not convert the asm data either. All i can get is a voltage reading via the phone 0-60V (text message). Guess ill have to stick to the resistor ladder.

i thought the phoenix modules would simply output a voltage between 0-10v depending on which input is active last. But it puts out binary code that shows more than one signal at a time? Sorry for asking such a fundamental question. I wasnt aware of that. Im just a musician trying to make sense of it all :)
 
Last edited:

crutschow

Joined Mar 14, 2008
34,418
All i can get is a voltage reading via the phone 0-60V (text message). Guess ill have to stick to the resistor ladder.
Yes, if that's all you can read from the output, then I suggest you use the 17 resistor network I proposed which will give an output of 1V to 16V, depending upon which fault switch is closed.
Of course that limits you to recognizing only one fault at a time.
i dont understand how you get from signal 2&5 to 18 or its binary equivalent though
In the decimal system each place in the number is 10 times the previous, as you know.
In binary each place is 2 times the previous.
Thus the right most has a value of 0 or 1, the next to the left has a value of 0 or 2, the next has a value of 0 or 4, etc.

So for 00010010, the right most is value is zero, then next value is 2d (decimal), the next two are zero, and then the fifth value is 16d.
So you add them together to get 18d for the number value.

If you read up a little on binary numbers, it should become clearer.
 
Last edited:

Thread Starter

Salomonander

Joined Mar 31, 2022
40
Thanks Crutschow,
i understand more now. And ill read into binary tonight. Maybe i can get it working after all. And otherwise i will either use the resistor network or build myself a 16:4 priority encoder that i connect to my 4 digital inputs. That way i still have only one fault at a time, but more than one doesnt mess with the reading and everything is prioritized towards the „worst case“ errors. Sounds like a decent compromise to me. Thanks again!
 

crutschow

Joined Mar 14, 2008
34,418
otherwise i will either use the resistor network or build myself a 16:4 priority encoder that i connect to my 4 digital inputs. That way i still have only one fault at a time, but more than one doesnt mess with the reading and everything is prioritized towards the „worst case“ errors.
Yes, but with a priority encoder you won't know if there is more than one fault.
With the resistor network, you will get an odd reading, which will tell you there is more than one fault, even if you can't determine which ones.

So it depends upon what is more important to you.

Alternately, if you want to try building the multiplexer circuit I proposed in post #13, to sequentially output the 4-bit address of every fault (say 1 per second, repeated every 16 seconds), I can provide you a circuit for that.
It should require no more than 4 IC's (555 clock, CD4067 16-chan mux, CD4029 4-bit counter, CD4081 AND gate).

How do you remotely read the 4 digital signals?
 
Last edited:

Thread Starter

Salomonander

Joined Mar 31, 2022
40
Actually, that circuit would be great. I would then simply get more than one text message in case of more than one error. That would be perfect. Is it possible to not have it repeat at all? Simply give out any error in a somehow delayed fashion so i get a text message per error (even if a bunch of fault signals occur at the same moment - i assume this would mean different delay times for every channel)? If not, maybe you could extend the loop duration to something like an hour?

and the unit will just show me the basic hi/lo state of the four inputs. Ill have to put it into a binary calculator app - or learn them by hard. But whenever the input changes i should get a seperate text message.
 
Last edited:

crutschow

Joined Mar 14, 2008
34,418
Simply give out any error in a somehow delayed fashion so i get a text message per error
Slowing the sequence down is not a particular problem.

Unfortunately a problem has occurred to me which needs a fix.
The 16 step binary sequence goes from 0000 to 1111 (0 to 15d) so if there is a fault for #1 it won't generate an output (since that's 0000).
Is there a way to also monitor the analog output, so that it could be used to signal there is a fault on channel 1?
 
Last edited:

Ian0

Joined Aug 7, 2020
9,805
Slowing the sequence down is not a particular problem.

Unfortunately a problem has occurred to me which needs a fix.
The 16 step binary sequence goes from 0000 to 1111 (0 to 15d) so if there is a fault for #1 it won't generate an output (since that's 0000).
Is there a way to also monitor the analog output, so that it could be used to signal there is a fault on channel 1?
Same problem occurs with the priority encoder: no fault = 0000, fault #0 = 0000 (with 16 faults numbered 0 to 15)
It would work better if there were a maximum of 15 faults!
 

Thread Starter

Salomonander

Joined Mar 31, 2022
40
Yes, i can use one of the two analog inputs in addition. Or alternatively live with 15 signals only. Thank you so much. I really appreciate your help!
 

Thread Starter

Salomonander

Joined Mar 31, 2022
40
Darn …. I did not think about that. No its not. Needs to be close to immediate. Any chance to make this happen without repetition? Maybe one could design a circuit that simply delays all fault units slightly different? say unit 1 has a 1second delay going up to unit 15 with 15 seconds of delay. That way i would still get a separate text message for each error. If this then repeats after an hour i would not mind.… but it would not be necessar.
 

crutschow

Joined Mar 14, 2008
34,418
Needs to be close to immediate. Any chance to make this happen without repetition? Maybe one could design a circuit that simply delays all fault units slightly different? say unit 1 has a 1second delay going up to unit 15 with 15 seconds of delay. That way i would still get a separate text message for each error.
Okay, that complicates the logic somewhat, so let me give that a little thought.

So it's okay if you get each error message only once (or perhaps twice for redundancy)?
 
Last edited:

drjohsmith

Joined Dec 13, 2021
852
Darn …. I did not think about that. No its not. Needs to be close to immediate. Any chance to make this happen without repetition? Maybe one could design a circuit that simply delays all fault units slightly different? say unit 1 has a 1second delay going up to unit 15 with 15 seconds of delay. That way i would still get a separate text message for each error. If this then repeats after an hour i would not mind.… but it would not be necessar.
If I remember, your feeding the signals into a processor
If so, could you use the processor to do the filtering for you ?
 

Thread Starter

Salomonander

Joined Mar 31, 2022
40
Hopefully not too complicated. let me know if im asking for too much. And getting the message only once per fault unit would be no problem. The gsm even has a function that will repeatedly output text messages until i confirm by sending a text message myself.

@drjohsmith: nah, the unit is not that smart. It only shows the state of 4 digital inputs and two 0-10v inputs. There is an english manual in the downloads section in case you are interested
X200
 

crutschow

Joined Mar 14, 2008
34,418
Hopefully not too complicated
Not as simple as I like.
I've come up with a scheme that uses 1 timer chip, 5 logic chips, 1 16-input multiplexer chip, and about 20 small capacitors, and 20 resistors.
Possibly also a regulator chip to get a 12Vdc supply.

In operation a fault-switch closure triggers the counter to go through a 16-step count, generating a 4-bit fault output address to the SMS module, and then stops until/if there is another fault closure.

So it involves a fair amount of wiring and soldering on a perf board.
Does that still sound like something you want to try?
 
Top