Searching \ for '[PIC]: HELP REQUIRED FROM NEWBIE' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: piclist.com/techref/microchip/begin.htm?key=pic
Search entire site for: 'HELP REQUIRED FROM NEWBIE'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: HELP REQUIRED FROM NEWBIE'
2005\01\05@033958 by techy fellow

picon face
Hi Guys,

Could someone pls let me know where can I get information on, PIC (preferably 16877 because I purchased a 16877 Development board from Futurlec.com) Controlled AC relays using a light sensor as an input ? I have searched thru the internet but can seems to find one that is close to what I want. Most of them are related to garden or drive-way lights which will turn on during the night.

My objective is, if the light is on, the PIC will switch on 2 of the 4 relays for say 8 seconds while the other 2 relays are in off-position. After 8 seconds, alternate the 2 pairs of relays on/ off position. When the light is off, reduce the on/ off delays from 8 seconds to 4 seconds. I know there will not be an exact project available in the internet but if I can find one that is close, I hope I can make changes to the source code to suit my needs (part of learning).

Thanks a zillion.
cheers,

               
---------------------------------
Do you Yahoo!?
Yahoo! Mail - Easier than ever with enhanced search. Learn more.

2005\01\05@050555 by Andrew Rich

flavicon
face
Here is the flow

1. Get the datasheet
2. Download MPLAB 7.0
3. Use MPLAB to simulate, syntax check and create the HEX file used for
programming
4. I use a PIC programmer that hangs of the serial port
5. Surf the web for little examples i started out turning lights on and off

What specifically do you need to know ?

Ask lost of questions


2005\01\05@074125 by olin_piclist

face picon face
Andrew Rich wrote:
> Here is the flow
>
> 1. Get the datasheet
> 2. Download MPLAB 7.0
> 3. Use MPLAB to simulate, syntax check and create the HEX file used for
> programming
> 4. I use a PIC programmer that hangs of the serial port
> 5. Surf the web for little examples i started out turning lights on and
> off
>
> What specifically do you need to know ?
>
> Ask lost of questions

I'm not sure what your question really is, but I noticed that debugging in
the circuit was not in your 5 step program.  It's a good idea use the
simulator before trying your code on real hardware, but there is still no
substitute for testing and debugging the real thing.  For most hobbyists,
that means using a ICD2.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

2005\01\05@094239 by techy fellow

picon face
Hi Andrew,
Sorry for not being clear. I am working on a project using a PIC (16F877 or 16F628 ) or even AVR (90S2313, 90S8515) to control 4 relays (2 pairs); on and off for say, 8 seconds interval for 24/7. Powerheads (fish tank type) operating at 220v will be attached to the relays. During the day, when the fish tank lights are on, I want the on/ off interval to be 8 seconds. During the night when the lights are off, I want the on/ off interval to be 4 seconds. Thus, I think of using a light sensor as an input logic so as to use different interval routines within the PIC.
As I am totally new to MCU and electronics hence, if I can get hold of a project that is as close to my requirement as possible, that will greatly help. The only plus I have is, I have some BASIC programming background. Hopefully, I can pick up quickly on modifying the source code to suit my needs.
Thanks in advance for the help.
cheers,


Andrew Rich <spam_OUTvk4tecTakeThisOuTspamtech-software.net> wrote:
Here is the flow

1. Get the datasheet
2. Download MPLAB 7.0
3. Use MPLAB to simulate, syntax check and create the HEX file used for
programming
4. I use a PIC programmer that hangs of the serial port
5. Surf the web for little examples i started out turning lights on and off

What specifically do you need to know ?

Ask lost of questions

2005\01\05@103315 by Denny Esterline

picon face
Interesting,
The thing that imediatly jumps out at me is the cyclic rate of the relays.
At a 8 second cycle rate, that works out to be ~10,000 cycles a day - more
at four seconds. I wouldn't expect a mechanical relay to have a very long
lifespan at that rate. If you actualy need this switching rate I'd
reccomend you look into some other options. Solid state relays are an
option, or you could control it with triacs.

A pic is a good match for this type of application. I would generaly
reccomend the 16F877 / or 16F876 for a beginner to learn with. But
something of this size could be done with a much smaller part (16F629
probably)

Most of the people on this list program with assembly. Since you mention
you have some BASIC experiance maybe you should look into ME labs PicBasic
Pro. http://www.melabs.com  They even have a demo version that's probably
enough to do what you're asking.

There's also some good PBP specific resources out there like this one:
http://www.picbasic.co.uk/forum/

The basic program would actualy be quite simple, it'll probably look
something like this:

lightsensor  var portb.0
relay        var portb.1

on           con 1 'these depend on how you wire your relays
off          con 0
day          con 1 'depends on sensor type and how you wire it

input lightsensor
output relay

Main:
if (lightsensor = day) then
  relay = on
  pause 8000   'number of milliseconds to pause
  relay = off
  pause 8000
else
  relay = on
  pause 4000
  relay = off
  pause 4000
endif
goto main


This is just a quick hack, and I imagine you will want to add features and
such, but it should give you some ideas.

-Denny




>
> Sorry for not being clear. I am working on a project using a PIC (16F877
or 16F628 ) or even AVR (90S2313, 90S8515) to control 4 relays (2 pairs);
on and off for say, 8 seconds interval for 24/7. Powerheads (fish tank
type) operating at 220v will be attached to the relays. During the day,
when the fish tank lights are on, I want the on/ off interval to be 8
seconds. During the night when the lights are off, I want the on/ off
interval to be 4 seconds. Thus, I think of using a light sensor as an input
logic so as to use different interval routines within the PIC.
>
> As I am totally new to MCU and electronics hence, if I can get hold of a
project that is as close to my requirement as possible, that will greatly
help. The only plus I have is, I have some BASIC programming background.
Hopefully, I can pick up quickly on modifying the source code to suit my
needs.
>
> Thanks in advance for the help.
>
> cheers,
>
>


2005\01\05@105236 by Bob Axtell

face picon face
techy fellow wrote:

>Hi Andrew,
>
>Sorry for not being clear. I am working on a project using a PIC (16F877 or 16F628 ) or even AVR (90S2313, 90S8515) to control 4 relays (2 pairs); on and off for say, 8 seconds interval for 24/7. Powerheads (fish tank type) operating at 220v will be attached to the relays. During the day, when the fish tank lights are on, I want the on/ off interval to be 8 seconds. During the night when the lights are off, I want the on/ off interval to be 4 seconds. Thus, I think of using a light sensor as an input logic so as to use different interval routines within the PIC.
>  
>
A mechanical relay will wear out quickly at 8S on/off. I'd use an
opto-SCR within a diode bridge to drive the load.  Or, the
sharp#PR31HD22NSZ. It can handle 1A at 220VAC, a functional replacement
for mechanical relays. You must be VERY careful of your PCB layout, to
prevent AC from getting into your controller on a moist day; to solve
this, you will need to coat the PCB with a plastic spray.

I'd use an PIC12F629 to drive all 4 Opto-relays, then use the MCLR\
input as a light sensor input. If you use the sharp optos, their input
current load is very low, less than 5Ma (but in practice, 2Ma always
worked) so if you stagger the outputs (2 ON, 2 OFF at the same time) you
can actually make a  transformerless power supply from 220VAC to control
it. You can count 50/60 Cycle power to have a very accurate time base.

If you use tantalum caps and pot the whole thing, it'll still be working
at the next millenium.

BASIC sounds good, but you might find that JAL is even easier for this
project; JAL is a form of PASCAL.

--Bob

{Quote hidden}

--
Note: Attachments must be sent to
attachspamKILLspamengineer.cotse.net, and
MAY delay replies to this message.
       520-219-2363

2005\01\05@120223 by Eisermann, Phil [Ridg/CO]

flavicon
face
piclist-bounces@mit.edu wrote:
> Interesting,
> The thing that imediatly jumps out at me is the cyclic rate of the
> relays. At a 8 second cycle rate, that works out to be ~10,000 cycles
> a day - more at four seconds. I wouldn't expect a mechanical relay to
> have a very long lifespan at that rate.

Yes, the relay life could be an issue. A long time ago, i constructed
a powerhead controller for my reef tank using optically coupled triacs.
The circuit didn't have a PIC; I used a CMOS counter to count AC line
cycles through an H11AA. There are a lot of examples on the web on using
optically coupled triacs.

For night/day sensing, wasn't there a piclister who did just such a
project?

In any case, you can use MPLAB and MPSIM to learn about PICs and
assembly without having to have a working circuit. And the 'blinking LED'
project still has lasting value if you have limited experience with
building actual hardware. The piclist site has a lot of useful info and
tutorials. Microchip has some code templates.

2005\01\05@135351 by Colombain Nicolas

flavicon
face
Hi,

