3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Automatic Window Blinds Controller (PICAXE)

Step 9Program The PICAXE

Program The PICAXE
(You can download this code (Light Activated Blind Controller v.1.2.BAS) by clicking on the link at the bootom of this page.

The actual code starts after the line below:


symbol Relay = 1

symbol Motor = 2

BEGIN:

readadc 4,b1
' this line measures the outside light level

if b1 > 240 then goto OPEN
' increase this number (240) to make the blinds open later in
' the morning - decrease it to open earlier

if b1< 200 then goto CLOSE
' increase this number (200) to make the blind close earlier in
' the evening - decrease it to close later

goto BEGIN

OPEN:

if b3 = 1 then goto BEGIN
' this command prevents the blinds from trying to open again if
' they are already closed

high Relay

pause 10
' this command delays applying current to the motor until the
' relay contacts are closed

High Motor

pause 6600
' adjust this number (6600) to tweak the blind open position
' increase to open more - decrease to open less (see note below)

low Motor

pause 10
' this command delays opening the relay contacts until after
' current is cut off to the motor

low Relay

let b3 = 1
' this command prevents the blinds from trying to open again if
' they are already closed

goto BEGIN

CLOSE:

if b3 = 2 then goto BEGIN
' this command prevents the blinds from trying to close again if
' they are already closed

high Motor

pause 6150
' adjust this number (6150) to tweak the blind closed position -
' increase to close more - decrease to close less
' (see note below)

low Motor

let b3 = 2
' this command prevents the blinds from trying to close again if
' they are already closed

goto BEGIN

' NOTE: when making adjustments to the open and closed blind
' positions, it is usually best to adjust only one of these
' settings as each will affect the other

« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
84
Followers
8
Author:biochemtronics
After a career in industrial electronics I went back to college and now do DNA research.