Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 30th April 2008, 08:51 AM   #1 (permalink)
Experienced Member
 
Join Date: Oct 2004
Location: Malaysia
Posts: 93
mesamune80 is on a distinguished road
Send a message via ICQ to mesamune80 Send a message via MSN to mesamune80 Send a message via Yahoo to mesamune80
Smile Input For PIC uC

Hi all,

i am using a comparator ic and LM393 ,configured it as windows detector circuit with the output go to LED and pic uC pin.
But i could not read any high logic from the ic output pin when the pin is goes high. i am using a 1k pull up resistor for the power (12v) to LED which is parallel to uC pin as well which i want the uC to detect it is logic high.
Any problem with my configuration?
mesamune80 is offline   Reply With Quote
Old 30th April 2008, 08:56 AM   #2 (permalink)
Experienced Member
 
 
Join Date: Oct 2006
Location: Colombo
Posts: 946
Gayan Soyza is just really niceGayan Soyza is just really niceGayan Soyza is just really nice
Default

Remove the comparator part from the uC & check the comparator whether it is working correctly?

Can you see the LED goes on when input logic = 1 (in between your range)?

What input did you feed the input?Inverting pin or for the non inverting pin?

Note that its output open collector type.
__________________
Gayan
Forum Supporter

Last edited by Gayan Soyza; 30th April 2008 at 09:07 AM.
Gayan Soyza is offline   Reply With Quote
Old 30th April 2008, 09:10 AM   #3 (permalink)
Experienced Member
 
Join Date: Oct 2004
Location: Malaysia
Posts: 93
mesamune80 is on a distinguished road
Send a message via ICQ to mesamune80 Send a message via MSN to mesamune80 Send a message via Yahoo to mesamune80
Default

ya,my LED lit but i could not get any signal to my uC pin.
my circuit is look like this with the VrefA and VrefB to my pic uC pin (input pin)
Is there anything i need to add so that my uC can detect logic 1 and 0 respectively?
Attached Images
File Type: jpeg Windows Detector1.jpeg (21.4 KB, 35 views)
mesamune80 is offline   Reply With Quote
Old 30th April 2008, 09:13 AM   #4 (permalink)
Super Moderator
 
 
Join Date: Nov 2003
Location: Derbyshire, UK
Posts: 22,790
Nigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to behold
Default

Remove the LED's, they are stopping the outputs going high!.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now   Reply With Quote
Old 30th April 2008, 09:18 AM   #5 (permalink)
Experienced Member
 
Join Date: Oct 2004
Location: Malaysia
Posts: 93
mesamune80 is on a distinguished road
Send a message via ICQ to mesamune80 Send a message via MSN to mesamune80 Send a message via Yahoo to mesamune80
Default

i see ,thanks nigel ,but i need some indication for that? (high and low limit indication)
can i do it in a different way? or any alternative for that?
mesamune80 is offline   Reply With Quote
Old 30th April 2008, 09:25 AM   #6 (permalink)
Super Moderator
 
 
Join Date: Nov 2003
Location: Derbyshire, UK
Posts: 22,790
Nigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to behold
Default

Use a transistor to feed the LED.

Or, more crudely, put a resistor in series with the LED - but this will still restrict the output of the comparator from going fully high, and reduce the LED's brightness.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now   Reply With Quote
Old 30th April 2008, 09:27 AM   #7 (permalink)
Experienced Member
 
 
Join Date: Jan 2007
Location: U.K.
Posts: 3,791
ericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to behold
Default

Quote:
Originally Posted by Nigel Goodwin
Use a transistor to feed the LED.

Or, more crudely, put a resistor in series with the LED - but this will still restrict the output of the comparator from going fully high, and reduce the LED's brightness.
Hi Nigel,
Just noticed he is using a +12V supply to the LM393...
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Nigel's site: http://www.winpicprog.co.uk/
Gramo's site: http://www.digital-diy.net/
ericgibbs is online now   Reply With Quote
Old 30th April 2008, 09:29 AM   #8 (permalink)
Experienced Member
 
Join Date: Oct 2004
Location: Malaysia
Posts: 93
mesamune80 is on a distinguished road
Send a message via ICQ to mesamune80 Send a message via MSN to mesamune80 Send a message via Yahoo to mesamune80
Default