If you want to test your program in JAL language, you can take a look at
Jalss ( http://pic.flappie.nl/ ) which is the graphical simulator for JAL
language.
If you are interrested by Melabs PBP basic, assembler or Jal, there is
Microdev ( http://sourceforge.net/projects/microdev/ ). This is although a
graphical and real time simulator.
They can help you to start without a real board. Moreover they are both
free.
Regards,

Nicolas

> In any case, you can use MPLAB and MPSIM to learn about PICs and
> assembly without having to have a working circuit. And the 'blinking LED'
> project still has lasting value if you have limited experience with
> building actual hardware. The piclist site has a lot of useful info and
> tutorials. Microchip has some code templates.
>


2005\01\05@140533 by Jan-Erik Soderholm

face picon face
Hi.
First, do not use upper case only in the subject. Many regards
that as "shouting" and you will get fewer replies.

Second, I think that a subject that better says what it's
all about would have been better. No one is in the position
to "require" anything from the list, and doing that will probably
just give you fewer replies anyway...

With that said,

> There are a lot of examples on the
> web on using optically coupled triacs.

Maybe something like thse modules :

cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=3865095804
http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=3865085593

Much easier to use then discrete components and you get stuff
like zero crossing detection builtin.

Best Regards,
Jan-Erik.



2005\01\05@154727 by Russell McMahon

face
flavicon
face
> Second, I think that a subject that better says what it's
> all about would have been better.

I agree.
But -

> No one is in the position
> to "require" anything from the list, and doing that will probably
> just give you fewer replies anyway...

There *seems* to be a misunderstanding of the meaning of a word here.

"Require", in this context, is essentially interchangeable by (the
vast majority of) people who use English as a first language, with
words such as 'wanted', 'requested', 'desired' etc. For such people
the word does not convey any sense of  'demand', 'insist' etc in this
context.

The opposite confusion can also occur. On a prior occasion a poster
used the word "demand". This was taken by someone (person O) to mean
"insist" and a significant fire-fight occurred when person O demanded
that nobody demand things of them. The poster was French :-) - to them
the word "demand" was a clear english version of 'demande' = ask.


       Russell McMahon

2005\01\05@161609 by Andrew Rich

flavicon
face
You have some options. You really want a to know whether it is day or night
right ?

And then turn on / off some switches.

You can use the comparators in the 16F628 or 16F877A

The 16F877A has the advantage of A/D

I understand what you are doing, do you need code ? do you have a programmer
? Do you have MPLAB ?

Have you programmed 16F628 / 16F877A before ?



{Original Message removed}

2005\01\05@161828 by Jan-Erik Soderholm

face picon face
> > No one is in the position
> > to "require" anything from the list, and doing that will probably
> > just give you fewer replies anyway...
>
> There *seems* to be a misunderstanding of the meaning of a word here.
>
> "Require", in this context, is essentially interchangeable by (the
> vast majority of) people who use English as a first language, with
> words such as 'wanted', 'requested', 'desired' etc. For such people
> the word does not convey any sense of  'demand', 'insist' etc in this
> context.

HI.
Point taken, Sorry.

> The poster was French :-) - to them
> the word "demand" was a clear english version of 'demande' = ask.

He he :-)
It's like when George W Bush said that :

"The French can't do anything, they don't even have
a *word* for "entrepreneur" !!"

:-)

Regards,
Jan-Erik.



2005\01\05@164153 by Jinx

face picon face
> He he :-)
> It's like when George W Bush said that :
>
> "The French can't do anything, they don't even have
> a *word* for "entrepreneur" !!"

That's a big word for Dubya. You do know that "entrepreneur"
is (or was originally) a French word ?

But back to the thread -

Most people here have been around on this list for a while, know
how it works, and interactions are generally pretty good. For those
that are new or feel a little awkward or unsure about posting, here's
a crash course in what you can do for yourself (and etiquette, another
French word)

"How to ask questions the smart way"

http://www.catb.org/~esr/faqs/smart-questions.html

Many problems can be solved simply by the process of putting a
query together for others to read. When you have to explain something
to others it makes you think a little deeper

2005\01\05@171209 by Alex Harford

face picon face
On Wed, 5 Jan 2005 22:18:27 +0100 (MET), Jan-Erik Soderholm wrote:
>
> He he :-)
> It's like when George W Bush said that :
>
> "The French can't do anything, they don't even have
> a *word* for "entrepreneur" !!"

Not true: <http://www.snopes.com/quotes/bush.htm>

2005\01\05@171410 by Spehro Pefhany

picon face
At 10:39 AM 1/6/2005 +1300, you wrote:
> > He he :-)
> > It's like when George W Bush said that :
> >
> > "The French can't do anything, they don't even have
> > a *word* for "entrepreneur" !!"
>
>That's a big word for Dubya. You do know that "entrepreneur"
>is (or was originally) a French word ?

