Hello brains trust. I know this might be similar to other posts in which case happy to be directed to them. I'm hoping to use an arduino to open/close a linear actuator on receiving a 12 V DC/150 mA power on signal from a Denon amplifier. I understand this being > 5v can't be received directly in to the arduino, does anyone have any smart ways to achieve this?
Update - ok, have found that I can use a voltage divider to drop the 12v to 5v and then presumably use any arduino pin. Can anyone confirm this is the correct way? Below is a link to a simple 2 resistor voltage divider circuit, I can chose appropriate resistors to drop the 12v to 5v, input directly to any arduino in pin? And connect all earths - the ardunio earth and the Denon amp earth - together
Hi Steve - thank you for the response. I'm not at all familiar with electronics. You're agreeing on the use of a simple voltage divider? The 12v coming from the Denon amp would be pretty reliable I'm guessing as it would be stepped down from the mains voltage supplying it. Is your concern that if it fluctuated that it might not be read by the arduino? I haven't made the circuit yet, I'm assuming it will either be high or low, which would be perfect as if High - open actuator, if Low, close actuator (it opens/closes a cabinet hosing the centre speaker and I want it to do so automatically when the Amp is on/off.
If you are sure that the 12V would not go above 12V, then a simple divider with no Zener is OK. Personally I would aim for 4V which is still a logical high.
It's not something I would do in a commercial project- for that I would include a Zener diode to protect the 5V input of the Arduino. 4V will work as a logic high, though a purist would want 5V. The processor doesn't care either way.
Hi Steve, thanks for all the info. I hope you don't mind but I have a few more questions. How would the zener diode be included and what size? It appears from an internet search it is included in parallel with the second resistor, I'm looking at using the voltage divider with 2.2 / 1.1 kOhm resistors which drops the 12v down to 4v. And I assume I would tie the Arduino earth in to the negative side of the 12v feed from the Denon Amplifier so as to get the 12v potential?
You want the voltage divider to target 4V and the diode should be a 5V Zener. The input pin on the Arduino would be protected, but 4V is still a valid logical high. If there is any risk of the 12V source going above 12V, then a current limiting resistor is needed in series with the Zener.
As a rule of thumb, except for exceptionally rare conditions which you are unlikely to ever experience (I had to say that for the benefit of the purists that hate it when I say...) all grounds must be connected together.