Searching \ for 'Beginner Input and Output Questions' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/ios.htm?key=input
Search entire site for: 'Beginner Input and Output Questions'.

Truncated match.
PICList Thread
'Beginner Input and Output Questions'
1998\03\31@161311 by Buell Smelt

picon face
Over the last week I have created my first few simple PIC programs (led
blinking, switch counting, etc) and have developed a few questions.  For
my projects I am using a 16F84, but I am interested in (and have the
programmer for) using other PICs.

Regarding outputs...

I have a 5V lamp, and I do not know how much current it needs.  Is there
anyway to figure this out with a multimeter?  Let's say it uses 50
milliamps.  I could then hook it up to two outputs to drive it; correct?
Of course I could also drive it with a transistor, such as a 2N2222 or a
2N7000 right?  How does one choose the right transistor for the right
output (ie this transistor is good for this small lamp and this one is
good for this motor).

Regarding Inputs...

I'd like to have sensors hooked up to some of my PIC projects.  Let's say
I am using a photoresistor.  Normally I'd think to use a CMOS comparator.
IS there a good cheap comparator that works with the PIC (I've never
worked with a comparator, just know them in theory, so a part name would
be helpful)? Do PICs have any built in comparator features or is there a
better way to do this which I am overlooking?

Ok, That's all.  I know that these are relatively simple questions which
should be obtainable all over the place, but I assure you've I've been
around and looking, and have found unsatisfactory->no answers, so I felt
like this list would be a good place to get the answers.  One more thing,
is there a web based interface to this list's archives?

Thanks a lot a lot a lot.

Nathan Hendler

1998\03\31@174745 by Philip Martin

flavicon
face
-----Original Message-----
From: Buell Smelt <spam_OUTsmeltTakeThisOuTspamAZSTARNET.COM>
To: .....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU <PICLISTspamKILLspamMITVMA.MIT.EDU>
Date: 31 March 1998 22:13
Subject: Beginner Input and Output Questions


Hi Nathan,

Lets take a couple of your questions in a step by step fashion:-


>
>I have a 5V lamp, and I do not know how much current it needs.

You say lamp! Do you mean LED Or LAMP that is lamp as in filament lamp.

Is there
>anyway to figure this out with a multimeter?  Let's say it uses 50
>milliamps.

Yes, measure the resistance of the filament, now apply Ohms Law. Here once
again we assume its a filament lamp were are talking about, cos if its an
LED this don t work, and anyway an LED will only draw something in the order
of 10 to 25 milliamps.

Once you have the resistance of the lamp, divide the voltage the lamp will
be running at by the resistance and you have the current. Of course, if you
know the wattage of the lamp, divide that by the voltage to give you the
current i.e., lets say the lamp is 2 watts that equates to some 400ma. If
memory serves me right, the output of a pic is good for 25ma, that means you
would need the output of 16 i/o's to drive the lamp, if you were not
exceeding the total permissible output load of the pic!


>I could then hook it up to two outputs to drive it; correct?

Errr, No

>Of course I could also drive it with a transistor,

YES

>such as a 2N2222 or a
>2N7000 right?  How does one choose the right transistor for the right
>output (ie this transistor is good for this small lamp and this one is
>good for this motor).
>

See note below.

{Quote hidden}

Ive been using this list for over a year now, and I find it and extremely
useful reference point for learning about Pic programming and use. Also
there are many useful ideas floating about as regards ancillary equipment
and attachments. However Nathan, your questions seem to be far more basic
than Pic programming. How good an understanding do you have of electronics.
Its easy to copy or write some fairly simple code to make some LED's respond
to a input signal, but if you don t know how to spec the value of base
current and voltage for a particular transistor you re going to have the
bugger of a time getting anything more complicated to work. Been there, done
that, and its not that much fun.

Me thinks a book like Malcolm Plant's Basic Electronics, or any one of the
thousand or so other books like this would be a good place to start.

Philip Martin
Now a VPOP non smoker!"%$#"$# :-)

1998\03\31@183158 by )

flavicon
face
       Philip Martin Wrote:

>  Is there
> >anyway to figure this out with a multimeter?  Let's say it uses 50
> >milliamps.
>
> Yes, measure the resistance of the filament, now apply Ohms Law. Here
> once
> again we assume its a filament lamp were are talking about, cos if its
> an
> LED this don t work, and anyway an LED will only draw something in the
> order
> of 10 to 25 milliamps.
>
> Once you have the resistance of the lamp, divide the voltage the lamp
> will
> be running at by the resistance and you have the current.
>
>
         I hate to nit-pick, but dividing the operating voltage by the
cold filament resistance will give you in rush current, not operating
current. Filament resistance goes up quite a bit once it heats up. If
the specs are unknown on the lamp, then you're better off hooking the
lamp up to a variable power supply and measuring the current drawn at
the desired voltage. Three "fresh" flashlight batteries (AA, C, or D) in
series will get you 4.5 volts, close enough to 5V for a good estimate.
I'd feel much safer driving a incandescent lamp with a cheap switching
transistor such as a 2N2222, than trying to drive it directly from a PIC
I/O pin.

       BTW, anybody got a link for low voltage lamp specs/cross
