Introduction: How to Match Socks?

How to prevent socks mixed up during the laundry? I do not know.
What I do know is how to match the socks after the laundry.
Therefore I made this SOCK MATCHER.

How does it work?

1) Start with stitching a RFID-tag in each sock of a pair socks.
2) Keep one of the socks up front of the sock matcher.
The display’s indicates it is a new sock. On the RFID-tag will be written a follow-up number of pairs.
After it is written you shall be asked to keep the corresponding sock to the sock-matcher.
3) Keep the corresponding sock to the sock-matcher.
Also on this RFID-tag same follow-up number will be written.

From now after keeping one of the socks next to the sock-matcher the number of the pair shall be given.

How is it made?

Step 1) Introduction / Quick version

Step 2) Atmega328 on a breadboard / solderingboard

Step 3) Connecting the LCD to an Arduino Uno

Step 4) Connecting the RFID-RC522 to an Arduino Uno

Step 5) Programming the ATmega328

Step 6) Boxing

Step 1: Introduction / Quick Version

Shopping list:

· 1x LCD 4x20 with Hitachi HD44780 driver or compatible
· 16x Male pin connector
· 1x RFID-RC522
· 1x 5cm x 7cm soldering board, 2.54 mm raster, 18 x 24 rings.
· 1x USB-B connector
· 7x Male pin connector
· 16x Female pin connector
· 1x Atmega328p
· 1x Socket PDIP28
· 1x Chrystal 16Mhz
· 2x 18 tot 22 picofarad (ceramic) capacitor
· 1x 10k ohm resistor
· 1x 10kohm pot
· 7x wire’s with on both side’s female connectors
· 1x Arduino Uno for programming.
+ wires.

And I almost forgot to mention the RFID tags 13.56 MHz Mirfare for the socks.

All basic stuff what can be ordered at electronic shops.


As above

Board lay-out
The solderedboard is directly connected with the 16x Male pin conecctor of the LCD.
The LCD shall be mounted at the top of the box.
The RFID-RC522 is connected with female wires to the solderingboard.
The RFID-RC522 is mounted at the front of the box.
Actualy the voltage to the RFID-RC522 shuold be 3.3V I forgot but it works for me.
I noticed this comment at the github "SPI only works with 3.3V, most breakouts seem 5V tollerant, but try a level shifter.") So be carefull.

For programming I removed the ATmega328 from the Arduino Uno.
Placed the ATmega328 in the Arduino Uno and made the upload to the ATmega328. The ATmega328

After the upload I tested it on a breadboard as within the picture above.And after succeful testing I replaced the ATmega328 to the solderingboard.


Goal of the box design is to make it in such way:
- it is reusable partly for other projects.
- assembly just by hand
- and disasemled it must fit in a letterbox.

The box is drawn in Fusion360.
The box is printed 3D by a fellow maker."Joost" found with 3D Hub.
Lessons learned.

- By making doubling of components within Fusion 360 the block would not printed.
This explaines the missing theeth.

Step 2: Atmega328 on a Solderingboard

First of all I found it verry usefull to first try everthing one by one on a breadboard.
1) The LCD with an Arduino UNO.
2) RFID_RC522 with Arduino UNO
3) Atmega328 on a breadboard.
4) Atmega328 and LCD on a breadboard.
5) Atmega328 LCD and RFID_RC522 on a breadboard.
6) Atmega328 on a soldering board.
7) Atmega328 and LCD on soldering board.
8) Atmega328, RFID_RC522 and LCD on soldering board.

To create this "SOCK MATCHER" a made the microcontroller on a soldering board.

How to install a microcontroller on a breadbord is explained on the Arduino site.

From a breadboard to a soldering board is just the next step.
It look like as within the picture above.

For the wirirng see the graphic diagram.

Step 3: Connecting the LCD to an Arduino

For connecting the LCD to the ATmega328 a complete instruction can found on the Arduino website:

Different from the tutorial are:
- I used a 4x20 LCD

- and the Arduino UNO pin 12 and 13 where not used but pin 6 and pin 7 because pin 12 and 13 are used by te RFID_RC522.

Two points I noticed during installation where:

1) to be carefull is the LCD kathode and anode connection pin 15 and pin 16 can be twisted depending on the vendor. The cathode must be on GND.

2) I used a 4x20 LCD and I had to set each line because it jumped direct from line one to three. Example: lcd.setCursor(0,1); lcd.print("example text"); lcd.setCursor(0,1); lcd.print("The next line of the example");

Step 4: Connecting the RFID-RC522 to an Arduino Uno

