multi-sensor network

MrChips

Joined Oct 2, 2009
34,810
why you people are suggesting other solutions while i mentionned that i'm going to use arduino mega wiith 20 sensors which is mentioned in the project's specification: I have to use oone microcontroller to read all the informations

the project consist on reading leds on a pcb to detect the intensity of the light and rgb of the leds (its a functional test for the pcb)

the main problem here is finding the right sensor
I told you in post #2 that choosing the right sensor is not the problem.
 

Thread Starter

Man Noula

Joined Jan 31, 2017
25
hi, yes i remember what you said, but how could i design adressable nodes when the sensors are not adressable?
 

ericgibbs

Joined Jan 29, 2010
21,442
hi MN,
You could use the Arduino mega in conjunction with 2o low cost PIC's and the sensors suggested by 'bertus' post #6.
The 16F88 could be programmed to cycle the RGB selection of its under test LED and also read and store the square wave output of the sensor.

The Arduino would then control each 16F88 and read the stored LED data from each 16F88 in SPI protocol.

E

One RGB element:

A004.gif
 
Last edited:

Thread Starter

Man Noula

Joined Jan 31, 2017
25
hi MN,
You could use the Arduino mega in conjunction with 2o low cost PIC's and the sensors suggested by 'bertus' post #6.
The 16F88 could be programmed to cycle the RGB selection of its under test LED and also read and store the square wave output of the sensor.

The Arduino would then control each 16F88 and read the stored LED data from each 16F88 in SPI protocol.

E

One RGB element:

View attachment 121750
Okay thank you very much i will think about that :)
 

BR-549

Joined Sep 22, 2013
4,931
When you you test the pcb......can you control the lighting sequence of the pcb leds?

Maybe one sensor is all you need.

Is there 20 leds on one board? Or 20 boards in different locations?
 

Thread Starter

Man Noula

Joined Jan 31, 2017
25
When you you test the pcb......can you control the lighting sequence of the pcb leds?

Maybe one sensor is all you need.

Is there 20 leds on one board? Or 20 boards in different locations?
there is something called Test pins that have to be powered,
yes there is up to 20 leds in one pcb
not one led per pcb
 

BR-549

Joined Sep 22, 2013
4,931
Can you control the leds on the pcb individually? Just turn one on at a time. Use one sensor.

If not....don't give up hope. Can you pass a slit in a piece of paper over the pcb......so that you can only see one led at a time?

If so.......you can pass pcb behind slit shield as to separate led light.

Do you see what I mean?
 

Thread Starter

Man Noula

Joined Jan 31, 2017
25
No all the leds are turn on on the same time
And the light will pass to the sensor in optic fiber (micro fiber : it's not thin it's a little bit thinner than a human hair)

check this image
 

Attachments

BR-549

Joined Sep 22, 2013
4,931
Ok it looks like your serious. Please explain your production line. Are the pcb placed and held stationary in a jig or fixture while testing.......or is the pcb on a moving line?

It's just curiosity at this stage.........I have no experience with optics and optic coupled sensors.

Very interesting project........best of luck.
 

Thread Starter

Man Noula

Joined Jan 31, 2017
25
Ok it looks like your serious. Please explain your production line. Are the pcb placed and held stationary in a jig or fixture while testing.......or is the pcb on a moving line?

It's just curiosity at this stage.........I have no experience with optics and optic coupled sensors.

Very interesting project........best of luck.
No the pcb is putted in a Black Box that doesnt permit ambient light to enter so the results would be precise :)
 

BR-549

Joined Sep 22, 2013
4,931
Then you have to make a separate jig for each different board.....right?

You might want consider a hole pattern shield to help isolate led light. With your png image setup.

I can't help you with the optic interface. I haven't seen optics discussed here very much.

But there are some sharp techs on here.
 
It sounds to me like you are overlooking, or overthinking, solutions that have already been presented.

You seem to be stuck on sensors that have a fixed address and assuming that you can't address them individually on the same bus lines with the mega and know which sensor you are addressing. As has already been pointed out, you can make them addressable.

For example, this sensor is very sophisticated with impressive digital spectometry and looks like a really nice fit for your project. It has a fixed I2C address, but that does not prevent you from using 20 of them. The operating current for the device (without the indicator LED and driver, which you would not want) is only 5mA. So, just use the mega GPIO lines to power the device you want to address with all other devices powered off. This chip even has an optional UART output that is RS232 compatible offering yet another communication option. Since it is a 3.3v device, a small amount of additional circuitry is necessary to make it play well with the mega, but since you have to assemble a board for the sensor, this doesn't seem insurmountable.

Why wouldn't that work?

If you are looking for a color sensor that has a programmable I2C address, I am not aware of any. Some Honeywell humidity and temperature sensors do allow you to do that, but I don't know of any color sensors that do.
 

djsfantasi

Joined Apr 11, 2010
9,237
It sounds to me like you are overlooking, or overthinking, solutions that have already been presented.

You seem to be stuck on sensors that have a fixed address and assuming that you can't address them individually on the same bus lines with the mega and know which sensor you are addressing. As has already been pointed out, you can make them addressable.