It seem like i got not much choices,either a transistor or a dim LED =_="
what transistor is suitable for this i can use 2N222?
mesamune80 is offline   Reply With Quote
Old 30th April 2008, 09:31 AM   #9 (permalink)
Experienced Member
 
Join Date: Oct 2004
Location: Malaysia
Posts: 93
mesamune80 is on a distinguished road
Send a message via ICQ to mesamune80 Send a message via MSN to mesamune80 Send a message via Yahoo to mesamune80
Default

anything wrong with 12V? @_@"
mesamune80 is offline   Reply With Quote
Old 30th April 2008, 09:40 AM   #10 (permalink)
Super Moderator
 
 
Join Date: Nov 2003
Location: Derbyshire, UK
Posts: 22,790
Nigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to behold
Default

Quote:
Originally Posted by mesamune80
anything wrong with 12V? @_@"
Not as long as you have a current limiting resistor feeding the PIC.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now   Reply With Quote
Old 30th April 2008, 09:45 AM   #11 (permalink)
Experienced Member
 
Join Date: Oct 2004
Location: Malaysia
Posts: 93
mesamune80 is on a distinguished road
Send a message via ICQ to mesamune80 Send a message via MSN to mesamune80 Send a message via Yahoo to mesamune80
Default

okay i'll try it out ,thanks guys.
mesamune80 is offline   Reply With Quote
Old 30th April 2008, 12:28 PM   #12 (permalink)
Experienced Member
 
 
Join Date: Jan 2005
Location: UK
Posts: 1,966
eblc1388 is just really niceeblc1388 is just really niceeblc1388 is just really nice
Default

Or you can use 3.3V 250mW zener diode in series with each LED.
__________________
L.Chung
eblc1388 is offline   Reply With Quote
Old 30th April 2008, 12:49 PM   #13 (permalink)
Experienced Member
 
 
Join Date: Jan 2007
Location: U.K.
Posts: 3,791
ericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to behold
Default

Quote:
Originally Posted by mesamune80
okay i'll try it out ,thanks guys.
hi,
You could do it this way.

I have modified the top LED, I'm assuming a Red LED about Vfwd=2V

The LM393 is open collector output, also the PIC analog is a high impedance.
Attached Images
File Type: jpg uC1.jpg (24.9 KB, 23 views)
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Nigel's site: http://www.winpicprog.co.uk/
Gramo's site: http://www.digital-diy.net/
ericgibbs is online now   Reply With Quote
Old 5th May 2008, 01:25 AM   #14 (permalink)
Experienced Member
 
Join Date: Oct 2004
Location: Malaysia
Posts: 93
mesamune80 is on a distinguished road
Send a message via ICQ to mesamune80 Send a message via MSN to mesamune80 Send a message via Yahoo to mesamune80
Default

Thanks for all the replies,really thanks for all of you.
i think i might choose either zener or voltage divider method to power up both my LED and also signal to my uC. =)
mesamune80 is offline   Reply With Quote
Old 5th May 2008, 02:54 AM   #15 (permalink)
Experienced Member
 
Join Date: Oct 2004
Location: Malaysia
Posts: 93
mesamune80 is on a distinguished road
Send a message via ICQ to mesamune80 Send a message via MSN to mesamune80 Send a message via Yahoo to mesamune80
Default

Can i put it this way? so that i can adjust untill the voltage to my uC is about 5V at the same time i also can light on my LED.
Or any better idea i can use? at the moment i have 10k adj resistor and 1k resisitor.
Attached Images
File Type: jpg sample.JPG (22.4 KB, 11 views)

Last edited by mesamune80; 5th May 2008 at 02:59 AM.
mesamune80 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Latest
LCD Display karenhornby Electronic Projects Design/Ideas/Reviews 27 22nd February 2008 07:42 PM
Using Oscilloscopes mechie Electronic Theory 9 29th November 2007 09:49 PM
Output = Input - Problems adamthole Micro Controllers 20 24th April 2007 04:09 AM
uuffff how doess this stupid ting work lol cyprio7 General Electronics Chat 7 9th October 2005 06:56 PM
convert input resistance to different output, but how?! pcoghlan Electronic Projects Design/Ideas/Reviews 7 9th July 2004 10:00 PM


All times are GMT. The time now is 12:15 PM.


Electronic Circuits  |  Radio Controlled
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.