I’m about to buy components for my first Arduino project: Reed contacts for my model railroad (H0 scale) to detect track usage. I don’t want to use special shields, but use as few components as possible to directly connect the reed switches to the Arduino.
To make good use of the Arduino Nano, I’d like to use an input matrix. Let me summarize, how I understand the matrix (here it’s 4 by 4, but with 14 digital IO pins, I could have a 7 by 7 matrix, right?):
To see the closed contacts, I switch on the one of the inputs at a time (I, R1, S1, T1) and read all of the outputs (N, O, P, Q). If R1 is active and I receive a high on O and P, then both of the middle contacts would be closed.
Since I’m a real newbie here, I’m unsure about the specs I should look for in the reed switches and the diodes. Also, do I miss any components (resistors?) or are switches and diodes enough?
This application is not very demanding and you're you're going to be buying a lot of parts, so just buy the cheapest ones. 1N914 or 1N4148 diodes are usually inexpensive. for the reeds shop around. you probably want glass ones as they are harder to bust than plastic ones.
Resistors are a good idea, you could use the arduino's internal pull-up but using a lower resistance (like 1K) will help noise immunity, and an electroc model railways is probably electically noisy.
backing your table-top with foil connected to the arduino ground and running the wires below the foil will probably help with the noise too,
Answered by Jasen on November 26, 2020
2 Asked on December 5, 2020 by mahmoud-maarouf
0 Asked on December 5, 2020
2 Asked on December 4, 2020 by sizu-taylorventuresllc
1 Asked on December 4, 2020 by esilik
0 Asked on December 3, 2020 by crj11
1 Asked on December 2, 2020 by vladimir-martynenko
0 Asked on December 2, 2020 by beatriceuk
1 Asked on December 2, 2020
1 Asked on December 2, 2020 by nalostta
3 Asked on December 2, 2020 by ryantuck
0 Asked on December 2, 2020 by sahithi
1 Asked on December 1, 2020 by diego-colombo
0 Asked on December 1, 2020
1 Asked on November 30, 2020 by bunyamin-tamar
3 Asked on November 29, 2020 by pooya13
1 Asked on November 29, 2020 by digitalnewbie
Get help from others!