For the update, I'm abandoning the RFID idea, it wasn't a great one to begin with and has a bunch of issues. My other solution now is to use linear analog hall effect sensors. This was actually my initial idea, though now I'm a little more realistic about the approach. Here is how I imagine it will go down:
There is a linear hall effect sensor at each peg hole.
The software, on startup and probably with a manual switch, will go through all the sensors and take a calibration measurement and store it in memory (somewhere).
When a magnetic peg is placed in the peg hole, the sensor will note the magnetic flux changes beyond a pre-determined threshold. The peg's magnet will have either a positive or negative orientation towards the sensor.
Because we have a lot of sensors, the signal will be multiplexed into a serial packet to a controller CPU, which will then lookup each value in the calibration table and see if the signal from any of the pegs has met the threshold. It will then create a simplified serial data packet of 0, 1 or 2 to denote negative, null or positive magnetic field.
That data is then sent to the program that manages the animation and plugs it into that program, controlling the LED pegboard.
As an aside, this presents an opportunity, if i'm crafty enough with my coding. If I have 3 different states per peg, that means I could create a 2x2 peg, sort of like a 4 legged table, with configurations of pos, neg and null pegs on each of the 4 legs to generate, I think, up to 39 different configurations (with logical limitations, eg, can't have a totally null 2x2 peg component). This was inspired by braille. I would just need to be able to note when multiple pegs are placed within a certain time frame of each other and in what 2x2 configuration.
MULTIPLEXING: How well will multiplexing this many sensors work? My initial plan had unipolar digital hall effect sensors. Recently I realized I can use a linear hall effect sensor to get 'no magnet', 'negative field', and 'positive field' states, which means multiplexing instead of a shift-register array. I'm not sure multiplexing that many sensors would be feasible or even worth the pain. I've never multiplexed in a project, so while I know how it works in theory, I'm a little in the dark as far as the limits and opportunities that offers outside of analog data.
I've also learned about DAQ, but I'm not sure that would be applicable to this project. I am willing to spend money to save time and increase reliability, since a pre-built solution will probably save time over manually creating all the components.
RELIABILITY: Linear hall effect sensors are cheap. Great, except I'm not sure I can rely on 2,000 of them to be reliable over months or years of use. Does anyone have insight on the sensors? Right now I"m looking at 49E linear hall effect sensors, data sheet here.
CALIBRATION AND PROCESSING OVERHEAD: This is probably a software question and not really relevant to this forum. That said, if anyone has insight I'd appreciate it. What is a good scheme for storing and reading this data? I will need to create a table (or even just a JSON file) to hold the calibration data. I'm concerned this will create a lag in the responsiveness of the board. I am probably going to have it all dump into a main controller like a PI4 where the data is stored, compared, and then converted to the 0, 1, 2 serial data to send to the display controller.
I won't have a ton of time for testing once the Pegboard and Hardware are built, so I'm trying to get ahead of any possible issues. I also CERTAINLY do not want to have to undo work to fix a dumb assumption on my part, so any help will keep my heart health in the green.
Have you already tested how long it takes to read that high number of analog inputs? I'd look for stand alone multi-channel ADC or controllers which can do their work in parallel.
[EDIT: I'm pretty sure I'm misunderstanding the purpose of multi-channel ADC vs DAQ. I'm still doing research]
Actually, I am trying to figure out what is the best approach for handling all of them. I don't think there is an ADC DAQ that can absorb 2000 sensors, the market for DAQs is very diverse and very confusing. For example, here is one that takes 16 analog pins for $155.
Below is a stab at what I think might work, but again, I'm not familiar with multiplexing or multi-channel ADC. It is all assumption based on what little I know, so correction is appreciated.
So, for multiplexing, I can connect sensors to a multiplexer create a SPI or I2C data output. I would then need to multiplex those multiplexed data lines into a single data packet or message. Splitting up the multiplexers may or may not save me time, but organizationally will be crucial. If i am using 32:1 multiplexers, I'd need 63 to handle all the sensors. After that, I assume I could use a couple more to convert it all into a single data message, or run it into multiple inputs on the controller device which will look up the calibration data and compare it.
Ideally, There would be some sort of super ADC which would take all the sensors at once and process them, but of course 2,000 is way too many for that... I assume. Who knows, maybe there is a product that handles that many.
Would I be able to introduce a DAQ like above to this scheme to improve reliability and speed? Is this going to gobble a ton of power? I may just limit the number of analog inputs to 100 or so and make the rest of the sensors digital on-off switches if this is a non-starter. I don't want to disappoint the client, but less functionality is better than buggy and bad functionality.
Back up a step - why do you want an analog signal? Is the situation not PEG or NOT PEG?
There are many magnetic sensors on the market that deliver a digital signal. Surely, reading that many digital points is going to be more cost effective, and simpler, than that many analog signals. IOW, I think you're down a rabbit hole, and can't see anything but dirt right now.
Yes, thanks. My initial concept was binary, but I want to provide at least some pegs which have more than one value, think letters or numbers. I was thinking RFID, but bailed on that idea as I mentioned earlier. Thinking about how to use Pos, Neg, Null inputs, I think I can get a high variety of inputs with 'combo-pegs'. It would also be nice to have 2 states per peg for other types of games on the board. I acknowledge doing that many analog pegs may not be feasible, but I would like to game it out as far as possible before testing.
One last thought, what about colour? Maybe, a peg with black or white stripes and optical sensors on the side of the hole? I think full RGB sensing would be cost-prohibitive, but you might find a black sensor, white sensor. Not sure what's out there.
Another option, transparent gaps in the pegs. Not sure of your peg size, but if you could do transmission sensing through acrylic, or may be holes drilled in the pegs, would that work?
Just food for thought.
Back to your Analog gambit.
How long are the pegs? Is there enough room for two magnets, one on the end and one half-way down the peg, that could activate separate magnetic switches? Or could you just run groves around the peg and use mechanical switches?
The design is such that all the electronics are behind a sheet of acrylic for the safety of the electronics and the children. A lot of the design questions were handled in the previous post, along with schematic drawings.
The pegs themselves are just transparent acrylic rods, about 3-4" long and 1" diameter.
Thanks, yes we did consider RGB sensors or any optical sensor, but the nature of the LED pegboard is that the peg activates an LED light, which I imagine will saturate any sensor and keep it from detecting the removal of a peg, unless the sensor is on the other side of the acrylic, which is not something that will work with the overall design. The acrylic itself is frosted, so there is a lot of light scatter.
I'm not sure I'm following the concept of transparent gaps in the pegs. The pegs themselves are just transparent acrylic rods, about 3-4" long and 1" diameter.
Yeah, I'm really trying hard to avoid just having the entirety of the pegboard be on or off just because it limits the types of interactions I'd like to produce with it. The hall effect sensor is really the best from an interactive standpoint, but as you are seeing, can be problematic if I'm trying to do anything analog or more complex data.
From what I know about hall effect sensors, unipolar pulls down in a magnetic field then will pull up when it is removed. A bipolar hall effect sensor will pull down (or up , i forget) when the negative end of the field is close, but retains the pull down state until a positive field is introduced, which pulls up the sensor and stays that way until the negative is brought back. At least, I think that is right, that is how the bipolar sensors I bought work anyway. Is there another type of bipolar sensor which will also give me pos, neg and null reading that isn't an analog sensor?