I have a project that consists of a main module containing an Arduino Nano and a 4 port RJ45 connector. This main module connects to 4 identical sensor modules via ethernet cable (most likely CAT7). The sensor modules contain a single port RJ45 connector, a KY-031 knock sensor, and a WS2812 strip with only 2 LED's. I plan on ordering a PCB for both these modules and want to make sure that my schematics are correct. I've built a prototype using a breadboard and validated that everything works with my code.
The question I had was how to take advantage of the twisted pairs in the RJ45 wiring which are paired as follows:
1/2
3/6
4/5
7/8
I understand that on the sensor modules, for the KY-031 and the LED strips I should pair GND to Signal. And that I should also place a 1uf capacitor between the GND and 5V for the KY-031 and LED strips which has resulted in a confusing mix of wiring. Anyways, here are my diagrams.
For the main module, you can see that each RJ45 is connected as follows:
I am very inexperienced in this kind of design and I feel like I've made some critical errors. Like intuitively it feels wrong to have all these loops with the GND and 5V lines but again, I don't really know what I'm doing. Can someone please let me know?
One other question, should I connect the shielding of the RJ45 connector somewhere?
Nice schematic but I have to agree you will probably have problems. Let's look at your power source. Since you do not show a power supply I am assuming the Nano is the power source. The Nano can supply maybe 200mA max and two of your LEDS can draw 120mA so that tells us you do not have enough power. More than likely you could use CAT 4 cable or better. Although you do not need CAT7 it will work fine. How long are the cables going to be? I understand the WS2812 strips are a bit noise sensitive and several have recommended adding resistors in the signal lines. If the cables are long consider looking at some differential drivers. I use CAN drivers because they are inexpensive. Keep us up-to-date.
Thanks for your reply. The cables will probably be between 6 and 10 feet. And as you guessed, I am using the Nano to power the sensors using USB.
My experience so far with using WS2812 strips is that that the Nano is pretty good at driving them. I have another project that has been running a single strip of 12 LED's 24x7 for the last 6 months or so. And this project has 8 LED's and most likely only 2 will be on at a time except at startup when all of them will light up briefly. The difference between the two projects though is that the one with 12 LEDs are wired very close to the Nano. And your comment also reminded me that on the 12 LED project I have a 470 Ohm resistor on the signal wire. I will add that to my new project.
Do you recommend that the resistor should go close to the Nano or to the light strips? And did you notice anything else in my schematics that could cause a problem?
I assume it is to minimize reflections so I would put where it is convenient. Each system is different and you may not need it. I have a saying A power supply the Arduino is NOT!
LED data is on pin 4 and LED GND is on pin 5 and 7, and LED VCC is on pin 8. Ethernet twists wire pairs 1/2, 3/6, 4/5, and 7/8. So LED data is paired with GND and so is VCC. Unless I did it wrong.
Aside from avoiding using the Arduino 5V output pin to power the led strips, (already mentioned by someone else), I don't see any problem with it. I'm pretty sure the arduino will have no problem talking to the WS2812, even at 10 feet. In fact I think it would have worked 20 years ago, (if they had WS2812s then), even using the CAT cable, which I find to be very convenient, particularly because of the RJ45 connectors, because that means you can increase or reduce the distance between the Arduino and the led strip /sensor package by just swapping the cable. I would be curious if it would work with a 50 ft LAN cable. My feeling is that 25 ft would probably be the max distance. If it were two boxes talking over 12V RS232 they could be 100 ft apart. I've used 100 ft RS232 and never had any issues. Unfortunately the Arduino -WS2812 COMM link is neither RS232 nor RS485 so distance would be an issue if it weren't one of the aforementioned. I would expect you would want to use an external 5V supply.
FYI there are two different color schemes for numbering CAT cable, T-568A and T-568B. For making a standard cat 5 cable, you must arrange the color-coded wires in the same order on both ends. It actually doesn't matter which order you put the colors in, as long as it's the same on both ends. If you want to follow a popular convention use the "568B" ordering. Realize they are in twisted pairs, the TX and RX (both wires) must each be in a twisted pair not shared.