Basically, it should be so that the redstone comparator has to face outwards from the block the Armor Stand is standing on. With no armor, the signal strength would be 0. With full armor, the signal strength will go to 15, just like a full container block…
0 Pieces of Armor = 0 (umm.... that's obvious)
1 Piece of Armor = 4
2 Pieces of Armor = 8
3 Pieces of Armor = 12
4 (all) Pieces of Armor = 15
This isn't very divisible.... but a lot of rounding and cutting happens in other container block signals, especially chests who have lots of storage slots.
Now, I am aware that you can use ShowArms (for mapmaking/creative mode) to allow them to hold a sword. Honestly, I’m not too sure whether or not it having a Sword should just not do anything, or decrease the signal strength of a full armor stand overall and make it so that you can only get 15 strength with the ShowArms NBT tag. I think the second method is more feasible, as it allows good use for both creative and survival, as you can just put a repeater at the end of your redstone line at the correct distance to achieve full power with just 4 pieces of armor in survival mode (that sounds complicated).
Chart with arms as another signal giver:
1 Piece of Armor = 3
2 Pieces of Armor = 6
3 Pieces of Armor = 9
4 (all) Pieces of Armor = 12
4 (all) Pieces of Armor with weapon = 15
0 Pieces of Armor, just weapon = 3
As you can see, that idea with the weapon slot, is also fully equal and mathematically correct.
In the comments, others have suggested (although I hinted about it at first) that different types/tiers of armor/weapons should give off higher/lower signal strengths. I thought about it, and realized that the Armor bar on your HUD goes up to 8 units, or 16 half-units. It really bothers me, though, because the signal strength only goes off to 15, so we're like SOO close to being equal and mathematically correct, without any remainders. But, as stated earlier in this post, not all chests and containers detected by comparators are fully mathematically correct without any remainders, so, yeah, it's fine.
The following list/chart is optional, this may/may not be included if this main suggestion is implemented, and is just another feature that I thought was cool. It was not really part of the original idea.
Leather Chestplate: 3 signal strength
Leather Leggings: 2 signal strength
Leather Boots: 1 signal strength
Golden Helmet: 2 signal strength
Golden Chestplate: 5 signal strength
Golden Leggings: 3 signal strength
Golden Boots: 1 signal strength
Chain Helmet: 2 signal strength
Chain Chestplate: 5 signal strength
Chain Leggings: 4 signal strength
Chain Boots: 1 signal strength
Iron Helmet: 2 signal strength
Iron Chestplate: 6 signal strength
Iron Leggings: 5 signal strength
Iron Boots: 2 signal strength
Diamond Helmet: 3 signal strength
Diamond Chestplate: 8 signal strength
Diamond Leggings: 6 signal strength
Diamond Boots: 3 signal strength
The flaw in this calculation (which is almost 100% correct and flawless and just plain lucky) is that armor points go to 16, but the maximum redstone strength is only 15. So, if you have a full diamond armor stand, it will go over by 1 signal strength. Every thing else is fine. Later I will be adding the calculations with weapons involved.
So, really, why is this useful at all?
- Allows for cool detection systems
- Allows for interesting door locks and passwords
- Allows for armor security systems to detect if something is gone (this is cool if you want a bait armor stand and then you make the person fall down a 50-block trap)
- Allows for armor stands to interact with other devices, such as hidden passageways
I have a picture of how the comparator thing would look like.