After I recieved the RFID_RC522 I tried getting it working finaly I found the library MRFC522.h and examples. See the link.

Step by step I tryd to get it to do want I want it to do with it.

1) Reading the UID (Unique Identification Code)

2) Compare the UID from differend RFID tags.

3) Read information on a RFID tag

4) Write the inforamtion on the RFID tag.

5) Clear written information of the RFID tag.

I am not sure but it looked that the writing to the RFID-tag improved after installation of the last library.

Step 5: Software

When that worked I started with writing the program.

During writing I noticed I needed to store information (number of pairs) on the Atmega328 what would not be losed after a power break. This is done on the EEPROM of the Atmega.
How this works is clearly explained on the Arduino website:

Most difficult was to keep the RFID reading functioning.
I had difficult with reading and writing a tag direct in once.
Not continously reading had to do with searching for a new tag and stopping the RFID reading.

The final set-up of the programm whas to write a case for each reaquired action.

A description is written in the introduction of the software

The software is within the introduction/quick version.
Attached above is also a program to clear the RFID tags for testing.

Step 6: Boxing

Goal of the box design is to make it in such way: 1) it is reusable partly for other projects and extendible
2) can be assebled just by hand or easly
3) and disassembled it must fit in a letterbox.

Idea is that when you for examle decide to use a OLED display you only have to change the top of the box.
Or if you want to add LED's, button's and such you only have to modify the front.

Because I had no experience I started with a small box ... cute.
This was a success, thanks to fellow maker."Joost" who I found with 3D Hub, who adjusted the drawing after the first test print was made.
He works with an original Prusa i3 MK2. As material I selected PLA/PHA = Colorfabb. A blend of PLA/PHA. With little better performance than the standard PLA.

The small box is 5cm width and the teeth’s are 5mm high, width and depth.
The box is drawn in Fusion360.

By making doubling of components within Fusion 360 the block would not printed.

This explains the missing teeth.

I used inches for the basic measurements based on the design of the Arduino Uno and the size between the soldering slots. 100 mil = 0,1 inch = 2,54 millimeters.

The "teeth’s' are 200x200x200 mil. Where I tried to make the "teeth’s" smoother by rounding the corners.
This caused the parts did not fit.

These "teeth’s" are reduced to 180 mil x 180 mil x 200 mil. What made it a littles bit to lose.

So the exact width shall be determined in the next project (I think 190x190x190).
The board inside surface is used as basic reference in inches/mils. So when decided is to reduce or increase the thickness of the wall the board layout won’t be influenced.

Wall thickness is now 100 mils with 45º corner. See drawing for explanation.
From the Fusion360 the drawing where transferred to STL by selecting "Cura" as print Utility.

I had problems with writing the RFID-tags so I removed the distance holders of the RFID-RC522.
With tape I fixed temporarily, so this can use an improvement.

Also I changed the RFID read indication on the front with a more open design

The final attached drawings are not yet used, so no guaranty for the drawings.
If used please let me know if these where accurate.

Why is it orange? Maybe because it is Dutch?

To give you a clear indication how it should fit I created this animation.

And the links to the drawings.

Bottom , Back_side , Right side

Left side , Front , Top

Clamp, LCD 4x20 , soldering board

basic blokkje RFID_RC522

I hope you liked this Instructable and made you to decide to make your own sock matcher. Or it was helpfull to make something else.
Best regards, Gaby


Yavnik (author)2017-01-18

OMG!!! The best use of Arduino and RFID I'VE EVER SEEN!!!! Definitely gonna vote for you!!!

pauwy (author)Yavnik2017-01-19

Thanks :)

nqtronix (author)2017-01-17

This is one of the things I never knew I needed! I guess you could also track "times worn" very easily. How are the RFID tags attached to the socks? How do they feel when worn?

pauwy made it! (author)nqtronix2017-01-19

Good question, have not
used it yet in real life. The reason is because I am investigating what would be the best type RFID-tag versus price. At get a small amount for a good price is difficult. There are different type of RFID
tag’s. The most likely to use is RFID-tag looking like little button’s, as you can see in the picture below. If you stitch them at the outside I guess you want notice when you wear it.

KileL (author)2017-01-17

I'm curious... Where did you source the laundry tags. The cheapest I could find was still $2.00/ea which would add $4.00 to the cost of a $2.00 pair of socks. It's a neat project though and I liked the thought that went into it. I'm sure if we could convince sock makers to embed rfid tags in their socks this would take off. :-)

rafununu (author)KileL2017-01-18

You can find tags cheaper than 0.8€, arround 1$, but you've got to buy 100 pieces.

Swansong (author)2017-01-17

We need one of these! :D