Close
0%
0%

10mbps over 1km on a single pair of wires

A simple 50mmx44mm module to route power and differential signals (RS-485) over RJ-45

Similar projects worth following
μDiff provides an easy way to reliably transfer power and a digital signal over a long-distance using an inexpensive RJ-45 cable. This can be useful for large robots, LEDs, or any device that needs reliable communication over more than a few meters.

It uses RS-485 differential signaling and 802.3af Power-over-Ethernet pinouts to achieve this. It can accept an input voltage between 8V-28V, and provides outputs of 5V and 3.3V. All signals and voltages can be accessed through an 8-pin header.

Current is limited to 1A with the default components, but can be upgraded to ~2A with a different 5V switching regulator and fuse. Beware of current limitations on the RJ-45 cable, it's typically ~700mA for an AWG26 shielded wire pair (2 wires).

Some components are pre-soldered SMD (0805), while the rest are easy to source off-the-shelf through-hole components.

The board measures 50mm x 44mm, lead-free and RoHS compliant, and is stackable through 4 grounded M3 holes.

How it works

At first glance it should be obvious how this module works, but I'll explain it below.

To start, you need minimum 2 modules.

Let's assume one device acts as the driver, and will be connected to an MCU (microcontroller, ex: Arduino).

The other device will act as the receiver, and will be a short string of WS2812 LEDs drawing 200mA of current at 5V (1W).

Connections

The two modules will be connected through a 15 meter AWG26 RJ45 cable, and we'll assume there's a 12V power source near module 1.

  • Connect the 12V and GND from your power source to the VIN/GND pins on module 1
  • Connect the 8-pin JST cable to module 1 and wire the other end to the MCU's data pins (and power/gnd if needed), and ensure RE and DE are pulled high (DIP switches in the OFF setting)
  • Connect the RJ45 cable between the two modules
  • Connect the 8-pin JST cable to module 2 and wire the LED strip to it, and ensure RE and DE is pulled low (DIP switches in the ON setting).
  • Profit!
                                                  +-----------------------+
                                                  |         Device        |
                                                  |    (5V LEDs WS2812)   |
       +--------------+                           |                       |
       |   +8V~28V    |                           |    +---------------+  |
       | power source |                           | DI |          VIN GND |
       +-+----------+-+                           +-+--------------+---+--+
         |          |                               |  |           |   |
+--------+----------+--------+                   +--+--+-----------+---+------+
|  (+) VIN          GND (-)  |                   | RO RE DE DI GND 5V GND 3V3 |
|                            |    15m AWG26      |                            |
|       RS485/RJ45     +-----+ <-+-+-+-+-+-+-+-> +----+  RS485/RJ45           |
|         module 1     |RJ45||   | | | | | | |   |RJ45|    module 2           |
|         (driver)     +-----+ <-+-+-+-+-+-+-+-> +----+   (receiver)          |
|                            |                   |                            |
| 3V3 GND 5V GND DI DE RE RO |                   |  (-) GND          VIN (+)  |
+------+---+-----+-----------+                   +----------------------------+
       |   |     |
    +--+---+-----+---+
    | GND VIN   P0   |
    |                |
    |       MCU      |
    |    (Arduino)   |
    +----------------+

Of course you'll also need to push some code to your MCU to drive the DI data pin and transmit the signal to the LEDs.

This project is certified open hardware:


Similar projects

  • 1 × MAX3088 RS-485 IC 8-pin DIP
  • 1 × SIP3 5V/1A switching voltage regulator
  • 1 × RJ45 connector
  • 1 × 2-pin screw terminal
  • 1 × 8-pin JST-XH male connector with female connector and pins

