Loading...
Pages: [1] 2 3 ... 7   Go Down
Author Topic: Newbi need some help please  (Read 1739 times)
0 Members and 1 Guest are viewing this topic.
South Africa
Offline Offline
Newbie
*
Karma: 0
Posts: 47
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi (I cant post in the home automation tread)

I need help please before I commit and buy.. I am disabled and would like to automate so tasks in my room.

I have some electric knowledge, not allot.
I am a pc Tech but no programing.

The things I want to do:
1.   Close the blind at specific time (I would like to add a light sensor to open and close the blind on light condition as well)
2.   I have some 12v LED downlights that I would also like to control via the light sensor.
3.   Have a push button on off switch to override everything (switch of the lights and close the blinds)

I have a 12v power supply (an old UPS)
That is it for now.

I am looking to get this:

http://www.ebay.com/itm/2012-Top-New-Quality-Version-Funduino-UNO-R3-Development-Board-USB-Cable-/160913613430?pt=LH_DefaultDomain_0&hash=item257732e276
http://www.ebay.com/itm/L293D-Motor-Drive-Shield-Expansion-Board-for-Arduino-Duemilanove-Mega-UNO-R3-AVR-/150927575574?pt=LH_DefaultDomain_0&hash=item2323fc0a16
2 x http://www.ebay.com/itm/360527843733?ssPageName=STRK:MEBIDX:IT&_trksid=p3984.m1426.l2649
http://www.ebay.com/itm/3-3-5V-input-LM393-light-Sensor-Module-for-Arduino-with-DO-AO-output-/200860535066?pt=LH_DefaultDomain_0&hash=item2ec438891a