For example, this sensor is very sophisticated with impressive digital spectometry and looks like a really nice fit for your project. It has a fixed I2C address, but that does not prevent you from using 20 of them. The operating current for the device (without the indicator LED and driver, which you would not want) is only 5mA. So, just use the mega GPIO lines to power the device you want to address with all other devices powered off. This chip even has an optional UART output that is RS232 compatible offering yet another communication option. Since it is a 3.3v device, a small amount of additional circuitry is necessary to make it play well with the mega, but since you have to assemble a board for the sensor, this doesn't seem insurmountable.

Why wouldn't that work?

If you are looking for a color sensor that has a programmable I2C address, I am not aware of any. Some Honeywell humidity and temperature sensors do allow you to do that, but I don't know of any color sensors that do.
So in addition to the data line, you would have to run 20 wires to each sensor to power it on? Or am I misunderstanding your solution?

If you have to run 20 power lines, why not run 20 data lines?

As mentioned, one could design an addressable circuit, with a shift register such as the CD 4021B and an addressing protocol. You'd also need a Hex inverter and 8 input AND gate. I'd recommend a separate address line.

Or you could run 5 additional lines for the address. You'd still need the AND & NOT gates to decode the address.

But then there is the problem of distance of the lines. It has been suggested that RS485 would be a solution. But that would place additional circuitry on the sensor board as well. Circuitry that would better be replaced by a microprocessor. The aforementioned Trinket is 7.00USD

Personally I don't understand the TS requirement that only one microprocessor can be used. It makes the entire project more difficult.
 

MrChips

Joined Oct 2, 2009
34,810
This project is very doable. I can easily offer a long list of possible solutions if the TS is willing to put aside the sensor and focus on the multi-node network. The solutions can range from 1-line to 3-line solutions and even 21-line solutions.

If the distances are less that 50cm it is not necessary to go to RS-485. For longer distances in an industrial environment RS-485 gives a robust solution.

In the simplest, non-MCU solution, you can use any sensor that has an enable pin, such as TCS230 and TCS3200 (already suggested by bertus).

Connect all output pins together and enable each sensor individually from 20 select lines (solution: 21 lines)

or use a 5-bit decoder (solution: 6-lines ).

or use a shift register to select the sensor (solution: 4 lines).

1, 2, 3-line solutions are possible but will require an embedded processor at each sensor. The list of solutions is as long as my arm.
 
So in addition to the data line, you would have to run 20 wires to each sensor to power it on? Or am I misunderstanding your solution?

If you have to run 20 power lines, why not run 20 data lines?

As mentioned, one could design an addressable circuit, with a shift register such as the CD 4021B and an addressing protocol. You'd also need a Hex inverter and 8 input AND gate. I'd recommend a separate address line.

Or you could run 5 additional lines for the address. You'd still need the AND & NOT gates to decode the address.

But then there is the problem of distance of the lines. It has been suggested that RS485 would be a solution. But that would place additional circuitry on the sensor board as well. Circuitry that would better be replaced by a microprocessor. The aforementioned Trinket is 7.00USD

Personally I don't understand the TS requirement that only one microprocessor can be used. It makes the entire project more difficult.
What I would envision would be three lines coming from each sensor board with Vcc (connected to a mega GPIO), SCL and SDA (going to the mega I2C lines. The mega turns on the sensor it wants, reads it and turns it off - repeat 19 more times to read all of the sensors using the I2C interface. Not considering and transmission line length problems for the moment, I think that it might work, at least I don't know why it would not.

Not suggesting that this is the only way that might work..and I would include your addressing scheme as another way that might work. One could also program a PIC to assist, as has already mentioned and I also don't understand the only one microprocessor chip. In fact, a single 8-pin PIC could make a non-I2C sensor into an addressable I2C device - see obvious self-serving plug here - that would allow 20 sensor devices with 20 unique I2C addresses. But it also violates the "only one microprocessor can be used" rule :)
 
This project is very doable. I can easily offer a long list of possible solutions if the TS is willing to put aside the sensor and focus on the multi-node network. The solutions can range from 1-line to 3-line solutions and even 21-line solutions.

If the distances are less that 50cm it is not necessary to go to RS-485. For longer distances in an industrial environment RS-485 gives a robust solution.

In the simplest, non-MCU solution, you can use any sensor that has an enable pin, such as TCS230 and TCS3200 (already suggested by bertus).

Connect all output pins together and enable each sensor individually from 20 select lines (solution: 21 lines)

or use a 5-bit decoder (solution: 6-lines ).

or use a shift register to select the sensor (solution: 4 lines).

1, 2, 3-line solutions are possible but will require an embedded processor at each sensor. The list of solutions is as long as my arm.
I agree. I did read bertus' post that you mentioned and I agree it is simple and straightforward. The point that I was trying to make in my post is that if you chose a sensor that does not have an enable pin (as is the case with the I2C chips that I looked at) you can still implement a variant of what bertus suggested by connecting all the SCL and SDA lines together (instead of the output lines) and powering the individual sensors with individual GPIO lines, accomplishing the addressing.

I hear your point about not focusing so much on the sensor but rather the network Tthe OP, however, does seem to focus on the sensor - possibly looking for one that has a configurable address., Newer I2C sensors may, or may not, offer advantages with regard to evaluating the board's LED output. I can't tell because I didn't read any specifications about the evaluation requirements.
 
Top