Controlling an awning or sun shade
Archiver
Posts: 46,084
Hi Dave:
"Store" is just my bad english. It refers (using the wrong word from
French) to an awning. Sorry about that
My awning is slow and heavy to move and I should avoid having it going up
and down too often as it would strain the motor.
However, if the wind is blowing too hard for a shoort period (say 1 minute)
and the awning is "down", it should react "quickly" (after a minute) and go
up to protect itself.
Once it has gone up because of strong wind, the system should check the
wind speed for a much longer period (say 10 minutes).
Only if the wind has been remained continuously under the speed limit
during the 10 minutes period, it should go "down" again. (and this
provided the sun is still shinning).
As for the wind sensor, I already have a rotary type (kind of simple
anemometer) that turns with a speed proportional to the wind's speed. In
each turn, it opens and closes once an interla contact. I could use this
sensor, although it doesn't seem easy to interface with te stamp (I could
use the "pulse" command and compute the time the contact is closed in
milliseconds). I would still have a calibration problem. I will chech Tracy
Allen's reference you have given.
The Light dependent resistor is an extremely cheap device I know well; it
could be used easily in this project as it requires no additional circuitry
(just the "pot" command to measure the resistance ---> light level (sun or
no sun).
The application with 2 LEDS you mention is a very smart and inexpensive
solution to have this solar panel "follow" the sun, therefore increasing
the number of insolation hours. But I need something simpler, just to tell
the BS whether the sun is shinning or not (i.e it is night or the sky is
cloudy)
The awning has a single motor that is powered by 300 V DC!!!. According to
the polarity applied, it turns in one direction or the other. This is an
old design, more recent motors use AC, though still at 230V level. The
problem is that it is no longer possible to obtain commercial systems to
automatically control an awmning with this old DC motor.
Replacing the motor would be a solution but it is very is very complicated
and expensive.
I can manage to invert the polarity of a DC 300V voltage and have 3 states:
(+300V; -300V an 0V), using 2 electromechanical relays 1PDT. Full
electronic solutions, such as a MOSFET H bridge could also work, but
probably at a higher cost and complication. In any case, ideas and
experiences are warmly welcome.
Now, that's why I have decided to build my own controller using a BS1.
But I have never programmed a BS (or any other Microcontroller, by the
way). It doesn't seem too difficult, as I can read/write Basic and Pbasic
iseems to be mainly a subset.
However I still cannot figure for example, how have the BS check for wind
speed to be low for 10 minutes, without using "wait" or "sleep", as it must
continue checking the wind speed during that long period.
I am also discouraged by the limitation of the EEPROM capacity to store so
few lines of code.
If any of you that have read this mail has the experience on how to deal
with this kind of control aand could help with ideas or examles (or
references) of code, please let me know.
Regards,
Jose Luis
At 03:10 29/09/2001 +0000, you wrote:
>Hi Jose,
>
>I have a few questions. First, does 'store' have a speical meaning?
>(showing my ignorance and/or confusion)
>
>you mentioned the shade going up 'rather quickly' but your control
>is only one rely for up and another for down. This would indicate
>one speed for up and another (or the same) for down.
>
>if you wanted 2 (or more speeds) in either direction, you may
>need additional contacts. I would not recomend electro-mechanical relays
>for any pulse operation.
>
>As far as a wind speed sensor, check Tracy Allen's site for an
>anemometer. He has a good description and workable design.
>
>I'm not sure the best light detector or what levels of light you want
>to sense, but I ran across a solar collector that uses a simple LED
>to detect light. it was basically a pair of LEDs that ran into a
>comparator, which ever had a higher output, the comparator switched
>the motor to swing the collector so the outputs matched, thus the
>direction pointed to the sun. This may not the the most applicable
>circuit, but I was intrigued with the idea.
>
>Dave
>
>
>
>
>--- In basicstamps@y..., Jose Luis Juarez <jl.ingenieria@i...> wrote:
> > Hi!
> >
> > Has anybody ever tried controlling automatically a store (or sun shade)
> > using a BS1?
> >
> > I am considering having 6 inputs:
> >
> > - sun is on or off (thru a Light dependent resistor)
> > - an adjustable reference resistor for the LDR
> > - Wind speed is under or over a limit (typically using rotary wind sensor
> > that open/closes a contact on each sensor turn) or any other wind sensor
> > you may know of. If over, the stor should go "up" rather quickly....
> > - an adjustable resistor to set the maximum wind speed
> > - Manual up
> > - Manual down
> >
> > The stor motors usually require 2 different relay contacts to close:
> > - Motor up
> > - Motor down
> > - No movement (both relays open)
> >
> >
> > Could anybody provide some help on the code or the logic flow diagram?
> >
> > Thanks in advance,
>
>
>
>To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
>from the same email address that you subscribed. Text in the Subject and
>Body of the message will be ignored.
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
"Store" is just my bad english. It refers (using the wrong word from
French) to an awning. Sorry about that
My awning is slow and heavy to move and I should avoid having it going up
and down too often as it would strain the motor.
However, if the wind is blowing too hard for a shoort period (say 1 minute)
and the awning is "down", it should react "quickly" (after a minute) and go
up to protect itself.
Once it has gone up because of strong wind, the system should check the
wind speed for a much longer period (say 10 minutes).
Only if the wind has been remained continuously under the speed limit
during the 10 minutes period, it should go "down" again. (and this
provided the sun is still shinning).
As for the wind sensor, I already have a rotary type (kind of simple
anemometer) that turns with a speed proportional to the wind's speed. In
each turn, it opens and closes once an interla contact. I could use this
sensor, although it doesn't seem easy to interface with te stamp (I could
use the "pulse" command and compute the time the contact is closed in
milliseconds). I would still have a calibration problem. I will chech Tracy
Allen's reference you have given.
The Light dependent resistor is an extremely cheap device I know well; it
could be used easily in this project as it requires no additional circuitry
(just the "pot" command to measure the resistance ---> light level (sun or
no sun).
The application with 2 LEDS you mention is a very smart and inexpensive
solution to have this solar panel "follow" the sun, therefore increasing
the number of insolation hours. But I need something simpler, just to tell
the BS whether the sun is shinning or not (i.e it is night or the sky is
cloudy)
The awning has a single motor that is powered by 300 V DC!!!. According to
the polarity applied, it turns in one direction or the other. This is an
old design, more recent motors use AC, though still at 230V level. The
problem is that it is no longer possible to obtain commercial systems to
automatically control an awmning with this old DC motor.
Replacing the motor would be a solution but it is very is very complicated
and expensive.
I can manage to invert the polarity of a DC 300V voltage and have 3 states:
(+300V; -300V an 0V), using 2 electromechanical relays 1PDT. Full
electronic solutions, such as a MOSFET H bridge could also work, but
probably at a higher cost and complication. In any case, ideas and
experiences are warmly welcome.
Now, that's why I have decided to build my own controller using a BS1.
But I have never programmed a BS (or any other Microcontroller, by the
way). It doesn't seem too difficult, as I can read/write Basic and Pbasic
iseems to be mainly a subset.
However I still cannot figure for example, how have the BS check for wind
speed to be low for 10 minutes, without using "wait" or "sleep", as it must
continue checking the wind speed during that long period.
I am also discouraged by the limitation of the EEPROM capacity to store so
few lines of code.
If any of you that have read this mail has the experience on how to deal
with this kind of control aand could help with ideas or examles (or
references) of code, please let me know.
Regards,
Jose Luis
At 03:10 29/09/2001 +0000, you wrote:
>Hi Jose,
>
>I have a few questions. First, does 'store' have a speical meaning?
>(showing my ignorance and/or confusion)
>
>you mentioned the shade going up 'rather quickly' but your control
>is only one rely for up and another for down. This would indicate
>one speed for up and another (or the same) for down.
>
>if you wanted 2 (or more speeds) in either direction, you may
>need additional contacts. I would not recomend electro-mechanical relays
>for any pulse operation.
>
>As far as a wind speed sensor, check Tracy Allen's site for an
>anemometer. He has a good description and workable design.
>
>I'm not sure the best light detector or what levels of light you want
>to sense, but I ran across a solar collector that uses a simple LED
>to detect light. it was basically a pair of LEDs that ran into a
>comparator, which ever had a higher output, the comparator switched
>the motor to swing the collector so the outputs matched, thus the
>direction pointed to the sun. This may not the the most applicable
>circuit, but I was intrigued with the idea.
>
>Dave
>
>
>
>
>--- In basicstamps@y..., Jose Luis Juarez <jl.ingenieria@i...> wrote:
> > Hi!
> >
> > Has anybody ever tried controlling automatically a store (or sun shade)
> > using a BS1?
> >
> > I am considering having 6 inputs:
> >
> > - sun is on or off (thru a Light dependent resistor)
> > - an adjustable reference resistor for the LDR
> > - Wind speed is under or over a limit (typically using rotary wind sensor
> > that open/closes a contact on each sensor turn) or any other wind sensor
> > you may know of. If over, the stor should go "up" rather quickly....
> > - an adjustable resistor to set the maximum wind speed
> > - Manual up
> > - Manual down
> >
> > The stor motors usually require 2 different relay contacts to close:
> > - Motor up
> > - Motor down
> > - No movement (both relays open)
> >
> >
> > Could anybody provide some help on the code or the logic flow diagram?
> >
> > Thanks in advance,
>
>
>
>To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
>from the same email address that you subscribed. Text in the Subject and
>Body of the message will be ignored.
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Comments
thanks for letting me know what 'store' meant.
Your project sounds interesting and it seems like
you have a good direction.
I trust there are some people on here who can offer the
best way to take a pulse input from your wind speed
sensor and turn it into a numerical value based on time.
I was thinking of just polling the port and seeing if
it had not been hi for 10 minutes, or if it has been
only high for 1 minute.
On suggestion I do have for your relays is to use
a DPDT and put the 'up' on the NC of one and the NO
of the other, and putting the 'down' on the NO of
the first and the NC of the second. That way, if
one is powered, it will break the circuit to the other
thus preventing power to both sides simultaneously.
Dave
--- In basicstamps@y..., Jose Luis Juarez <jl.ingenieria@i...> wrote:
> Hi Dave:
>
> "Store" is just my bad english. It refers (using the wrong word
from
> French) to an awning. Sorry about that
>
> My awning is slow and heavy to move and I should avoid having it
going up
> and down too often as it would strain the motor.
>
> However, if the wind is blowing too hard for a shoort period (say 1
minute)
> and the awning is "down", it should react "quickly" (after a
minute) and go
> up to protect itself.
>
> Once it has gone up because of strong wind, the system should check
the
> wind speed for a much longer period (say 10 minutes).
>
> Only if the wind has been remained continuously under the speed
limit
> during the 10 minutes period, it should go "down" again. (and this
> provided the sun is still shinning).
>
> As for the wind sensor, I already have a rotary type (kind of
simple
> anemometer) that turns with a speed proportional to the wind's
speed. In
> each turn, it opens and closes once an interla contact. I could
use this
> sensor, although it doesn't seem easy to interface with te stamp (I
could
> use the "pulse" command and compute the time the contact is closed
in
> milliseconds). I would still have a calibration problem. I will
chech Tracy
> Allen's reference you have given.
>
> The Light dependent resistor is an extremely cheap device I know
well; it
> could be used easily in this project as it requires no additional
circuitry
> (just the "pot" command to measure the resistance ---> light level
(sun or
> no sun).
>
> The application with 2 LEDS you mention is a very smart and
inexpensive
> solution to have this solar panel "follow" the sun, therefore
increasing
> the number of insolation hours. But I need something simpler, just
to tell
> the BS whether the sun is shinning or not (i.e it is night or the
sky is
> cloudy)
>
> The awning has a single motor that is powered by 300 V DC!!!.
According to
> the polarity applied, it turns in one direction or the other. This
is an
> old design, more recent motors use AC, though still at 230V level.
The
> problem is that it is no longer possible to obtain commercial
systems to
> automatically control an awmning with this old DC motor.
>
> Replacing the motor would be a solution but it is very is very
complicated
> and expensive.
>
> I can manage to invert the polarity of a DC 300V voltage and have 3
states:
> (+300V; -300V an 0V), using 2 electromechanical relays 1PDT. Full
> electronic solutions, such as a MOSFET H bridge could also work,
but
> probably at a higher cost and complication. In any case, ideas and
> experiences are warmly welcome.
>
> Now, that's why I have decided to build my own controller using a
BS1.
>
> But I have never programmed a BS (or any other Microcontroller, by
the
> way). It doesn't seem too difficult, as I can read/write Basic and
Pbasic
> iseems to be mainly a subset.
>
> However I still cannot figure for example, how have the BS check
for wind
> speed to be low for 10 minutes, without using "wait" or "sleep", as
it must
> continue checking the wind speed during that long period.
>
> I am also discouraged by the limitation of the EEPROM capacity to
store so
> few lines of code.
>
> If any of you that have read this mail has the experience on how to
deal
> with this kind of control aand could help with ideas or examles (or
> references) of code, please let me know.
>
> Regards,
>
> Jose Luis
>
> At 03:10 29/09/2001 +0000, you wrote:
> >Hi Jose,
> >
> >I have a few questions. First, does 'store' have a speical
meaning?
> >(showing my ignorance and/or confusion)
> >
> >you mentioned the shade going up 'rather quickly' but your control
> >is only one rely for up and another for down. This would indicate
> >one speed for up and another (or the same) for down.
> >
> >if you wanted 2 (or more speeds) in either direction, you may
> >need additional contacts. I would not recomend electro-mechanical
relays
> >for any pulse operation.
> >
> >As far as a wind speed sensor, check Tracy Allen's site for an
> >anemometer. He has a good description and workable design.
> >
> >I'm not sure the best light detector or what levels of light you
want
> >to sense, but I ran across a solar collector that uses a simple LED
> >to detect light. it was basically a pair of LEDs that ran into a
> >comparator, which ever had a higher output, the comparator switched
> >the motor to swing the collector so the outputs matched, thus the
> >direction pointed to the sun. This may not the the most applicable
> >circuit, but I was intrigued with the idea.
> >
> >Dave
> >
> >
> >
> >
> >--- In basicstamps@y..., Jose Luis Juarez <jl.ingenieria@i...>
wrote:
> > > Hi!
> > >
> > > Has anybody ever tried controlling automatically a store (or
sun shade)
> > > using a BS1?
> > >
> > > I am considering having 6 inputs:
> > >
> > > - sun is on or off (thru a Light dependent resistor)
> > > - an adjustable reference resistor for the LDR
> > > - Wind speed is under or over a limit (typically using rotary
wind sensor
> > > that open/closes a contact on each sensor turn) or any other
wind sensor
> > > you may know of. If over, the stor should go "up" rather
quickly....
> > > - an adjustable resistor to set the maximum wind speed
> > > - Manual up
> > > - Manual down
> > >
> > > The stor motors usually require 2 different relay contacts to
close:
> > > - Motor up
> > > - Motor down
> > > - No movement (both relays open)
> > >
> > >
> > > Could anybody provide some help on the code or the logic flow
diagram?
> > >
> > > Thanks in advance,
> >
> >
> >
> >To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@y...
> >from the same email address that you subscribed. Text in the
Subject and
> >Body of the message will be ignored.
> >
> >
> >Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>As for the wind sensor, I already have a rotary type (kind of simple
>anemometer) that turns with a speed proportional to the wind's speed. In
>each turn, it opens and closes once an interla contact. I could use this
>sensor, although it doesn't seem easy to interface with te stamp (I could
>use the "pulse" command and compute the time the contact is closed in
>milliseconds). I would still have a calibration problem. I will chech Tracy
>Allen's reference you have given.
Hello Jose Luis,
Interface: pullup resistor and RC filter:
470 2k
P0 ---o---/\/\
o----/\/\
+5 Vdd
| |
===== 0.1uf |
| '
anemometer switch
Vss
The 470ohm-0.1uf is a filter for switch bounce. The pullup resistor
should be a fairly low value, like 2kohms, because condensation might
form on the reed switch.(Tip #1: Condensation acts like a resistor
across the switch and forms a voltage divider with the pullup
resistor.) (Tip#2: If you have plenty of electrical power, the
pullup is fine to +5 volts, but if the system is battery powered, the
pullup should go to a Stamp pin so that power can be conserved if the
anemometer comes to a stop with the switch in a closed position.)
There are tradeoffs in the program code on the BS1.
The BS1 does not have the COUNT command, so the simplest way to do it
is as you say with the PULSIN command.
symbol x=w1
PULSIN 0,0,x
' x is inversely proportional to wind speed
' _except_ x=0 when wind is zero
' or very slow (>0.65535 second pulse length)
The time for the switch to remain low or high is affected by how
close the magnet is to the reed switch and temperature etc, and can
be quite unreliable. You can measure both halves of the cycle in
turn:
symbol y=w2
symbol x=w1
PULSIN 0,0,x
PULSIN 0,1,y
x=x+y
' x is inversely proportional to wind speed
This can be funny when wind speed is changing rapidly. An
alternative is to count the pulses for a fixed time, which is the
same as a fixed number of iterations of a for-next loop:
symbol new=bit0
symbol old=bit1
symbol x=w1
symbol i=b13
loop:
for i=1 to 200
new=pin0
x=new^old+x ' count changes in state
old=new
next
debug x
nap 6
goto loop
That loop is capable of counting at up to about 100 hertz. I am not
sure of the calibration of the timing on the BS1, but I am guessing
that the for-next loop time will be about 5 milliseconds. So 200
iterations in the loop is about ~~1 second. It is possible to
calibrate the output directly in mph or kmph or whatever.
At 1:02 AM +0200 9/30/01, Jose Luis Juarez wrote:
>However I still cannot figure for example, how have the BS check for wind
>speed to be low for 10 minutes, without using "wait" or "sleep", as it must
>continue checking the wind speed during that long period.
Do you need to use Sleep or NAP in your application? Your program
can leave the loop for a period of time to do other things, and then
come back and count the windspeed for another fixed interval. If you
are interested in the maximum windspeed during the interval, it is
probably best to test the windspeed every ten seconds or so, and keep
a record of the maximum and the average and make the control decision
based on that.
At 6:47 PM +0200 10/1/01, Jose Luis Juarez wrote:
>Any ideas on how to relate the turns per minute (or pulse lenght) to actual
>wind speed? Or a more friendly sensor?
What brand of sensor are you using? It is usually possible to pry
the calibration constant out of their technical support staff. In a
three-cup rotary anemometer, the response is linear when the ratio of
cup diameter to wheel diameter is 0.5. For example, the calibration
constant for the Davis Instrument's cups is 0.4333 hz (pulses per
second) per mph (sixty hertz at 138.5 mph windspeed.)
http://www.emesys.com/OWL2face.htm#Annemometer
It is not too hard to calibrate it in a car on a calm day, but the
anemometer has to be up out of the streamlines of the car!
>But I still do not see how to put it in a loop to count for 10 minutes
>while the BS still scans the other variables, such as "sun is on or off",
>and the manual switches. I cannot use "wait" for this reason. I will have
>to go back to my forgotten basic if I do not get some help from more
>experienced users.
If you break up the count and just sample the wind every 10 seconds
or so, that should be good enough to make the control decision and
also to take care of the other tasks.
-- best regards
Thomas Tracy Allen PhD
electronically monitored ecosystems
http://www.emesystems.com
mailto:tracy@e...