Pages: [1]   Go Down
Author Topic: [solved] Detecting 9V on Digital in ?  (Read 428 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys,
i'm quite new on Adruino and got kinda stucked, hopefully someone can help me.

I need 8 Inputs on my Atmega168/Arduino.
My  Atmega/Arduino is Powered by USB.
I already build up a simple circuit with a Button connected to Input12 , 5V+ and GND via a 10k Pulldown-Resistor.
This works and my code is triggered... fine.

Now i need 8 Inputs that got triggered by an external 9V Powersource.
As soon as the 9V hits,the Digital-In should be triggered.

I already got a LP2950 Stepdown Converter connected to the 9V and the output is plain 5V.
But connecting it to the Digital Input12 don't trigger the Code.
Even using the Ground of the 9v (a Batteryblock btw.) doesn't trigger anything.

Can someone light me up ?

btw .. Analog Inputs is not an option, i need them later

Thanks in advance,
TheMenace





 
« Last Edit: May 24, 2012, 07:19:01 pm by TheMenace » Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24328
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A simple potential divider would be a lot cheaper.

Quote
But connecting it to the Digital Input12 don't trigger the Code.
What code?
« Last Edit: May 23, 2012, 03:18:27 pm by AWOL » Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yap , i know but ill bet it wouldn't trigger the Digital In either smiley-wink
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31448
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I already build up a simple circuit with a Button connected to Input12,5V+ and GND via a 10k Pulldown-Resistor.
This works and my code is triggered... fine.
That is a great way to destroy your arduino. You must not apply a voltage greater than the supply voltage, which in this case is 5V.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

its 5v+ and Digital Input 12 ... not 12,5V
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31448
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You are better off using a pull up resistor rather than a pull down, as shown here:-
http://www.thebox.myzen.co.uk/Tutorial/Inputs.html
Then for a bigger input voltage use some protection:-
http://www.thebox.myzen.co.uk/Tutorial/Protection.html
I would use a 330R resistor and a 5.1V zenner.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The problem i see with an Pull-Up is,that the 9V can be a very short signal.
or is that not an issue ?
Except from protecting the Input and using a Pull-up, should the basic idea of my circuit work
or did i missed something ?


Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31448
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
is that not an issue
Not an issue.

Remember the ground of your signal needs to be connected to the ground of the arduino.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Now it works !
Looks like the Pull Up does the trick smiley
Thanks for the Help !
Logged

Pages: [1]   Go Up
Jump to: