2

Having DuPont cables like on the picture...

DuPont cable coloured -- for what I have in hands.

... and the RFID RC522 reader with colored wires as found in one of the tutorials.

Colors on pins

I know that copper is the same inside of the wires. Anyway, is there any standard or de-facto standard of assigning colors to the meaning of the pins? Black for ground and red for +voltage are known from elsewhere. But what about all the other pins? Here is the detail view for better readability:

Colors and pins.

3
  • 1
    Nope, there isn't., except for black for GND and red for Vcc, but even these are just conventions.
    – StarCat
    Feb 23, 2022 at 22:07
  • 1
    btw: do you wire this for SPI or for I2C? for SPI don't wire SDA and for I2C don't wire MISO and MOSI.
    – Juraj
    Feb 24, 2022 at 8:16
  • @Juraj I2C. The SPI was just example. The question was meant to be more general.
    – pepr
    Feb 24, 2022 at 8:24

1 Answer 1

7

No, there is no standard. However:

  • Red is often +5V
  • Black is often GND
  • I often assign colours numerically according to the resistor colour code:
    • 0 - Black
    • 1 - Brown
    • 2 - Red
    • 3 - Orange
    • 4 - Yellow
    • 5 - Green
    • 6 - Blue
    • 7 - Purple
    • 8 - Grey
    • 9 - White

You may have noticed that that's the same order they appear in the cable too, which is helpful. It's handy when working with things like 8 bit data buses, since you can then easily identify which wire is which.

In some disciplines there are standards, like for audio red is right and left is white (that's the little rhyme I use to remember), and of course there's regulations defining colours for mains cables, but for this kind of thing just use whatever makes sense to you.

1
  • Thanks for sharing your experience.
    – pepr
    Feb 24, 2022 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.