Author Topic: Priority-based series-connected switches decoding with ADC?  (Read 850 times)

0 Members and 1 Guest are viewing this topic.

Offline ricko_ukTopic starter

  • Super Contributor
  • ***
  • Posts: 1015
  • Country: gb
Hi,
with reference to the attached schematic, there are three switches which are normally closed for the power stage of this system to work. The voltage can be as high as 24V and the micro is 3V3. The 100K and 10K voltage divider resistors are high vlaue to avoid turning on the solid state relay. The solid state relay's LED trigger current is shown to be 3mA so I assume a current of 0.5mA is low enough to guarantee the OFF state. SSR datasheet is this: https://www.mouser.co.uk/datasheet/2/408/TLP241A_datasheet_en_20200217-1075431.pdf


But for safety reasons and also to provide user feedback, I need to monitor the status of each switch from a micro. Because they are in series - unless I am missing something - it is not possible to monitor every combination. First question is, is that correct? Or perhaps by adding high value resistors across the switches (as shown) that can be achieved?

But by assigning priority whereby the switches have decreasing priority from left to right (with reference to the schematic) so that if a higher priority switch is open then the status of the other ones does not matter, then an acceptable compromise can be achieved.

My second question, question is about resistor values with the compromise above. To spread the reading of the various combinations relatively wide apart for clear reading by the ADC even with large tolerances of the resistors, how would you choose the resistor values? Perhaps some exponential relationship?

thank you :)
« Last Edit: May 16, 2022, 11:49:07 pm by ricko_uk »
 

Offline Someone

  • Super Contributor
  • ***
  • Posts: 4525
  • Country: au
    • send complaints here
Re: Priority-based series-connected switches decoding with ADC?
« Reply #1 on: May 16, 2022, 11:05:47 pm »
The 100K and 10K voltage divider resistors are high vlaue to avoid turning on the optocoupler. The opto's minimum current to turn on the opto is 0.5mA.
Is that a specified minimum turn on current in the data sheet? Most opto couplers are highly variable over batch/life/drive conditions.
 

Offline ricko_ukTopic starter

  • Super Contributor
  • ***
  • Posts: 1015
  • Country: gb
Re: Priority-based series-connected switches decoding with ADC?
« Reply #2 on: May 16, 2022, 11:47:33 pm »
Thank you Someone,

it is actually a solid state relay (I corrected the wording in the OP). In the datasheet's ( https://www.mouser.co.uk/datasheet/2/408/TLP241A_datasheet_en_20200217-1075431.pdf ) first page it says trigger current is 3mA so my assumption is that 0.5mA is low enough to be off.

I cannot see any other infos about it. Is my assumption correct?

Thank you
 

Offline Someone

  • Super Contributor
  • ***
  • Posts: 4525
  • Country: au
    • send complaints here
Re: Priority-based series-connected switches decoding with ADC?
« Reply #3 on: May 17, 2022, 12:27:44 am »
I cannot see any other infos about it. Is my assumption correct?
Back to school for you:
Quote
IF smaller than minimum IFC is required in the design to ensure that the relay operates [into the OFF-State]
Which for those parts is lower than your (best case!) bleed. But those parameters depend on the load too, optos are a long way from "ideal" or easy to use.
 

Offline ricko_ukTopic starter

  • Super Contributor
  • ***
  • Posts: 1015
  • Country: gb
Re: Priority-based series-connected switches decoding with ADC?
« Reply #4 on: May 17, 2022, 11:43:47 am »
Got it now. Thank you :)
 

Offline ricko_ukTopic starter

  • Super Contributor
  • ***
  • Posts: 1015
  • Country: gb
Re: Priority-based series-connected switches decoding with ADC?
« Reply #5 on: May 17, 2022, 11:46:44 am »
Any suggestions on how to do it? Increasing the resistances to much higher values might make it too prone to noise. Any ideas/suggestions on how to implement the monitoring fo all switches as mentioned in the OP?

One way would be to use op-amps (high input impedance). Any other options?

Thank you
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2388
  • Country: gb
  • Recovering Electrical Engineer
Re: Priority-based series-connected switches decoding with ADC?
« Reply #6 on: May 17, 2022, 03:53:30 pm »
I think a redesign is in order. What does D8 do?
The SSR is on or it isn't so you need a simple logical decode of the switch settings and probably an NPN to drive its LED.
"Isn't there a chip for that?" SNx4HC148 CD4532 etc?


 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8517
  • Country: us
    • SiliconValleyGarage
Re: Priority-based series-connected switches decoding with ADC?
« Reply #7 on: May 17, 2022, 04:01:52 pm »
use weighted resistor in a 1-2-4 ratio. then you can simply feed this into an adc.

make a simply 0.5 mA current source that drives current into 1k-2k-4k (4k02)  the switches short one resistor each.

so you get 3 bits.
0.5 volt = 1k open
1 volt = 2k open
1.5 volt = 1 and 2 open
2 volt 3 open
2.5 volt ... you get the drill.


Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21651
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Priority-based series-connected switches decoding with ADC?
« Reply #8 on: May 17, 2022, 08:05:55 pm »
Easy enough to increase Ioff by putting a shunt resistor across the LED. :-+

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline ricko_ukTopic starter

  • Super Contributor
  • ***
  • Posts: 1015
  • Country: gb
Re: Priority-based series-connected switches decoding with ADC?
« Reply #9 on: May 18, 2022, 08:17:11 pm »
Thank you all! :)

@Tim,
yes, simple solution for the I  :-+

@free_electron,
yes with those numbers it works nicely

@TerryBites,
yes, but I was trying to keep as few components as possible at the front end to decrease potential failure points
« Last Edit: May 20, 2022, 09:28:50 pm by ricko_uk »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf