Identifying amount of external devices

Thread Starter

Vytas Klyvis

Joined Dec 5, 2016
75
Hello,

I'm planning on building a system where there is one main controller and several (0-5) devices. Each of these devices has two states. I would like to know from the main controller how many external devices are connected and how many of them are active. I don't care which device is active. This detection should be done fairly simply. Using at most 4 cables (+, -, data, data).

upload_2018-12-5_8-49-18.png

I was thinking of a system where each device pulls a certain amount of current, which would cause a voltage drop over a resistor. This voltage would then tell how many devices are connected.
I was thinking of implementing the current source by using a JFET and a single resistor but I don't know if the spread of current between the JFETS would cause for example two devices to be seen as three.
My second idea was to use a voltage regulator with a resistor (Also only two components) as a current source, but I really don't know if this is recommended.

upload_2018-12-5_8-56-6.png

For the detection of the amount of active devices I thought of something like the above. Here the current will only flow when the device has an active low. According to the datasheet of the device (AT42QT1010), the output pin can sink/source up to 2mA.

Hopefully someone can tell me if this is a good approach and if so, how I could best implement the current source. Many thanks,

Regards, Vytas
 

wayneh

Joined Sep 9, 2010
18,104
As I understand, and I may have it all wrong, you could pass the current for all your devices over a shunt resistor. Then put something like LM3914 on that shunt voltage. The higher the voltage, the comparators in the LM3914 would act like a bar graph to show how many devices are connected. This will only work if the devices have a fairly consistent current draw.

Another approach would be to use a quad comparator LM339 and use each individual comparator to watch for whether your device is connected.
 

Thread Starter

Vytas Klyvis

Joined Dec 5, 2016
75
Thank you for your response.

I think the current drawn from the devices will fluctuate to much for the first solution. I intend to have two different cables with one that monitors if the device is connected and the other to show which one is in it's active state.

upload_2018-12-5_15-46-8.png
Ignore the standard symbol for the diode. It is meant to be a zener diode rated at 2V.

The part count has gone up, but I hope that this will be a stable solution.
 

danadak

Joined Mar 10, 2018
4,057
The current source certainly a good approach. You have to design
to make sure it stays in compliance (its min V required) for the worst
case cable run.

JFET to JFET tolerance horrible. A 3 terminal adjustable regulator
one possibility for current source, accuracy dependent on Rset and
its Vref. Adjustable LDOs can be used as current sources, accurate
to 2% over T. TO92 package or SMD.

Regards, Dana.
 

Thread Starter

Vytas Klyvis

Joined Dec 5, 2016
75
I have ditched the idea of having a JFET as a current source.

I tried the idea using a L7805 voltage regulator, but there was quite a bit of ground pin current. So I put that on ice as well. My current idea is using zener diodes and a transistor to create a current source.
Do you think this will work?

upload_2018-12-5_16-8-1.png
A rough idea of what I'm trying to accomplish.
 

danadak

Joined Mar 10, 2018
4,057
Even an LM317 would work, its adjust pin current is 100 uA max.

upload_2018-12-5_10-29-38.png

Although its Vref tolerance is a little loose, like ~ +/- 10%. That would still work for 4
devices. Two parts needed, the reg and an R. As I pointed out earlier more accurate
parts with lower Iref are available. Like < 100 uA.

Do an error budget whatever you do.



Zener and transistor would work, although keep in mind Vbe drift in that circuit
+ Vz drift/tolerance of both, affect accuracy.


Regards, Dana.
 
Last edited:
Top