reference?

       As I side note, I have changed the only applicable setting I can
change on my mailer (Outlook) to send to this address in plain text. The
last time I posted to PICList since I was switched over to NT/Outlook, I
had a few people "scream" at me for posting binary garbage. If some of
you still receive binary garbage attached to my messages (please let me
know - if you get garbage attached), then I'm afraid I'll have to cease
posting all together and simply read PICList.

Frank Richterkessing
GE Appliances
.....frank.richterkessingKILLspamspam.....appl.ge.com

1998\03\31@183900 by Richard Nowak

picon face
At 11:35 PM 3/31/98 +0100, you wrote:
{Quote hidden}

Careful here - the resistance of a cold filament is on the order of 25 Ohms
and will go up to 300 ohms (40W lamp) when it incandesces.

This behavior was often used as a feedback element in many amplifier and
oscillator designs.

If a 15W lamp operates at 110V then R = 110 * 110 / 15 = 806 Ohms, but only
when operated at 110V.

The current I = 15 / 110 = 136 mA (when operated at 110V).

Rich

BTW: This inrush of current is not being nice to the filament and is the
reason that many household switches turn on at the zero crossing of the
voltage waveform.

=========================================
= Abolish the Income Tax! Fire the IRS! =
= http://www.nrst.org/                  =
=========================================
=========================================
= Here's a site that wants your views   =
= http://www.not4irs.org/               =
=========================================

1998\03\31@192909 by ck \The Notes Guy\ Dickinson

flavicon
face
On Tue, 31 Mar 1998 18:22:28 -0500, you wrote:

>        As I side note, I have changed the only applicable setting I can
>change on my mailer (Outlook) to send to this address in plain text. The
>last time I posted to PICList since I was switched over to NT/Outlook, I
>had a few people "scream" at me for posting binary garbage. If some of
>you still receive binary garbage attached to my messages (please let me
>know - if you get garbage attached), then I'm afraid I'll have to cease
>posting all together and simply read PICList.
>
>Frank Richterkessing
>GE Appliances
>KILLspamfrank.richterkessingKILLspamspamappl.ge.com

It appears to have come through without any excess baggage.  Just
thought you'd like to hear even if there was _no_ garbage.

- Rick

   Enterprise ArchiTechs     | Views expressed on topics unrelated
 http://www.eArchiTechs.com  | to messaging are not those of my
NoSpam eMail:RemoveMErtdTakeThisOuTspamnotesguy.com | company, and may not even be mine.


'Beginner Input and Output Questions'
1998\04\01@154038 by Philip Martin
flavicon
face
-----Original Message-----
From: Richard Nowak <spamBeGonenowakspamBeGonespamEARTHLINK.NET>
To: TakeThisOuTPICLISTEraseMEspamspam_OUTMITVMA.MIT.EDU <RemoveMEPICLISTspamTakeThisOuTMITVMA.MIT.EDU>
Date: 01 April 1998 00:39
Subject: Re: Beginner Input and Output Questions


Message to Nathan. Following on from your original post. See what I mean
about the diversity of views available from this group:-)


{Quote hidden}

order
{Quote hidden}

1998\04\01@162225 by Buell Smelt

picon face
On Tue, 31 Mar 1998, Philip Martin wrote:

> You say lamp! Do you mean LED Or LAMP that is lamp as in filament lamp.

I indeed mean lamp.

> >anyway to figure this out with a multimeter?  Let's say it uses 50
> >milliamps.
> >I could then hook it up to two outputs to drive it; correct?
>
> Errr, No

If the lamp takes 50 milliamps and each pin can handle 25 milliamps, then
why couldn't two pins drive this lamp?

{Quote hidden}

Ok, good point.  I really should have restrained myself and kept it to PIC
questions only.  You're right, I don't know where to find specs for the
value of base current and voltage for of the trasistors I have.  BTW,
getting LED's to respond to an input signal is fun ;)

Thanks for the help,
Nathan Hendler

1998\04\03@130235 by Roberto Marchini

flavicon
face
Hi

>Yes, measure the resistance of the filament, now apply Ohms Law. Here once
>again we assume its a filament lamp were are talking about, cos if its an
>LED this don t work, and anyway an LED will only draw something in the order
>of 10 to 25 milliamps.
>
>Once you have the resistance of the lamp, divide the voltage the lamp will
>be running at by the resistance and you have the current.

Attention !!!
The resistence of hot filament is normally upper then cold filament
and the result could be not correct.
All filament lamps has a current peak on power up.
In most cases it is 10 times the average current.

Best regards

Roberto Marchini

Turin (Italy/Europe/Earth/Solar system/Milk way)

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...