The step i want the code to take this:
At certain time in the morning or when i press the button or when it gets light open the blinds
If it gets darker switch on the lights and close the blinds halfway
at night close or when i press the button the blinds and switch of the lights (if i can make the lights go of say 3min after the blinds closed it will work nice. Give me time to get into bed

Can the parts i want to get do this, do i need something extra and would someone help me with the coding please.

Thank you
« Last Edit: December 09, 2012, 06:44:06 am by kimbo001 » Logged

Celina, Texas
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Disclaimer! I am an Arduino newbie. I just did 'Hello World' last night. Proceed with caution!

To control the lights based on time of day I think you'll need some sort of real time clock. Perhaps you can use something like one of these:
http://www.ebay.com/sch/i.html?_nkw=arduino+rtc

I also found this which looks like you can get time of day without adding RTC hardware:
http://playground.arduino.cc/Code/time

I suggest that you look for projects that people have done that are similar to what you are trying to do. This may be helpful:
http://www.instructables.com/id/Arduino-controlled-window-for-cat/

I like Jeremy Blum's Arduino tutorials. Very newbie friendly.
http://www.youtube.com/user/sciguy14/videos?view=0
Logged

South Africa
Offline Offline
Newbie
*
Karma: 0
Posts: 47
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you
I have been searching for a straight forward blind control without the HTML GUI with no luck
It looks like everyone is building some robot or some other complicated stuff  i just need my blinds to open .. i will even skip the LED's and the light sensor.
Can someone help me or just point me in the right direction?
Logged

South Africa
Offline Offline
Newbie
*
Karma: 0
Posts: 47
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi.

After some reading I got the lights figured out but I need some advice with the blinds.
I am still waiting for my arduino so I have nothing to test on at the moment.

Here are my thoughts:

The LED’s

The led connected to a button connected to the light sensor. ( same as the night light with motion sensor just with a button)
So when it gets dark and the button is pressed switch on the led
That is all I need with the led

Now the blinds:

DC motor connected to a light sensor and a DPDT toggle switch
When it gets light open the blinds, when it get dark close them
Toggle is active whatever the reading is from the light sensor (kind of like a Manuel backup)

Problem: If I use the toggle to close the blinds during the day will the light sensor just open them again and if so how do I prevent this, same for the night
« Last Edit: December 17, 2012, 04:07:15 am by kimbo001 » Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 137
Posts: 19008
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
DC motor connected to a light sensor and a DPDT toggle switch
A "switch" implies manual intervention - do you mean "relay"?

Quote
If I use the toggle to close the blinds during the day will the light sensor just open them again and if so how do I prevent this, same for the night
Two light sensors? One inside the blinds, one outside.
A timer?
Logged

Pete, it's a fool looks for logic in the chambers of the human heart.

South Africa
Offline Offline
Newbie
*
Karma: 0
Posts: 47
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Tx AWOL

I will redo my blinds controller with two light sensors, did not think of it smiley

I thought you can connect a toggle switch without a relay?
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 137
Posts: 19008
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, I assumed the switch was there to control the motor direction.
Logged

Pete, it's a fool looks for logic in the chambers of the human heart.

South Africa
Offline Offline
Newbie
*
Karma: 0
Posts: 47
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

AWOL advice please

If i use a timer. say the blinds open at 6:30 and close at 19:00 will i have control with the toggle between those times?
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 137
Posts: 19008
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you want it, yes, of course. It is just a matter of either allowing the software to have an override, or wiring it so you have a physical override (my preferred method)
Logged

Pete, it's a fool looks for logic in the chambers of the human heart.

South Africa
Offline Offline
Newbie
*
Karma: 0
Posts: 47
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you smiley
Logged

UK
Offline Offline
Tesla Member
***
Karma: 89
Posts: 6319
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm reasonably confident that the features you're describing could be achieved using commercial off-the-shelf products. I guess it may work out a lot cheaper to build your own solution, and of course it's a fun and satisfying project in its own right, but have you considered the 'buy' rather than 'make' option?
Logged

South Africa
Offline Offline
Newbie
*
Karma: 0
Posts: 47
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Peter

I know it can be done with some commercial thing, but like i stated in the OP am disabled and have allot of time and this subject interest me allot, apart from that i don't really have the finances to just go out and buy.

BTW is there some newbie friendly tutorial that show how to control DC motors with a timer?
I just need the syntax for .. if time is xxx then set pin y to HIGH
But all i get is ppl making a alarm clock or something weird
« Last Edit: December 17, 2012, 12:08:36 pm by kimbo001 » Logged

Queens, New York
Online Online
Edison Member
*
Karma: 27
Posts: 1542
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi kimbo001,

There is a delay() function that can get you started, but I would suggest maybe a Real Time Clock circuit.

If you want to test the motor with the delay function, then you can try this.
Delay(Seconds * 1000); this will convert your Seconds into actual time seconds.
or if you want minutes and hours, then you need to use what is known as a nested loop.

Code:
int seconds, minutes, hours = 0;

while( hours != 1 /*the number of hours you want to set*/ )
{
 while(minutes != 60)
  {
    while(seconds != 60)
     {
        delay(1000);
        seconds++;
     }
    minutes++;
  }
hours++;
}
« Last Edit: December 17, 2012, 01:22:11 pm by HazardsMind » Logged

UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino

Arduino Tutorials, coming soon.

"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown

South Africa
Offline Offline
Newbie
*
Karma: 0
Posts: 47
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you

I bought a RTC for my arduino, what i am looking for is just the code to make to motor turn at certain time

At 6:00 turn motor1 for 20 secs forward .. something like that

I apologize for my newbie'ness but i thought i will get some sample i can just adapt but all Google give me is ppl building alarm clocks with LCD display, if that is not all most of these ppl don't even give you the code they just put a video on youtube with the result.

I understand that the norm is to let the newbi try first and then help him/her from there so just show me some small piece or point me to a sketch the control dc motors with RTC  and when i have something to show i I'll ask from there please
« Last Edit: December 17, 2012, 01:25:32 pm by kimbo001 » Logged

Queens, New York
Online Online
Edison Member
*
Karma: 27
Posts: 1542
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh ok well if your using a motor then you might need a H-bridge to run the motor, if you didn't already know that.

umm, what you can do is use that nested loop (just the seconds part) and set the delay as delay(20 * 1000); is 20 seconds and during that time you set your motor.

while(delay(20*1000) != 0)
{
digitalWrite(motorForPin, HIGH); //on for 20 seconds
}
// when the delay is done, motor off
digitalWrite(motorForPin, LOW);

something like that.
Im getting a RTC for myself, for right now I just use the nested loops, but I try to avoid them.
« Last Edit: December 17, 2012, 01:40:10 pm by HazardsMind » Logged

UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino

Arduino Tutorials, coming soon.

"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown

Pages: [1] 2 3 ... 7   Go Up
Print
 
Jump to: