Patio Awning Controller
stephenwagner
Posts: 147
in Propeller 1
I would like to build a new patio awning controller using the Parallax Propeller. I have fooled around with both the BasicStamp and Propeller. I am a systems engineer and not a programmer.
I have a motorized patio awning attached to my house complete with an automated patio awning controller. I can deploy, stop and undeploy the awning remotely and or by pressing a button. The controller receives wind speed via a magnetic reed anemometer mounted on the roof. Depending on the wind threshold and mode, the awning shall undeploy or undeploy/redeploy after 12 minutes of no wind. The controller failed this past summer and I can no longer obtain a new one.
I can handle all the micro controller to relay interface drivers and input interface circuits. The software is where I am going to have issues
A little reverse engineering.
The controller is made up of the following:
1. AC to DC 5V power supply
2. A micro controller
3. SPST 5v controlled AC interrupt relay. Awning motor power
4. SPDT 5v controlled AC position 1 or 2 relay. Awning motor direction. The motor can never be commanded to deploy and undeploy simultaneously using a SPDT relay
5. 434MHz RF receiver. A little reverse engineering there and we have what looks like a Barker code, 3.3uSec and 6.6uSec mark space timing, 13 pulses.
6. 6 LEDs to indicate wind threshold
7. Push buttons to adjust wind threshold
8. A DIP switch for mode of operation
9. Push button to learn RF transmitter code
External to the controller:
1. A push Button to deploy, stop and undeploy the awning
2. A magnetic reed switch anemometer mounted on the roof
3. A 434MHz key fob size RF transmitter
4. Awning motor
The awning motor consists of a two (2) phase windings. Deploy, undeploy and common.
My first attempt at programming is to read and characterize the magnetic reed switch anemometer. I understand I will need to debounce. In an effort to characterize the debounce, I would like to continuously read the switch input until the current state changes, shift in the state multiple times like 16 until the readings are consistent, make note of the time and the bounce state characteristics, repeat the cycle three additional times and calculate the anemometer revolution time.
My code is a little sloppy, but I will get there. The code below is just to read in the reedswitch for one stae and then the other.
I have a motorized patio awning attached to my house complete with an automated patio awning controller. I can deploy, stop and undeploy the awning remotely and or by pressing a button. The controller receives wind speed via a magnetic reed anemometer mounted on the roof. Depending on the wind threshold and mode, the awning shall undeploy or undeploy/redeploy after 12 minutes of no wind. The controller failed this past summer and I can no longer obtain a new one.
I can handle all the micro controller to relay interface drivers and input interface circuits. The software is where I am going to have issues
A little reverse engineering.
The controller is made up of the following:
1. AC to DC 5V power supply
2. A micro controller
3. SPST 5v controlled AC interrupt relay. Awning motor power
4. SPDT 5v controlled AC position 1 or 2 relay. Awning motor direction. The motor can never be commanded to deploy and undeploy simultaneously using a SPDT relay
5. 434MHz RF receiver. A little reverse engineering there and we have what looks like a Barker code, 3.3uSec and 6.6uSec mark space timing, 13 pulses.
6. 6 LEDs to indicate wind threshold
7. Push buttons to adjust wind threshold
8. A DIP switch for mode of operation
9. Push button to learn RF transmitter code
External to the controller:
1. A push Button to deploy, stop and undeploy the awning
2. A magnetic reed switch anemometer mounted on the roof
3. A 434MHz key fob size RF transmitter
4. Awning motor
The awning motor consists of a two (2) phase windings. Deploy, undeploy and common.
My first attempt at programming is to read and characterize the magnetic reed switch anemometer. I understand I will need to debounce. In an effort to characterize the debounce, I would like to continuously read the switch input until the current state changes, shift in the state multiple times like 16 until the readings are consistent, make note of the time and the bounce state characteristics, repeat the cycle three additional times and calculate the anemometer revolution time.
My code is a little sloppy, but I will get there. The code below is just to read in the reedswitch for one stae and then the other.
con _clkmode =xtal1+pll16x _xinfreq =5_000_000 led =16 reedswitch =0 var byte currentstate byte time0 byte time1 long InputA long InputB OBJ pst : "Parallax Serial Terminal.spin" pub controller dira [16]:=1 dira [0]:=0 'waitcnt(clkfreq + cnt) pst.Start(115_200) ' Set Parallax Serial Terminal to 115,200 baud waitcnt(clkfreq + cnt) repeat InputA:=0 InputB:=0 currentstate := ina[reedswitch] repeat until currentstate <> ina[reedswitch] repeat 16 InputA << = 1 inputA += Ina[0] outa[led]:=1 pst.position(0,0 ) pst.bin(InputA,16) currentstate:= ina[reedswitch] repeat until currentstate<>ina[reedswitch] repeat 16 InputB << = 1 InputB += ina[0] outa[led]:=0 pst.position(0,2) pst.bin(InputB,16)