I'm running using a 3.5V input (because I have to power the arduino from a battery) and for some reason my Arduino won't recognize the 3.5V it as a HIGH input. Really not sure what is wrong here. Any help?
What Arduino board?
Arduino UNO
Might be sitting at the indeterminate level.
Do other pins have the same reaction?
Is the UNO Vcc sitting at 5 volts?
Other pins have the same reaction. I'm running 6v into the DC jack so it's internally regulated. It's outputting 5V just fine.
6 is a little low try 9V or see what happens when you use USB for power?
.
There is a reverse protection diode between the DC socket and V-in, with a ~0.7volt drop.
6volt on the DC jack = ~5.3volt on V-in = ~4.3volt on the 5volt pin.
If you only have 6volt available, then it's better to connect that to the V-in pin.
Then the 5volt pin might just be 5volt.
Switch points are 0.3VCC and 0.6VCC.
If VCC is 5volt, then >3volt on an input pin should give a HIGH.
Tell us what you have connected to the input(s).
Leo..
Tried running 12V from the battery into the jack. No difference.
I'm running a 12V max signal from a relay output through a voltage divider to drop it to 5V max.
What are the resistor values.
Did you share Arduino ground and 12volt battery ground.
Leo..
10k and 15k
Yes, grounds are shared.
10k from pin to ground and 15k from pin to 12volt battery should give a good high.
Post pictures of the setup, and code.
Leo..
Sketco:
I'm running using a 3.5V input (because I have to power the arduino from a battery) and for some reason my Arduino won't recognize the 3.5V it as a HIGH input. Really not sure what is wrong here. Any help?
Which Arduino, running at what voltage?
Just some quick code to verify whether the input is actually registering.
const int SWtestPin = A0;
const int LEDpin = 8;
bool PBstart = 0;
void setup() {
pinMode (LEDpin, OUTPUT);
pinMode (SWtestPin, INPUT);
Serial.begin(9600);
}
void loop()
{
digitalRead(SWtestPin);
Serial.print(PBstart);
if(SWtestPin == true)
{
PBstart = 1;
}
else
{
PBstart = 0;
}
digitalWrite(LEDpin, PBstart);
}
digitalRead(SWtestPin);
...
if(SWtestPin == true)
:o
Software must be written correctly to check out hardware.
Oh dear God....
Sorry for wasting your time gents. I've been bouncing back and forth between problems and got so lost I did this. Thank you for your help