I'm doing a project where I need to use +-20 CNY70 sensors.
They need to be inserted into a tight tube. The tube is roughly 1.3 meters long and the whole thing (wires and sensors) need to be inserted and removed from that tube multiple times which creates me 2 issues:
A lot of wires inserted and removed from tight space, even if held together with stretch bands or stripes, is not comfortable and prone to soldering breaking and other issues .
Weight. the tube is pretty light and the final project should not be too heavy. Adding all these wires significantly increases the weight of the the finale product.
I added a scheme of the tube with the sensors to illustrate.
One thing that can help me with 33% of the problem is chaining the Ground wire from sensor to sensor.
However I'm not sure how to decrease the amount of input and reading wires.
I'm looking into all kind of ideas and thoughts about how would you tackle the issue.
obvious 40 cables are not feasible.
if you like the chaining you may try to build some sort independent chainable unit with 8 sensors and PISO shift register, if LED are powered consequently - you can connect "LED input" together, if not - add SIPO shift register.
or little pcb with: sensor, 5V regulator, attiny13a
@grumpyike
I didn't mention but yes, the sensors are aligning to holes on the side of the tube from which they can provide the readings I need from them.
We can only know what you tell us, most of us used to have crystal balls, but since covid they have stopped working.
So how are you insuring that these holes stay lined up through multiple insertions of the arrangement through the tube?
What are you actually trying to measure?
What distance is the thing you are trying to measure from the outside of this tube?
Without a thin PCB to hold everything I can still not see how the "solution" would work. Even with one there must be a better way of solving your real problem, what ever this turns out to be. For example linear array of CCD sensors with an external lamp.
It sounds like this is for a school project or something, so my answer here probably isn't going to apply. However, If you wanted to do the the right way, which includes minimizing wire complexity and ensuring that your LEDs and sensors always line up in the tube, I would recommend getting a custom PCB layout printed on to a giant Flat Flexible board(s).
The advantage of using flat flexible is that you can have a ton of wires without taking up any extra room, your sensors and LEDs will be at exact locations relative to each other, your board conforms to the shape of the inside of the tube, and you can potentially remove and re-insert the board in to the tube many many times.
However, for a project of this size, it will be difficult to get a single flexible board that spans the whole 1.3 meters. It would be possible, but expensive, which is why it is not appropriate for a school project budget. There may be a cheaper solution where you can daisy-chain several long PCBs together (flexible or regular FR4), but replacing wires with PCB traces means a lot of soldering when connecting two sections of the PCB together.
Maybe it would help if you can replace your individual LEDs with a string of addressable LEDs so that all the LEDs put together only use 3 wires? Maybe it would help if your tube could be split lengthwise and reattached with hinges so that you can open the whole thing to arrange your sensors rather than inserting a giant kludge from the end of the tube?
@TomGeorge
It needs to be inserted and removed because it when the device is not in use, the tube needs to remain empty.
@grumpyike
Your nickname suits you well
I didn't want to add information that is not relevant to my question.
The sensors are not floating in the tube. I have cylindrical pieces that each carries a sensor and slides into the tube. The wires go through all the cylindrical pieces until they exit the tube and connect to my Teensy 4.0 processor.
I have a way to align the sensors with the holes, don't worry about that.
The holes in the tube have caps that open and close, and I use the sensors to know whether each hole is open or closed.
Using a hall effect sensor is a more optimal solution for this task, however Its not possible to add magnets to the caps of the holes.
@chromorphous Thanks for your answer.
It is not a school project, I'm trying to build something for my personal use and this is actually my first Arduino-like project.
I will consider using a strip of Leds instead of connecting the leds in the CNY70 sensors.
I'm not yet in a stage of my project were I consider printing custom PCB, I'm still in the POC stage. But I will consider that for the future!
I will also consider a different approach of connecting the sensor leds, not in a chain but in a way similar to the added painting
You are a beginner, you are asking questions so in order to give you sensible answers we need to know what you know. So all information is relevant to your problem.
So we have to guess that English is not your first language. No one who is would call that a "painting" it is a drawing or a diagram.
The problem with this way of showing resistors in the lower diagram as an oval saying resistors is it does not show what the individual resistors in that oval are doing. A few arrows would help or labeling to show if the cny shown was from the input powering the LED, or from the output the transistor driver.
No, PLEASE can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.
How are your sensors connected to the controller, where is the gnd connections?