A problem to solve...

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
nmasson
Posts: 7
Joined: Wed Jun 18, 2003 1:01 am
Location: Los Angeles
Contact:

Post by nmasson »

Hi All again,

Thanks again for the discussion. All of the input thus far is being digested as far as my brain and time allows.

To answer a couple of the more recent questions.

Static IPs. (jollyrgr)

Yes...good idea and that has now been half implemented. The DNS 323 NAS was easy. The router (Linksys 54GS variety), not done yet. However it is my experience that these consumer grade routers, modems etc, need a reboot every now and then anyway. What's the first thing a support tech says? "Can you power cycle for me please?"

PC Control (haklesup)

Good thoughts...wrong assumption though.

My house (unfortunately) is home to many PC desktops and transient laptops. The modem, router and NAS are always on. PCs are turned on when needed. (wife's office, or kids, or mine, laptops) They (hopefully) get their IP address, connect to the WAN and NAS and off they go. My PC is the only one connected via Cat 5...all others are wireless.

Implementation (Mr Al and all)

I'm just thinking out loud here. Hopefully you guys can respond with constructive criticism.

I like the thought of using normally closed relays for the loads rather than active devices. (SCRs, Triacs,) This way, once the little black box does its routine, it won't be involved at all. If it fails...it won't matter.

So what I'm thinking is

Press Button
Micro springs to life
Opens all the contacts. (therefore removing power from devices)
Micro does it routine closing the contacts in sequence (with delays)
Maybe sense current draw from devices?? (intelligence)
If all ok...then show some cool leds that will give my wife assurance
Shuts itself down.

What say you? (collectively)

Cheers
NM
User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl »

Hi again NM,


I think your idea of having the normally closed relays
is pretty good, because with no power applied the circuit
would default to what you have now, which at least works
to some degree. Keep in mind however that circuits these
days can be made pretty reliable even when complex.

To repeat your sequence of events:
START EVENTS
Press Button
Micro springs to life
Opens all the contacts. (therefore removing power from devices)
Micro does it routine closing the contacts in sequence (with delays)
Maybe sense current draw from devices?? (intelligence)
If all ok...then show some cool leds that will give my wife assurance
Shuts itself down.
END EVENTS

I happen to think that sensing the current draw is not really
needed and complicates things quite a bit because you have
to sense current, which requires more circuitry. As long
as the units are plugged in they will draw current unless something
goes wrong with them and that would be obvious i think.
To sense current each circuit would require a resistor
and op amp and associated resistors or a current transformer
and resistor and rectifier. It may be possible to sense with
a single power resistor i guess, with a fuse too, if you dont mind
no power line isolation. It's up to you though.

I also happen to think that the micro does not have to shut
itself down (a bit more circuitry here too) because these
things draw so little power they could be run for a year
for less than 10 cents :smile:

I have to agree with the LEDs however, because status is often
comforting to an equipment operator (your wife or you). Knowing
that everything is done is a very good idea, and maybe even
one LED for each stage of the process (one for each ac device).

The modified events would go something like this then:

START EVENTS
Press Button
Micro springs to life
Opens all the contacts. (therefore removing power from devices)
Micro does it routine closing the contacts in sequence (with delays)
If all ok...then show some cool leds that will give my wife assurance
END EVENTS

As i was saying, if you really want to sense current then we
would have to start talking about current sensing techniques
next.

As to the program for the uC itself, it would go something like
this:

Initialize
call InitializeAssociatedRegisters
call TurnOnRelays ;turns everything off
Loop
goto Loop ;effectively wait for interrupt
Start
call Delay30s
call TurnOffRelay1 ;also powers LED1
call Delay30s
call TurnOffRelay2 ;also powers LED2
call Delay30s
call TurnOffRelay3 ;also powers LED3
goto Loop

InterruptRoutine
call Delay500ms
EnableInterrupts
goto Start

In the above, Delay30s is the 30 second relay delay, and
Delay500ms is the switch debounce delay. The status is
indicated by the three LEDs, and when all LEDs are 'on'
the sequence is complete.
The TurnOn and TurnOff subroutines are simple port writes.

The wiring would be such that the three relays are controlled
by three output ports, and the push button switch is connected
to an input port which triggers an interrupt on either edge.


My only remaining question now is, is it possible that the
30 second delays will have to be a little longer, like 35 or
40 seconds, or will 30 seconds ALWAYS work ok? The reason
i ask is because if the delay has to change for any reason
the uC has to be reprogrammed. On the other hand, if there
is an external pot to adjust the delay it could be done
by turning the pot. This of course requires an additional
pot to be connected to the uC and this would adjust the delay
for ALL three relays. Independent adjustment would require
three pots.
LEDs vs Bulbs, LEDs are winning.
User avatar
jollyrgr
Posts: 1289
Joined: Thu Jan 03, 2002 1:01 am
Location: Northern Illinois
Contact:

Post by jollyrgr »

Let me clarify my suggestion; Static IPs for the router and NAS devices. DO NOT static the client devices (computers, laptops, wireless or wired). Usually computers are much more forgiving at finding an IP. And as long as the network is working they will get an address properly.
No trees were harmed in the creation of this message. But billions of electrons, photons, and electromagnetic waves were terribly inconvenienced!
nmasson
Posts: 7
Joined: Wed Jun 18, 2003 1:01 am
Location: Los Angeles
Contact:

Post by nmasson »

Hi Jollyrgr and Mr Al,

Yes, I understood the Static IP assignments for the router and NAS. Thanks for clarifying though. All clients remain DHCP clients. I have made the changes and only time will tell. Just because a consumer grade device has a static IP doesn't mean it will be free of reboots. I did 6 reboots (as a test and all simultaneous), and 1 of the times the router had a brain fade.
Anyway, I want to proceed with the project, if for nothing else, a learning curve. No better way to learn that build something.

So...I have ordered a few things from Sparkfun Electronics. (A U.S. distributor for picaxe)
A starter kit, cable etc and a few micros. (a couple of 08s and a 40x)

As Mr Al says, the BSII can collect dust.

So in a couple of days...I can start in earnest.

Cheers and thanks again.
Post Reply

Who is online

Users browsing this forum: No registered users and 154 guests