Window blinds

Hi Guys!
I need some help.
I’ve always wanted to have automatic window blinds.
Now it looks like i can! so i bought the following:
2x End stop microswitch with cable
NodeMcu Lolin esp8266 v3
ULN2003 steppermotor with driver

I will explain, i am a complete newbie to arduino. Would love to learn how to do it.
However, i am in the middle of moving and don’t have time to learn now.
So i hope there is someone who wants to help me out by:
-Drawing, what cable goes where and
-Writing the code to make it work.
I have found some code that should do more or less the same.

Difference being that my setup, the motor needs to spin until it hits the endstop.
Used in 3d printers. And the motor is different is a stepper motor

I hope you can help!

Very kind regards

C

Looks quite straightforward, you just need to replace the servo calls with functions to move the stepper, and wait for the switch to close. What stepper motor do you have?

There are pictures included in the post, of all components.

Oh yes, my bad :slight_smile: I have some of those motors, they are quite popular. You can find info around the web on how to set up and drive them, e.g. http://www.instructables.com/id/BYJ48-Stepper-Motor/

Ah ok! Thank you very much!
This will be some nice homework for me.

I just have a stupid question, i am really motivated to learn all of it!
And i mean all of it, because i have a lot of ideas to automate things in my house.
However, for me to figure out how to connect these boards and program it…
Will take me more time then i have.

So here it is (a little embarassed to ask), could you literally explain what pin connects to what pin and alter the code i found? I can fully understand if you don’t want to do that, but it would help me a lot.

Very kind regards,

C

I’m busy with other stuff right now, I can look into more detail next week. In the meantime maybe other people might chip in.

I’d also suggest going through some Arduino tutorials to get the basics. Then you will be able to follow the instructables etc to pick up more skills, and then it really snowballs from there.

Ah that is to bad! I hope somebody can help!

I am in 3d design and that started the same way, i needed a part that didn't exist.
Started with a tutorial and de snowball effect was there.

Now it's my fulltime job:)

So i am actually looking forward to learning to code this stuff.
Time is just not on my side.

But thanks a lot for your replies!

I did one of these - a robot so I could close my blinds to the streetlight outside my window and open them at dawn. Fun project.

I finally have it wired up. Looks like this:

const int s1 = D0;
const int s2 = D1;
const int s3 = D2;
const int s4 = D3;
const int Limit01 = D5;
const int Limit02 = D6;

pinMode(s1, OUTPUT);
pinMode(s2, OUTPUT);
pinMode(s3, OUTPUT);
pinMode(s4, OUTPUT);
pinMode(Limit01, INPUT);
pinMode(Limit02, INPUT);

Now i need to get this done (i could really use somebody to help me write it):

-Login to wifi network
-Connect to free online broker.
-wait for button push from mqtt
-Button 1:
Loop forward movement untill it hits endstop1.
-Button 2:
Loop forward movement untill it hits endstop2.

Movement code that works for me:
digitalWrite(s1, LOW);
digitalWrite(s2, LOW);
digitalWrite(s3, LOW);
digitalWrite(s4, HIGH);
delayMicroseconds(del*2);

digitalWrite(s1, LOW);
digitalWrite(s2, LOW);
digitalWrite(s3, HIGH);
digitalWrite(s4, HIGH);
delayMicroseconds(del*2);

digitalWrite(s1, LOW);
digitalWrite(s2, LOW);
digitalWrite(s3, HIGH);
digitalWrite(s4, LOW);
delayMicroseconds(del*2);

digitalWrite(s1, LOW);
digitalWrite(s2, HIGH);
digitalWrite(s3, HIGH);
digitalWrite(s4, LOW);
delayMicroseconds(del*2);

digitalWrite(s1, LOW);
digitalWrite(s2, HIGH);
digitalWrite(s3, LOW);
digitalWrite(s4, LOW);
delayMicroseconds(del*2);

digitalWrite(s1, HIGH);
digitalWrite(s2, HIGH);
digitalWrite(s3, LOW);
digitalWrite(s4, LOW);
delayMicroseconds(del*2);

digitalWrite(s1, HIGH);
digitalWrite(s2, LOW);
digitalWrite(s3, LOW);
digitalWrite(s4, LOW);
delayMicroseconds(del*2);

digitalWrite(s1, HIGH);
digitalWrite(s2, LOW);
digitalWrite(s3, LOW);
digitalWrite(s4, HIGH);
delayMicroseconds(del*2);

I hope somenone can help me.

-Login to wifi network
-Connect to free online broker.
-wait for button push from mqtt

Woah! That requires a fair bit of information about how exactly this online broker of yours works. Not to mention a bit of port mapping at your router.