View all 10 components

  • Received the v.04 PCBs, but there's a fail

    Alexander Williams6 days ago 0 comments

    I received the v.04 PCBs, but I unfortunately discovered a design error which causes a strange problem.

    After soldering a pair of PCBs and running some tests, I noticed the RS485 IC would not send a differential signal after power-on the device from a cold start (ex: 12V power adapter is initially unplugged).

    I first thought it was an issue with the power-on sequence due to the 5V and 3.3V DC-DC converters, but checking those voltages and ramp-up with the oscilloscope showed there's no issue. Also, the blue LED on both boards light up perfectly, which means sufficient power is sent at power on (at least 6.5V).


    I then monitored the different signals individually, and noticed the DE (driver enable) line was not being driven high after that power-on sequence. It was hovering around 1.28V, although it needs at least 2V to be considered high.

    A quick look at the schematic shows the culprit: a voltage divider! *facepalm*

    I tied DE and RE together to GND with a 10K pull-down resistor. I also added a DIP switch (JP3) to connect DE/RE to 3.3V through a 10K pull-up resistor. This creates a voltage drop that's too large for the IC to see a high on DE. I guess I'll fix that by replacing the 10K pull-up with a 4.7K.

    In the meantime, the temporary fix (if using the board as a Driver) is to add a jumper wire between the DE/RE and 3V3 pins on the 2x4P (8P) 2.54mm connector. It's also possible to drive DE/RE high using an MCU if there's an available GPIO pin.

    Since I'm back in KiCad, I'll use that opportunity to add some much needed test pads under the PCB.

    Otherwise, I'm pretty happy with the way the PCBs turned out, and don't plan on making other changes in the near future.

    More details in a future post.

  • Important safety feature in v.04

    Alexander Williams07/28/2022 at 13:50 0 comments

    If you look carefully at the v.03 schematic, there's a silly mistake I introduced which could be disastrous if the end-user is not careful with their wiring and setup.

    Let's first illustrate the Input current flow on the new v.04 module:

    Unprotected Power -> Diode -> Fuse <-> RJ45 / DC-DC Converter

    As you can see, the unprotected power, perhaps from a power adapter or bench supply, will first pass through a few components before going out the RJ45 cable, thus protecting it from shorts and overcurrent scenarios. The diode should also protect the power sources, should there be a power source at both ends.

    Now let's look at the Input current flow on the old v.03 module:

    RJ45 <-> Unprotected Power -> Diode -> Fuse -> DC-DC Converter

    Do you see the difference?

    What this means is, in the old v.03 module, unprotected power will flow directly through the RJ45 cable to the other module, without any fuses to protect the cable. Any short or overcurrent will flow freely through the cable and likely heat, melt, and burn it down.

    I noticed this problem when I first designed v.03, but it was already being produced and I could only hope to correct it in v.04 - which I did.

    Hopefully nobody made the mistake of 1) drawing too much current through the RJ45 cable, 2) powering both modules at the same time with the VIN enabled jumper set, 3) creating a short / over-current situation.

    As usual, since this is an open source project, I take no responsibility for any problems that may occur with your use of this PCB or design files. Create and use at your own risk.

  • v.04 Sneak preview: 1/2 width PCB

    Alexander Williams07/08/2022 at 14:22 0 comments

    Here's a sneak preview of v.04:

    It has some important changes which I'll list below:

    • The PCB is now exactly HALF the width of the v.03, at 50x22mm (instead of 50x44mm).
    • It's a 4-layer stackup instead of 2-layers, with 3.3V power and ground planes in the middle.
    • Through-hole 5V DC-DC converter is now SMD but has a max 12V/1A (15V absolute max)
    • Through-hole RS485 IC is now SMD and runs at 3.3V instead of 5V.
    • Through-hole fuse is now SMD 24V/1A (trip 1.8A).
    • GND and VIN are now simple pin headers instead of a large terminal block, since current is limited to 1A anyways.
    • DE and RE pins are tied together (to GND with 10K resistor, i.e: receive mode), but can be set to drive mode (to 3.3V) through a DIP switch. This means it's not possible to disable the RS485 IC anymore.
    • 8-pin JST output header is now a 2x4-pin female socket header, and since DE/RE are tied, there is now a third GND pin on the header.
    • Jumpers JP1 and JP2 can enable sending GND and VIN through the RJ45 connector. Previously only VIN had a jumper and GND was always connected through the cable.
    • Resistors R3 and R7 are unpopulated 0805 pads for 20K biasing resistors on the A/B differential pair (A to 3.3V, B to GND).
    • There is a 10K pullup resistor on the RO line, and a 10K pulldown resistor on the DI line.
    • RJ45 shield pins are now grounded.
    • Capacitors are all ceramic instead of electrolytic.
    • Mounting holes are now M2 instead of M3 and they are NOT grounded anymore.
    • There is a new blue Power LED indicator at the edge of the board.
    • Changed the shape of the PCB and removed one mounting hole. The asymmetry would make it impossible to mount incorrectly in an enclosure (a legit problem I had with v.03).

    That's a lot of changes, but why?

    It's been over a year since I designed the v.03 board, and I've learned quite a bit more about RS485. In particular, I realized that "forcing" biasing resistors on every device, was not a good idea. Typically one might only need biasing resistors on ONE device on the bus.. not all of them. Also since the device is not always connected to an MCU, I made sure the default configuration forces the device into Receive mode by pulling down the RE line with a 10K resistor, rather than pulling it up like in v.03.

    It's also not always required to send GND through the RJ45 cable (as a common ground) depending on the environment.

    Since those things are user-defined, I picked the sane default to pull-down DE/RE, and leave the other pads unpopulated for those who "know what they want" - and 0805s should be reasonably easy to add by those who "know what they're doing".

    Finally, I wanted a much smaller and more compact board with less through-hole components.

    What functionality changed?

    Pretty much nothing changed from a functionality perspective, except for the lower VIN (was previously max 28V).

    Is this available yet?

    No, I just sent them to be manufactured, so I expect to have and test these boards around the middle or end of August (latest).

  • Version update coming: new project

    Alexander Williams06/30/2022 at 23:41 0 comments

    I've designed and built a new model of this board, except it's a bit different and has a completely different layout and PCB board size.

    For that reason, I'll be publishing it under a new project, and the best part is it works perfectly with this board.

    This board will also receive a revision (v.04) with more SMD components.

    More details in August, as I wait for, and test the first prototype.

    Stay tuned...

    PS: Here's a hint - μHAT ;)

  • Available on Tindie!

    Alexander Williams08/03/2021 at 23:06 0 comments

    It took a while, but I finally put the modules up for sale on Tindie!

    Get it here

    I'll publish the wiring diagram and soldering instructions within the next few days.

  • A box for this module

    Alexander Williams06/14/2021 at 08:59 0 comments

    I spent a few days designing a stackable box for the module. I've finally successfully 3D printed a prototype of the bottom part (still missing the top/cover for stacking), here are some photos:



    It's a bit underwhelming, so i'll keep iterating on this until it looks awesome.

  • A pinout for module v.03

    Alexander Williams05/22/2021 at 03:19 0 comments

    I made a pinout for the v.03 module and thought I'd share it here. It'll be part of the documentation which I'll publish hopefully within the next week.

  • Initial tests with v.03: success!!

    Alexander Williams05/18/2021 at 05:30 0 comments

    I soldered the components onto two v.03 modules and ran some initial tests with a string of 5V LEDs, so far the modules work perfectly!

    "Off" mode, set through the DIP switches also works as designed.

    I'll continue some load and noise tests, and post another update once that's done.

  • Yay, v.03 boards have arrived

    Alexander Williams05/17/2021 at 09:20 0 comments

    It took a few weeks, but the new boards are finally here!

    I tried adding thermal vias throughout the board, but it seems the soldermask covered them. I'm not sure if that's better than leaving the vias open, but my guess is it'll at least prevent solder from the through-hole components from being wicked through the board.

    The first order of business is to solder the through-hole components, run some tests and ensure they work as designed.

    If all goes well, I'll put the kits up for sale on Tindie.

    Afterwards i'll (finally) upload schematics and gerbers etc to GitHub.

  • Kit components for v.03

    Alexander Williams05/03/2021 at 01:41 0 comments

    Here are all the components included with the v.03 kit (without the board):


    In total there's exactly 40 solder points, and there's a recommended order for soldering the parts which I'll explain in the provided documentation.

    The 120ohm resistor is optional, depending on the setup of you modules/system. The 3-pin 2.54mm male headers, DIP switch, 8-pin JST-XH header, and 2-pin screw terminal are also optional depending on how you want to connect/use the module. The fuse is rated at 500mA (trip 1A) and can be swapped for a larger fuse if more current will be drawn. The 5V switching regulator is rated at 1A and can also be swapped for a larger one. Finally, the RS-485 transceiver (MAX3088) can be replaced with another one that's pin compatible (ex: MAX3085) but check the datasheets to ensure the pinout is the same.


    I can expect to put the board and kit up for sale on Tindie within the next 3 weeks - assuming all goes well with the v.03 boards.

View all 17 project logs

  • 1
    Buy the kit or DIY

    I am offering these boards/modules for sale (in kit format available on Tindie). If you want to DIY the boards, please check GitHub.

  • 2
    Solder the components

    Every component is through-hole, so it's difficult to mess up. The only issues I can see are:

    • placing the microcontroller (MAX3088) incorrectly
    • shorting pins during hand-soldering

    Otherwise there's no real skill required.

    The board and components are lead-free and RoHS compliant.

  • 3
    Set the slide switches

    The DIP slide switches are in the OFF position by default (down, facing toward the edge of the board).

    This setting puts the MAX3088 in driver mode (it sends data) because the RE and DE pins are pulled up to 5V by default, but this setting also allows one to control the RE pin through an external MCU.

    The settings are printed at the top of the DIP switch:

    • 1-2 OFF = RE and DE are brought high, the MAX3088 will be in driver mode (it sends data)
    • 1-2 ON = RE and DE are brought low, the MAX3088 will be in receiver mode (it receives data)
    • 1 ON, 2 OFF = DE tied low, RE tied high, the MAX3088 goes into low-power mode and disables both send and receive

View all 6 instructions

Enjoy this project?

Share

Discussions

Peabody1929 wrote 07/28/2022 at 19:07 point

Is it possible to use these modules in multi-drop applications?  This is like the original idea behind Ethernet and many early network interfaces .  Each node has a Tx and Rx pair connected to a single twisted pair.  Everyone listens for a message with their address.  One node sends a message to a specific node address.  The receiving node replies with an acknowledgement message.  The HDLC protocol would work nicely in this app.  

  Are you sure? yes | no

Alexander Williams wrote 07/29/2022 at 04:05 point

Yes they would work perfectly for the application you described. The modules are protocol agnostic, so you can use whatever you want. It's different from CAN bus which enforces its own protocol (which has advantages too). In the older module (v.03), there are pre-soldered biasing resistors on the differential (a/b) lines. This could be a problem in a multi-drop situation since you only need one node to have those biasing resistors. The v.04 solves that by omitting them, but there are hand-solderable pads if you want to add the 0805 resistors yourself on ONE of the modules. The v.03 and v.04 also provide space for an unpopulated through-hole terminating resistor (typically 120ohm on a cat5 twisted pair cable). The terminating resistor would only need to be added to the two end-modules on the bus.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates