# MAXIMUM INPUT VOLTAGE AND CURRENT

Hi,

Currently i am working on project, in which my signal input to arduino is 12V and 2amp, and i want to operate solenoid. i have managed outpote to operate solenoid by mosfet

IRFZ44. but i have query about Input signal(.

can i give directly to arduino???

or please suggest some alternative way.

chetan

in which my signal input to arduino is 12V and 2amp,

That does not make any sense. An input signal can be 12V but where do you get 2A from?

Are you talking about an output signal from the arduino to drive the solenoid?
If so you need a FET or transistor to drive it. Along with a diode across it.

You cannot sense the 12V directly and then have the arduino operate the solenoid, if that is what you are asking.
The 12V must go thru a voltage divider first to keep the voltage level at 5V or below:
12V (Vin)
|
|

< R1

|
| Vout to Arduino pin
|

< R2

|
|
Gnd

Vout = Vin * R2/(R1 +R2)
plug in what you know/desire, choose a value for R2, solve for R1:
5V = 12V * 5000/( R1 + 5000) => R1 = 7000 for Vout = 5V

and it appears you have the MOSFET control resolved.

Actually my project is working on logical condition.

You can understand by below code.

Where i mentioned push comment in actually LIMIT switch(Actually i have modified PUSHBUTTON code), and my limit switch is connected to 12v and 2amp battery. and i am

assuming limit switch is push button, when my push button get on, my solenoid (led in push button code) works.

after fulfill mentioned condition(in code) my solenoid will operate.

To controll VOLTAGE and amp, i am giving signal input to 7805 and 7805 output to arduino digital pin,by this way i am controlling voltage only… but what abt

current ??? 7805 is giving 500mA output can i use this current as arduino digital pin input???

``````/*
Button

Turns on and off a light emitting diode(LED) connected to digital
pin 13, when pressing a pushbutton attached to pin 2.

The circuit:
* LED attached from pin 13 to ground
* pushbutton attached to pin 2 from +5V
* 10K resistor attached to pin 2 from ground

* Note: on most Arduinos there is already an LED on the board
attached to pin 13.

created 2005
by DojoDave <http://www.0j0.org>
modified 30 Aug 2011
by Tom Igoe

This example code is in the public domain.

http://www.arduino.cc/en/Tutorial/Button
*/

// constants won't change. They're used here to
// set pin numbers:
const int P1 = 2;     // the number of the pushbutton pin
const int P2 = 3;     // the number of the pushbutton pin
const int L1 = 4;     // the number of the pushbutton pin
const int L2 = 5;     // the number of the pushbutton pin

int S1 =  8;      // the number of the LED pin
int S2 =  9;      // the number of the LED pin
int S3 =  10;      // the number of the LED pin
int S4 =  11;      // the number of the LED pin

// variables will change:
int P1State = 0;         // variable for reading the pushbutton status
int P2State = 0;         // variable for reading the pushbutton status
int L1State = 0;         // variable for reading the pushbutton status
int L2State = 0;         // variable for reading the pushbutton status

void setup() {
// initialize the LED pin as an output:
pinMode(S1, OUTPUT);
pinMode(S2, OUTPUT);
pinMode(S3, OUTPUT);
pinMode(S4, OUTPUT);

// initialize the pushbutton pin as an input:
pinMode(P1, INPUT);
pinMode(P2, INPUT);
pinMode(L1, INPUT);
pinMode(L2, INPUT);
}
int blCheck=0;
void loop(){

// FOR  FRONT AND REAR

if(P2State == HIGH)
{
blCheck=0;
}
if(P1State == HIGH)
{
blCheck=1;
}

if(blCheck  == 1)
{
if (P1State == HIGH && L2State == LOW && P2State == LOW)
{

digitalWrite(S1, HIGH);
digitalWrite(S3, HIGH);
digitalWrite(S2, LOW);
digitalWrite(S4, LOW);

}
if (L2State == HIGH && P1State ==LOW && P2State == LOW)
{
digitalWrite(S1, LOW);
digitalWrite(S3, LOW);
digitalWrite(S2, HIGH);
digitalWrite(S4, HIGH);
}

if (L1State ==HIGH)
{
digitalWrite(S1, LOW);
digitalWrite(S3, LOW);
digitalWrite(S2, LOW);
digitalWrite(S4, LOW);
}
if (L2State ==HIGH && P1State==HIGH && P2State==LOW)
{
digitalWrite(S1, LOW);
digitalWrite(S3, LOW);
digitalWrite(S2, LOW);
digitalWrite(S4, LOW);

}
}
else
{
//FOR REAR DROP

if (P2State == HIGH && L2State == LOW && P1State==LOW)
{
// turn LED on:
digitalWrite(S3, HIGH);
digitalWrite(S4, LOW);
digitalWrite(S1, LOW);
digitalWrite(S2, LOW);

}
if (L2State == HIGH && P2State ==LOW && L1State == LOW)
{
digitalWrite(S1, LOW);
digitalWrite(S2, LOW);
digitalWrite(S3, LOW);
digitalWrite(S4, HIGH);
}
if (L2State ==HIGH && P2State==HIGH && P1State==LOW)
{
digitalWrite(S3, LOW);
digitalWrite(S4, LOW);
digitalWrite(S1, LOW);
digitalWrite(S2, LOW);

}
if (L1State ==HIGH)
{
digitalWrite(S1, LOW);
digitalWrite(S3, LOW);
digitalWrite(S2, LOW);
digitalWrite(S4, LOW);
}

}

}
``````

There is a lot of not understanding the fundamentals of electricity going on here.

To controll VOLTAGE and amp, i am giving signal input to 7805 and 7805 output to arduino digital pin,by this way i am controlling voltage only

No that is very wrong. Yes it will control the maximum voltage but it will not give a good logic zero when there is no voltage. These chips are not designed for signal voltage level conversion, do not use them to do so.

7805 is giving 500mA output

No it is not. It is capable of giving 500mA only when it is put across a load that will demand 500mA. An arduino digital pin is high impedance so it will not draw anything like that much.

CrossRoads showed you how to read the 12V input correctly without misusing a voltage regulator.

chetan0412,

Almost zero current flows into (or out of) an Arduino input. For most engineering purposes, you can assume zero current. (But, only if you stay within the limits of no more than 5V and no negative voltages.*)

The relationship between voltage resistance (or impedance) and current is described by [u]Ohm’s Law[/u]. Current = Voltage/Resistance. Resistance means “resistance to current flow”. Ohm’s Law is the 1st thing you learn when you take an electronics class.

Since the input impedance on the Arduino is 100 megohms or more, 5/100,000,000 = 0.02 microamps.

A power supply (or a voltage regulator like the LM340) does not “push out” 500mA. It puts-out a (approximately) constant voltage, and the current depends on the resistance of the load. If you exeed the limits of the power supply (by trying to get too much current out of it), Ohm’s Law is still true (the laws of physics & nature always hold) so the voltage will drop (and the thing might burn-up).

• If you put a negative voltage, or a voltage greater than the 5V power supply, the internal protection diodes begin to conduct. At that point resistance drops to nearly zero, maximum current flows (whatever the source can supply) and your Arduino might get fried!