Disabling and enabling power supply to another device depending on situation

Hi, I have a project in hands and I need your help.

You see, I make homemade card readers for the SEGA Naomi arcade system. They are fully working, but there is a little incovenient.

In some devices (let's call the Naomi cartridges where the reader connects), there exist "bad loads". I'll explain it. I have attached a photo.

When the game is correctly loaded by the Naomi, the reader works this way: the marked yellow led blinks after 8-12 seconds one time, and after that every second there is a micro-blink. That's a good load.

When the game is not correctly loaded by the Naomi, the reader works this way: the marked yellow led blinks after 8-12 seconds one time, and after that never more. That's a bad load.

When a bad load occurs, I simply cut the power supply of the reader, put it again and the Naomi repeats the same process until the game enters (in some cases it has to be done many times). The Naomi system doesn't need to be reset, it's only the reader.

The reader works with 5V in voltage. You'll see, I have this in mind. I want to put an arduino board that makes this inside the reader:

  • Powering on the reader, the arduino will wait 12 seconds. After the 12 seconds, I want the arduino to check in the next 2 seconds if the positive pin of the yellow led is receiving power (any micro-blinks). If that occurs, do nothing until the next power up of the reader (here the arduino must stop working).
    If the arduino after the 12 seconds detects nothing in the positive pin of the yellow led, cut the 5V of the reader and power up again automatically. I want that in loop until a good load happens.

Is this very complicated? Many thanks for all the help you can give me.

305010014_1.jpg

A simpler solution might be to use a Light Dependent Resistor to "see" the light from the LED. That way you don't need to interfere with the existing circuit.

The code to check for blinking should be very straightforward - something like this

void loop();
  static unsigned long brightSensorTime = 0;
  static unsigned longstartMillis = millis();
  byte sensorVal = digitalRead(sensorPin); // could be the LDR or whatever other way you are using to detect the LED
  if (sensorVal == HIGH) { // assumes HIGH means LED is lighting
      brightSensorTime = millis();
  }
  if (millis() - startMillis) > waitTime and brightSensorTime > startMillis) {
      // the LED was lighting at some time during the waitTime
  }
}

...R

Only with that code??? Really? Many thanks!!!!

Robin2:
A simpler solution might be to use a Light Dependent Resistor to "see" the light from the LED. That way you don't need to interfere with the existing circuit.

The code to check for blinking should be very straightforward - something like this

void loop();

static unsigned long brightSensorTime = 0;
  static unsigned longstartMillis = millis();
  byte sensorVal = digitalRead(sensorPin); // could be the LDR or whatever other way you are using to detect the LED
  if (sensorVal == HIGH) { // assumes HIGH means LED is lighting
      brightSensorTime = millis();
  }
  if (millis() - startMillis) > waitTime and brightSensorTime > startMillis) {
      // the LED was lighting at some time during the waitTime
  }
}




...R

Hi. Where do I have to connect the LDR in the arduino (in my case I'm going to use arduino nano) and the LDR to my reader? (I suppose I have to connect the LDR to the yellow led somehow.

tailsnic_retroworks:
Hi. Where do I have to connect the LDR in the arduino (in my case I'm going to use arduino nano) and the LDR to my reader? (I suppose I have to connect the LDR to the yellow led somehow.

You just need to locate the LDR so the light from the LED can shine on it.

The LDR needs to be paired with a fixed resistor to make a voltage divider. Try 68k for the fixed resistor. The connections should be like this

 5v ----- fixed resistor ------|--------LDR--------GND
                               |
                        Arduino I/O pin

...R

Robin2:
You just need to locate the LDR so the light from the LED can shine on it.

The LDR needs to be paired with a fixed resistor to make a voltage divider. Try 68k for the fixed resistor. The connections should be like this

 5v ----- fixed resistor ------|--------LDR--------GND

|
                        Arduino I/O pin




...R

I really appreciate your help. Thanks