Go to Post [on reputation] They're just dots. - Brandon Martus [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-03-2008, 09:11
tdlrali tdlrali is offline
Registered User
FRC #0469 (Las Guerrillas)
Team Role: Programmer
 
Join Date: Sep 2006
Rookie Year: 2006
Location: MI
Posts: 377
tdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud of
4V - 5V signal on Digital Input

We have an input signal that is at 4V when it is low, and at 5V when it is high. How could we bring the voltage down so that we can read it in as a digital input?

And no, analog inputs are not an option
  #2   Spotlight this post!  
Unread 06-03-2008, 09:49
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: 4V - 5V signal on Digital Input

The first thing that comes to mind is a simple level triggering opamp circuit? For example LM339s or LM139s? Set up a resistor divider so that 4.1v is Vref, apply your 4v-5v to Vin, Vout should be ~0v if Vin is less than 4.1v and ~5v is greater than 4.1v...

See National Semi AN-74.pdf application note for more info.

Last edited by dcbrown : 06-03-2008 at 10:02.
  #3   Spotlight this post!  
Unread 06-03-2008, 10:20
Ken Streeter's Avatar
Ken Streeter Ken Streeter is offline
Let the MAYHEM begin!
FRC #1519 (Mechanical Mayhem)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Team: Milford, NH; Me: Bedford, NH
Posts: 470
Ken Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond repute
Re: 4V - 5V signal on Digital Input

Quote:
Originally Posted by tdlrali View Post
We have an input signal that is at 4V when it is low, and at 5V when it is high. How could we bring the voltage down so that we can read it in as a digital input?

And no, analog inputs are not an option
Do you mind my asking why analog inputs are not an option? Are you already using all of the analog inputs on the controller?

If you need to use a digital input, the suggestion of using an LM339 (4 comparators in a package) or an LM393 (2 comparators in a package) is a good approach.

Data sheets can be found online:
__________________
Ken Streeter - Team 1519 - Mechanical Mayhem (Milford Area Youth Homeschoolers Enriching Minds)
2015 NE District Winners with 195 & 2067, 125 & 1786, 230 & 4908, and 95 & 1307
2013 World Finalists & Archimedes Division Winners with 33 & 469
2013 & 2012 North Carolina Regional Winners with teams 435 & 4828 and 1311 & 2642
2011, 2010, 2006 Granite State Regional Winners with teams 175 & 176, 1073 & 1058, and 1276 & 133
Team 1519 Video Gallery - including Chairman's Video, and the infamous "Speed Racer!"

Last edited by Ken Streeter : 06-03-2008 at 11:49.
  #4   Spotlight this post!  
Unread 06-03-2008, 14:51
tdlrali tdlrali is offline
Registered User
FRC #0469 (Las Guerrillas)
Team Role: Programmer
 
Join Date: Sep 2006
Rookie Year: 2006
Location: MI
Posts: 377
tdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud of
Re: 4V - 5V signal on Digital Input

Thanks guys, I'll look into those options. The only reason we don't want to use analogs is because we're really just looking for on vs. off, and the additional sampling required for using an analog input is overkill.
  #5   Spotlight this post!  
Unread 06-03-2008, 15:30
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,355
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: 4V - 5V signal on Digital Input

Quote:
Originally Posted by tdlrali View Post
Thanks guys, I'll look into those options. The only reason we don't want to use analogs is because we're really just looking for on vs. off, and the additional sampling required for using an analog input is overkill.
It may be overkill, but if the custom circuit's output does not operate such that it meets the designed parameters of the RC, then you need to adjust your approach.
An analog comparison will only take a couple lines of code.

Code:
{
char a;
{
if (Get_analog_01() <= 800)
{
a = 0;
}
else
{
a = 1;
}
}
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #6   Spotlight this post!  
Unread 06-03-2008, 19:06
eugenebrooks eugenebrooks is offline
Team Role: Engineer
AKA: Dr. Brooks
no team (WRRF)
 
Join Date: Jan 2004
Rookie Year: 2001
Location: Livermore, CA
Posts: 601
eugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond repute
Re: 4V - 5V signal on Digital Input

Quote:
Originally Posted by tdlrali View Post
Thanks guys, I'll look into those options. The only reason we don't want to use analogs is because we're really just looking for on vs. off, and the additional sampling required for using an analog input is overkill.
Building custom circuitry, when the an analog input can get your
on-off state is overkill. We ran out off digital inputs this
year and needed one more. We wired the switch to a
pullup resistor and an analog input, coded to set a variable to 0 when
the voltage was below 2.5 volts and to 1 when the voltage was
above. It worked just fine.

Eugene
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Digital out signal speed on off, almost like PWM but at max 60Hz Generalx5 Electrical 2 27-03-2007 12:26
Auton digital input ten3brousone Programming 7 20-03-2005 22:23
digital input question... Kevin Karan Programming 9 12-04-2004 07:34
counting digital input CharlieWilken Programming 9 22-03-2004 19:56
Robot Digital Input Mike Norton Technical Discussion 5 16-01-2003 14:31


All times are GMT -5. The time now is 10:43.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi