Good evening fellow Arduino-ers, Arduino-ists?
This is my first ever foray into the world of microcontrollers or electronics so I am come cap in hand looking for guidance on my first project.
I have recently bough the Arduino starter kit and the Dummies book which I have read cover to cover and have used to do some of the projects.
Armed with this freshly learnt knowledge I am now embarking on my first project.
I have decided to split this project into 2 parts to help me understand the hardware and the software side better so this thread post will be for me to get assistance on the hardware side of things which I can then control using the Arduino sketch.
And so to the chase...
Aims and Objectives
I have a device in my car which I wish to use my Arduino to control its ON/OFF state.
Basics:
- Device to be controlled is IGN battery voltage (12-14V), draws 70mA when on and "at rest" which rises to 700mA when ACTIVE.
- Controlled device should be on when IGN is turned on, but can be turned ON/OFF anytime thereafter.
- There are 2 push to close buttons on the steering wheel that I wish to use to turn the device off and on.
- I propose to use my Arduino to detect the change in voltage on two separate wires as each button is pressed. Each wire has a constant 5V which drops depending on the button pressed (each push button has a resistance)
- There are other switches on the steering wheel that also affect the voltage on these two wires, however each button changes the voltage to a specific value, all different.
- The two buttons affect as follows:
ON button - drops steady state voltage from 5V to 4V, has a resistance of 1982-2063 ohms, thus current of 1mA - 2mA
OFF button - drops steady state voltage from 5V to 3V, has a resistance of 708-737 ohms, thus current of 4mA - 6mA
The OFF button will almost always turn the device OFF when it is in its alert state and thus drawing 700mA at 12-14V.
I have formulated an idea of using an NPN transistor to switch the GND side of the controlled device and I put together a circuit diagram as follows:
So switch 1 and 2 will drop the inputted voltage to the Arduino from 5V both, to 3V and 4V when the buttons are pressed. I think I know how to detect that voltage using the software (analogRead 3V=613, 4V=818) and that software part comes after I have settled on the hardware to control the device. I appreciate this may not be the correct way of doing this however given the Arduino outputs 5V when asked, I thought that that predictable output could be assumed to be a constant value with which to switch my controlled device.
So onto my plethora of questions..!
Q. I believe an NPN transistor should be happy switching the controlled device by affecting the GND but what one would I need for this?
Q. Several sources I have read suggest placing a resistor in series from the Arduino to the transistor Base pin, but what should that be given the current draw of the controlled device?
Q. For simplicity and finesse I may opt to use the same 12v input for both the Arduino and the controlled device effectively using the Arduino as a switched power supply that the device "plugs into." Will that affect the circuit design in any specific way?
Please critique my logic and circuit idea if they aren't sound, I'm here to learn! I'm open to suggestions on how to control that GND except for a mechanical relay. I just don't want a big box like that messing up what could be a very small and neat solution.
Many thanks for taking the time to look and comment, it is genuinely very much appreciated.