To be fair to the shrub, "entrepreneur" does not mean the same in French as
in English (it apparently means more like the English word
"contractor").

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
.....speffKILLspamspam.....interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com




2005\01\05@175848 by Jan-Erik Soderholm

face picon face
Jinx wrote :

> > He he :-)
> > It's like when George W Bush said that :
> >
> > "The French can't do anything, they don't even have
> > a *word* for "entrepreneur" !!"
>
> That's a big word for Dubya. You do know that "entrepreneur"
> is (or was originally) a French word ?

Of course, that was the joke.
And I find it funny, beeing true or not...
[end-of-topic]

Regards,
Jan-Erik.



2005\01\05@185006 by Dal Wheeler

flavicon
face

That's an urban legend that started in some British Tabloid
-----Original Message-----
From: Jan-Erik Soderholm

It's like when George W Bush said that :

"The French can't do anything, they don't even have
a *word* for "entrepreneur" !!"

2005\01\05@202412 by techy fellow

picon face
If possible, a schematic (PCB layout won't hurt either) and code will be nice. The reason why I didn't asked for the above in the first place was because I worried some might think that I want to be 'spoon-fed'. As I mentioned, I am a newbie (that's why I didn't ask appropriately in the first place -- no pun intended).
I have completed some electronic projects before by following electronic projects published in magazines and internet links. Basic knowledge such as, identifying basic electronic components, etching PCB, soldering components to PCB and 'blowing' codes into MCU, I can handle it. Beyond this (designing of circuits and coding from scratch), I can't.
I do have the following hardware related to MCUs. Bought them enthusiastically but, no time to really sit down to learn how to use them effectively.
- PICStart Plus board,
- ICD2
- Kit 128 for PICs (from Kitsrus)
- 100% self-built a PIC development board appeared in one of EPE magazine. Working condition.
- STK500
- STK501
- AVR ICE 200
- Kit 123 for 8051 family (from kitsrus)
Comtemplating to buy a BASIC programming software for either PIC (eg. PicBasic Pro) or AVR (Bascom AVR) since I know BASIC. Almost zero knowledge on Assembly and 'C'.

As one can see, I can't even decide which MCU is suitable for newbie. I am the type that prefer to learn along the way (by completing projects), which may not be a good way to learn  electronics. But, this is how I learned to play the guitar (learn new chords from new songs).
cheers,

Andrew Rich <EraseMEvk4tecspam_OUTspamTakeThisOuTtech-software.net> wrote:
You have some options. You really want a to know whether it is day or night
right ?

And then turn on / off some switches.

You can use the comparators in the 16F628 or 16F877A

The 16F877A has the advantage of A/D

I understand what you are doing, do you need code ? do you have a programmer
? Do you have MPLAB ?

Have you programmed 16F628 / 16F877A before ?



{Original Message removed}

2005\01\05@220122 by Russell McMahon

face
flavicon
face
> Comtemplating to buy a BASIC programming software .... AVR (Bascom
> AVR) since I know BASIC.


A 100% functional except for some debug aspects, 100%  free version of
BASCOM is available for up to 2k of  output code. It will program
through eg your STK500. It is a stunningly simple way to get going in
programming. You can have a LED (or 8) flashing in minutes once you
get things hooked up. An exceptionally fast easy and cheap way to
start. BASCOM allows mixed assembler and BASIC statements if desired,
giving the ultimate in power flexibility and confusion :-). Try it,
you'll love it. Stunning range of inbuilt functions / subprograms
allow you to interface to many standard peripherals with a minimum of
code (or understanding). LCD, PC keyboard, 1 wire devices, I^2C, flash
cards, and more.



       RM

2005\01\05@221602 by Bob Ammerman

picon face

----- Original Message -----
From: "Jinx" <joecolquittspamspam_OUTclear.net.nz>
To: "Microcontroller discussion list - Public." <@spam@piclistKILLspamspammit.edu>
Sent: Wednesday, January 05, 2005 4:39 PM
Subject: Re: [PIC]: HELP REQUIRED FROM NEWBIE


>> He he :-)
>> It's like when George W Bush said that :
>>
>> "The French can't do anything, they don't even have
>> a *word* for "entrepreneur" !!"
>
> That's a big word for Dubya. You do know that "entrepreneur"
> is (or was originally) a French word ?

But he never said it!

http://www.snopes.com/quotes/bush.htm

Bob Ammerman
RAm Systems


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