Best way to power a lot of sensors sequentially

Hello everyone !
I am having trouble finding the best way to do the following:
-I have a lot of sensors (photo transistors) connected to the same analog out on the arduino, which i power sequentially , and then do an “analog read” to get the data.
-For now i am “cheating”: using a 4051 i had , i select the correct pin to power, and then send a “HIGH” value to the currently selected pin before reading the analog value from the sensor.
-Since i need to be using this same method for over 300+ sensors i thought about linking multiple 4051 (one 4051 to select a group, then another to select the sensor in that group etc)
-Each “line” will have between 5 and 10 photo transistors.

As i am guessing this is not really the way to go, what would be the best method to achieve this kind of sequential powering? Perhaps a led driver?
If you can think of any other method to read a huge amount of data extremely fast , without having a mess of wires , and at a relatively low cost (4051 are cheap, Led Drivers not so much) it would help a lot!

Thanks in advance !

Why do you need to switch the power to the sensors? Surely you could leave them all powered on, and just select the outputs with a multiplexer? Or are you trying to reduce the overall power consumption?

Hello Anachrocomputer!

The speed of data retrieval, the wiring complexity,and the power consumption are the main factors .

For a bit more explanation on what i am working on : (with a schematic of the sensor wiring) http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1239959668/3#3

I originally went the way you suggested (having them all on and selecting the outputs with the multiplexer), but it was a nightmare wiring wise, and since a multiplexer can only retrieve data sequentially , this allowed me to simplify things a lot.

But honestly if there is a way to solve this problem differently i am open for it : i looked at shift registers as well and i am wondering, since they can get data asynchronously if that might be better.

The end goal is to retrieve the data from the 300 sensors (and possibly up to 1000 in tighter grid setups) at speeds of over 100hz.

You may find that a better chip to use for powering an array like this is a demultiplexer or decoder, such as the 74HC138, which will accept three binary input bits and select one of eight outputs. You can cascade many of them to get more outputs.

(having them all on and selecting the outputs with the multiplexer), but it was a nightmare wiring wise,

I might be missing something here but I would have thought that having all the sensor permanently wired to the power (which can just be one wire going from device to device) was much less of a wiring hassle than having to wire each sensor power to a multiplexer and each sensor output to a multiplexer.

such as the 74HC138,

The problem with these chips is that there is a one (power) an all outputs except the one that is selected where there is a zero. This is the inverse of what you want. You could put it through a 74xx04 but that is even more wiring and ICs.

@Anachrocomputer : looking at the data sheet, as grumpy_mike pointed out that would invert things (although in the data sheet they do mention the 238 models which has “inverting outputs.” that might be the right one ?)

@Grumpy_Mike : given the sequential nature of the reading of the analog values i currently just have to link the single “data out” of all the sensors directly to the arduino , i do not need an additional multiplexer for that part: this configuration also saves me from using a lot of resistors since if i power the sensors constantly i would need to have one resistor for each sensor, while i only use one for all of them currently: this is also of importance given the rather small spacing between each sensor.

Frankly given my lack of experience i could be wrong about this, but this seemed liked the easiest layout. But if there is another solution that might help be get a lot more data faster, even with more wiring that would be ok aswell …

i currently just have to link the single "data out" of all the sensors directly to the arduino

So you have lots of outputs from sensors all connected together and only one sensor powered up?

Have you actually tried this? It doesn't sound to me like this would work as an un powered sensor normally presents a load of a diode to ground. What sensor are you using again?

yes i tried it actually, it works great (except for some strange fluctuation on the sensor connected to the first pin of the 4051). I only have the reference of one of the phototransitors at hand http://pdf1.alldatasheet.com/datasheet-pdf/view/117148/ETC/OED-ST-8L.html But i tried it without problem with at least 3 different models.

I am struggling to see how you differentiate power from output for this device.
Are you connecting all the emitters together and then through a single resistor to ground. Then are you switching a voltage onto the collectors?

You are not getting any amplification from the transistor in this mode it is behaving like a photo diode. This reduces the sensitivity but if that is OK then it might work. The data sheet doesn’t give you the collector emitter reverse breakdown voltage but I would guess that this would be greater than 5V so it might just work for lots of sensors.

Yes, Mike is correct about the 74HC138, the outputs are active-low. You'd need to invert them to drive your sensors. The 74HC238 is the other way round, and has active-high outputs, i.e. only one output goes high when selected by the binary coded input, and all the others are low.

@Mike: erm to be honest i am starting to get a little confused here myself: (the wiring is exactly that which is on the schematic in my other post) i am using the Common-Collector Amplifier method, so i would say that i connect all the Collectors to the ground through a single resistor and then switching a voltage, as you said. I know you may not have necessarily time for this: but could you please explain why such a configuration would disable the amplification from the transistor? As for the reduction in sensitivity : if i have less gain, wouldn't that mean i should be getting lower value differences between the lowest and the highest value of ir light being shone on the sensor ?

@Anachrocomputer: ok thanks that would be what i was looking for then:) (although given Mike's latest imputs i am having doubts about whether i am doing the right thing)

Well that schematic in the other post is defiantly not conventional. The collector going to ground and the emitter going to +ve is biasing the transistor the wrong way round. If it works at all it can be only in the sense of a photo diode. That works when you reverse bias the diode and the photo current is induced reverse biased leakage in the junction. As I said there is no amplification or transistor action here only reverse bias leakage. I am surprised that this works but at least I can see a mechanism.

With a normal circuit the emitter is connected to ground and the collector to +ve through a resistor 10K to 100K. Then any photon creating an electron hole pair in the base region will cause current to flow from collector to emitter. That current will be the number of photo electric electrons multiplied by the gain of the transistor. Looking at the voltage on the collector you will see this drop as more light is shone onto the base.

With the arrangement you have being reverse bias, the only current flow is the photo electric electrons themselves, there is no transistor gain. This would make it between 10 to 100 times less sensitive (depending on the gain of the transistor which in not in the data sheet)

But if that is sensitive enough for your application then it does make multiplexing easer.

Wow ok , i am not only more confused but also sorry , Mike , my bad:
looking at the schematics here again http://hades.mech.northwestern.edu/wiki/index.php/Photodiodes_and_Phototransistors i just realized that i completely mixed things up in my schematics, you were right!
I am actually indeed connecting all the emitters together and then through a single resistor to ground and switching a voltage onto the collectors!
The corrected schematics would be :

My bad, really!
The original question still applies for the corrected version : would the photo transistors in this case still work as photo diodes? (from what i understand in this case, there should be transistor gain right? or does the common resistor nil it out ? )
Thanks a lot for your time:)

or does the common resistor nil it out

It's not the common resistor, it is the fact you have a common collector circuit or an emitter follower as it is normally called. This configuration only has a voltage gain of 1 (it has a current gain but that only allows you to get the same voltage swing through a lower emitter resistor).

So yes this is a better circuit but there is still no voltage gain from the transistor. But as I said it is easier to multiplex.