For an installation I am building as part of a team, we aim to make a bench that will have thirteen LDRs in its surface, hooked up to an arduino mega, with an electromechanical counter as their output, in an array (preliminarily) as shown below.
This is a plan view. The image is a little deceptive as the scale is off, but the small circles will be the locations of the LDRs, and the black rectangle on the left will be the location of the electromechanical counter. The arduino will be housed beneath the counter. CNC milled channels in the bench's surface will be inlaid with brass (maybe copper) flats to act as the wiring from the LDRs to the arduino. Here is a simple perspective:
The idea behind this is that when the LDRs are covered by people sitting on them, the LDR effects a change of the numerical readout of the counter - it shows the cumulative amount of people who have sat on the bench. The code also needs to be elegant enough that if one LDR and its diagonally neigbouring LDR(s) are covered, it only reads one person. The LDRs are spaced that if both are covered, it is very unlikely that two people will be there, but rather that one person is covering both.
The reason the central line of LDRs is there at all is so that if someone should happen to sit directly between two LDRs on the outer edges, they are very probably covering the central LDR. The outer edge LDRs are spaced so that people can sit between them so that they never sit on two horizontally adjacent LDRs, giving a false reading for two people.
I have never programmed for arduino before, but the language seems nice and logical, and I can't imagine too difficult, but I need to work out an elegant solution to code this with.
Actual questions:
- Is there an easier/more effective array of LDRs?
- I realise I need an 'if', but will i need to map every possibility, or is there some way of the arduino being told that the LDRs are set up in a certain way?
- Is a digital TRUE pulse to an electromechanical counter all it needs to create a cumulative total?
- Any other pointers/glaring difficulties you can spot in my description?
Thank you very much!