author
1Instructables5,701Views5CommentsJoined February 12th, 2016

Tell us about yourself!

Complete Your Profile

Achievements

  • wadebie commented on wadebie's instructable Automatic Curtain With Arduino2 months ago
    Automatic Curtain With Arduino

    Hi,No probbem asking !This waiting time is done via the variable minuteslightchangeThis is defined on line 53 and set to 3 minutes. set it to 0 and there will no waiting in between light and dark change...this is the code for the define :const unsigned long minuteslightchange=3; // light change interval in minutes, to prevent "hogging" curtain due to light/dark changeand on lines 174 and 200 the waiting is done in the if statement there :if (millis() - prevlmeasure > minuteslightchange * 60L * 1000L)millis() returns the runtime of the arduino in milliseconds. So multiplying here the minuteslightchange * 60 ( becomes seconds) and again by 1000 (becomes milliseconds) the elapsed time is compared with this outcome..Hope this helps further...

    View Instructable »
  • wadebie commented on wadebie's instructable Automatic Curtain With Arduino2 months ago
    Automatic Curtain With Arduino

    Ha, glad to hear it's working now !! I attached the new code. Mind though, that calculatiing the length of the night is also based a bit on your location too. I live in the south of the Netherlands, and based on that location the length of night during the year, the extra waiting time is calculated, so curtain will open at round about 7:45 - 8:00 o'clock.(or later because in autumn/winter, it will get light outside later)Alongside the exra wait time calculation in the morning, I made this visible too via the Led's. While waiting, every 2 minutes the green and yellow led will show the time before the curtain will be openend. The two led's will first flash both together, to indicate countdown will be shown. Then the green led wil flash once for every 10 minutes waiting, then the yellow ...

    see more »

    Ha, glad to hear it's working now !! I attached the new code. Mind though, that calculatiing the length of the night is also based a bit on your location too. I live in the south of the Netherlands, and based on that location the length of night during the year, the extra waiting time is calculated, so curtain will open at round about 7:45 - 8:00 o'clock.(or later because in autumn/winter, it will get light outside later)Alongside the exra wait time calculation in the morning, I made this visible too via the Led's. While waiting, every 2 minutes the green and yellow led will show the time before the curtain will be openend. The two led's will first flash both together, to indicate countdown will be shown. Then the green led wil flash once for every 10 minutes waiting, then the yellow led will flash for every remaining minutes, example : 2 green led flash, 5 yellow led flash (will flash a bit faster than the green led) means 25 minutes waiting left (+ an extra wait (2 or 3 minutes) which was already applied to prevent the curtain from hogging because of light changing due to clouds or whatever after just opening). The flashing could be annoying, just modify the code to not call the function indicate_number(n) then.b.t.w., during init fase, the version number is also shown via this indicate_number(n) routine. so init will take a bit longer and you see the leds flash a bit more, but don't worry, that is the intention here :-)Have fun with it !And thanks for your comments.

    Hi,Attached an image for full schematics (breadboard view from fritzing).Extra note : I used an external Power supply of 12 V, 2A with a barrel jack, which Iconnect to the Arduino. I then soldered the + and GND of the barrel jack connector from the Arduino to the L298 power connector, to power the L298N with this same power supply (you can also tap via extra wires from the barrel jack to the L298N, so the L298 gets powered via the same external power supply and you do not have to solder)Because your motor is not reacting, it could mean one of the following 1. the connections 4 and 5 from the Arduino to the L298 controller are not correct.2. GND from L298N is not connected to GND of Arduino3. The L298N can use 3 connections per motor to steer a motor. En(able)A, IN1 and IN2.(En(able)B, ...

    see more »

    Hi,Attached an image for full schematics (breadboard view from fritzing).Extra note : I used an external Power supply of 12 V, 2A with a barrel jack, which Iconnect to the Arduino. I then soldered the + and GND of the barrel jack connector from the Arduino to the L298 power connector, to power the L298N with this same power supply (you can also tap via extra wires from the barrel jack to the L298N, so the L298 gets powered via the same external power supply and you do not have to solder)Because your motor is not reacting, it could mean one of the following 1. the connections 4 and 5 from the Arduino to the L298 controller are not correct.2. GND from L298N is not connected to GND of Arduino3. The L298N can use 3 connections per motor to steer a motor. En(able)A, IN1 and IN2.(En(able)B, IN3 and IN4 are for the second motor, not used here).The EnA is either bridged via a Jumper (default, and means you cannot/have to use a PWM signal, which is indeed NOT used in this project, so there should be a jumper on EnableA on the L298N. Only IN1 and IN2 are used to pin 4 and 5. If pin 4 is set HIGH and pin 5 LOW, motor should turn one way, if pin 4 is set LOW, and pin 5 HIGH, motor should then run in opposite direction. Pin 4 and 5 LOW means motor stops. 4. The L298N (or motor?) is brokenYou can check also following links (which I also did use to get the idea) to use a L298N with Arduino :https://howtomechatronics.com/tutorials/arduino/arduino-dc-motor-control-tutorial-l298n-pwm-h-bridge/https://www.instructables.com/id/Arduino-Modules-L298N-Dual-H-Bridge-Motor-Controll/In both links, the PWM signal is used to steer (the speed) a motor, but you can ignore that, as long as there is this jumper on ENALet me know how your are getting along.(Maybe for some more encouragements :-) - I built two of these curtain controllers, and both are now operable for almost 6 months, and work flawlessly. The only thing what happened twice now, was that the hook of one curtain became unhooked somehow (one time the tension of the belt was not really good anymore and had also to retension the belt a bit). Hooking the curtain back in, and curtain nicely opens and closes again.Furthermore :Because I started the build in october 2017, winter was coming and nights were long and getting longer and curtain opening and closing time was acceptable. But now, almost summer, the curtains in our bedroom begins opening early, which is not convenient (it wakes us up too early !!).So I modified the code a bit, to wait a bit longer before opening, and this depending on the lenght of the night (there is no clock (RTC) attached to the Arduino, which might have been a bit easier or more controllable, but this works too) )

    View Instructable »
  • wadebie commented on wadebie's instructable Automatic Curtain With Arduino2 months ago
    Automatic Curtain With Arduino

    Ok, We will get that motor running :-)While I am working on the schematics, can you check if you connected the GND from the Arduino, to the GND of the L298N motor driver ? (when the motor/curtain rig is powered separately from the power of the arduino, this is absolutely necessary).Furthermore, with the L298N you can steer two motors. Only 1 is used for this project (Motor 1 terminal on :the L298N), make sure the motor is connected to this terminal.Hope this already helps,kind regards,William.

    View Instructable »