New Project - Gameshow Buzzers (Host Lockout, Buzz-in Order, Lighted)


I am working on my first real project, and will probably need some guidance.

The first thing I’m trying to figure out is:

I have my Arduino and Breadboard mounted in an X-Box Case with RJ 45 ports around the sides so that I can plug devices in. I’m hoping that this will allow the Arduino box to be easily repurposed by using different peripherals plugged into RJ ports. I’d like to detect presence so that I can keep the loop speedy by telling the instructions to skip any player index that has a pStatus==0.

I am wondering how I can detect whether a peripheral is plugged in. I imagine some sort of:

for (int i=0; int<peripheralCount; i++)
  digitalWrite (TestPower[i],HIGH);  //TestPower and testPin could easily be the LED circuit for the button?
  if (digitalRead(testPin[i])==HIGH) 
  digitalWrite (TestPower[i],LOW);

Hi Anthingy and welcome.

I see what you're getting at. But it strikes me that you should not need to waste pins to provide test power to each rj45 port. I imagine each port will have permanently wired +V and GND to power the peripherals anyway? In which case only a test pin is needed. The peripheral could simply short that pin to GND when plugged in. The Arduino would test for this by setting the test pin for that port to INPUT_PULLUP and reading the pin with digitalRead. A HIGH result would mean no peripheral.


If besides sensing the presence of a box, you also want to identify what it contains, you can use a resistor to pull test pin to ground. Then on the arduino side, use a pull-up resistor and sense the test pin with analog input. You decide what resistor value in the box represent what hardware. Again if there is nothing, the arduino pull-up resistor will pull analog read to maximal, or 1023. This has been in use for many simple systems to identify what sensors are plugged in which channel.