Relay function in reverse

Hi
As from the subject it should be clear that electronics is not (yet!) my forte. The programming portion of the arduino is more my field, but I first need to get around the electronic portion of the project.

In essence I want my Arduino to know when an external wire is switched to 12Vdc from GND. In short, as background, my garage opener turns on 12Vdc through closed limit switch when open. I wired into the switch and power on the opener unit and can successfully turn on LED when garage door is open. All I want to do now, is let my Arduino figure this out on its own. :slight_smile:

So, referencing the digitalreadserial example on this website, which reads the status of a button, I tried to use logic in determining the best solution. I only managed to to come up with a relay switch solution, where the higher voltage (12Vdc) switches the lower digital arduino circuit to HIGH (simulating the button press) and hence the subjectline: a relay in reverse.

I tried to use a Mosfet IRF520 with Gate as 12Vdc input and Drain and Source the connection to digital and ground pin of the Arduino (through resistor), but it seemed to overheat the mosfet so I decided to shelve the idea until I understand the electronics a bit better!

Would a Optocoupler or Relay (Reed relay maybe) be the solution or can the forum please advise on a better design that might not require a relay/switching solution? The current is very low (LED project works), but I can confirm this if required.

Thank you

Yes an opto coupler would be the ideal.

Alternatively you can cut down the 12V to 5V using a potential divider using two resistors.

Thanks Grumpy_Mike

I previously read up on the resistor divider solution. It however hinted that it is not the most guaranteed stable safe environment.

I will have a look at the optocoupler solution and post back for future reader information.