Pages: [1] 2   Go Down
Author Topic: Using android phone to control remote dimmer  (Read 7770 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,
i am starting a project that i develop android apps to control a remote dimmer through arduino board.
however, the signal must pass through the arduino board, it also need a RS-232 port to connect a RS-232 wireless controller and the controller control the remote dimmer.

a few questions to wait any suggestions.

do i need to buy a arduino wifi shield?
could the board do the above opeartion at the same time?

actually i am new to arduino.

please give me any suggestions or ask more about the project. smiley-cry
Logged

Greenville, IL
Offline Offline
Edison Member
*
Karma: 15
Posts: 1330
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


 To go from phone to Arduino, you could use Blue Tooth, wifi shield, or Ethernet shield with Cat 5 cable.

 You can connect a Max232 chip to Arduino to get RS232 output.

 The Arduino can most likely do what you need with time to spare. We need more specifics to give more specific information.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


 To go from phone to Arduino, you could use Blue Tooth, wifi shield, or Ethernet shield with Cat 5 cable.

 You can connect a Max232 chip to Arduino to get RS232 output.

 The Arduino can most likely do what you need with time to spare. We need more specifics to give more specific information.
origianlly the remotre dimmer can be controlled by a remote control(it transmits signal through zigbee),
the remote control need to link up with a remote dimmer before using a sort of functions.
it can set on/off and also the brightness of the light
now i want the android apps replace the functions of remote control.
if i need to do so, i  suppose to use a set of devices (android phone >> arduino board as a platform to transmit the signal from wifi to RS-232 and send out to a RS-232 wireless controller>> remote dimmer
so how could i solve this problem?
or wt information you need to know abt this project?
Logged

Greenville, IL
Offline Offline
Edison Member
*
Karma: 15
Posts: 1330
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
suppose to use....android phone
Through a home network, or over the web?

Quote
transmit the signal from wifi
Do you have a wireless router hooked to a home network?

Quote
RS-232 and send out to a RS-232 wireless controller
Do you know what messages need to be sent for the wireless controller to work?


 Just to let you know, this project requires a fair bit of work. The forum can help you but, you need to be the one to provide effort, show your code, show hardware information, and ask specific questions for you to make progress on your project.

Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I just posted a way to do this using a windows phone, no app required, so it should work with the android.  The Arduino doesn't need to be connected with a wifi shield.  I used the wireless router in the house, just an ethernet shield and a cable.  The Arduino serves up a webpage and then it runs the x10 which do the dimming.  So, you access the web page from the android and click the buttons.  I have put 'dim and brighten', along with a number of x10 on/off command buttons.  The thing about x10, you have to select a specific address and then send an on, then you can dim/brighten.  Here is the video link. I posted the code in a previous post.

http://youtu.be/0a1vkSB2LQY

Regards,
Walt,
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I just posted a way to do this using a windows phone, no app required, so it should work with the android.  The Arduino doesn't need to be connected with a wifi shield.  I used the wireless router in the house, just an ethernet shield and a cable.  The Arduino serves up a webpage and then it runs the x10 which do the dimming.  So, you access the web page from the android and click the buttons.  I have put 'dim and brighten', along with a number of x10 on/off command buttons.  The thing about x10, you have to select a specific address and then send an on, then you can dim/brighten.  Here is the video link. I posted the code in a previous post.

http://youtu.be/0a1vkSB2LQY

Regards,
Walt,
i got your point, but i think it doest work in my project,
because i need to assume that there will have 2 or more lighting dimmer to connect my android phone through arduino board,
if i change the shield  as Ethernet, capacities will be the problem.
in my project, i got some idea now,
i used the serial device tester,software, to send hex to the RS232 wireless controller, it's work!
i can turn the light on and off and also the brightness.
but some fuctions do not function. ( i will show it later)
so, in other word, i need the arduino board to send out hex(should it be byte?) through serial port.
i will keep trying my work.
all guys could share your ideas here smiley

ah... another question, is it possible to directly connect my arduino uno r3 board TX and RX and gnd pin to RS232 serial port pin 2,3 and 5?
« Last Edit: October 14, 2012, 10:34:05 am by 011345687 » Logged

Greenville, IL
Offline Offline
Edison Member
*
Karma: 15
Posts: 1330
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
ah... another question, is it possible to directly connect my arduino uno r3 board TX and RX and gnd pin to RS232 serial port pin 2,3 and 5?


You need a max232 chip for that.

A link for example: http://sodoityourself.com/max232-serial-level-converter/
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
ah... another question, is it possible to directly connect my arduino uno r3 board TX and RX and gnd pin to RS232 serial port pin 2,3 and 5?


You need a max232 chip for that.

A link for example: http://sodoityourself.com/max232-serial-level-converter/
so i cant directly wire up those of pins of TX, RX and GND?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
ah... another question, is it possible to directly connect my arduino uno r3 board TX and RX and gnd pin to RS232 serial port pin 2,3 and 5?


You need a max232 chip for that.

A link for example: http://sodoityourself.com/max232-serial-level-converter/
so i cant directly wire up those of pins of TX, RX and GND? and why?
Logged

Greenville, IL
Offline Offline
Edison Member
*
Karma: 15
Posts: 1330
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


 The voltages of RS232 are different and sometimes higher.

Look on this page about the middle area where it talks about voltages. http://en.wikipedia.org/wiki/RS-232
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


 The voltages of RS232 are different and sometimes higher.

Look on this page about the middle area where it talks about voltages. http://en.wikipedia.org/wiki/RS-232
how abt the device has the input voltage of 5V?

Logged

Offline Offline
Jr. Member
**
Karma: 5
Posts: 94
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I made an android app to control your arduino over wifi / web. It has a few buttons that you can give a name and a string to send to the arduino.
the app can be found here: https://play.google.com/store/apps/details?id=com.marquesoft.ArduinoController&feature=search_result.
And the example sketch here: http://db.tt/GMoyi6hg.
Logged


Greenville, IL
Offline Offline
Edison Member
*
Karma: 15
Posts: 1330
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
how abt the device has the input voltage of 5V?

 With no datasheet, I can not say much. However, I think the 5V part is referring to the charging voltage of the battery.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i tried to directly wire up from arduino to RS-232 ( yea seriously). and I try to write a program.

unsigned long = dimmerON = 0x02FF400D; // i tested those of hex (02 FF 40 0D) can be turned on the remote dimmer by serial device tester
unsigned long = dimmerODD = 0x02FF000D; // and this hex can turn off the remote dimmer

void setup()
{
  Serial.begin(9600);
}

void loop()
{
 if (Serial.available () == 0)
    {
      Serial.print ( dimmerOFF,HEX);
    }

 if ( Serial.available () == 1)
    {
      Serial.print (dimmerON, HEX);
    }
}
 

i tested this program and i watched  the status from the serial monitor, it kept print the value 2FF000D repeatedly
while i send 1 to the monitor, it changed the value to 2FF400D but still repeatedly
and i tried to send another num to monitor, it stopped.

how come the value keep looping, how can i send  hex once only?

however i tried the above step after i connected between TX,RX and GND of arduino board and 232port 2,3,5 pin.
i sent 1 out , i could see the monitor that showed the hex of 2FF400D, but the remote dimmer didnt turn on.
what's the problem here?


   
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i tried to directly wire up from arduino to RS-232 ( yea seriously). and I try to write a program.

i tested this program and i watched  the status from the serial monitor, it kept print the value 2FF000D repeatedly
while i send 1 to the monitor, it changed the value to 2FF400D but still repeatedly
and i tried to send another num to monitor, it stopped.

how come the value keep looping, how can i send  hex once only?

however i tried the above step after i connected between TX,RX and GND of arduino board and 232port 2,3,5 pin.
i sent 1 out , i could see the monitor that showed the hex of 2FF400D, but the remote dimmer didnt turn on.
what's the problem here?


   
Reference the serial.available() function: http://www.arduino.cc/en/Serial/Available .

Serial.available() returns the number of data bytes available. In your code the statement

if (Serial.available () == 0)

means that every time there are 0 bytes available to read,

Serial.print ( dimmerOFF,HEX);

will be executed.

What you want to do is test for when Serial.available() > 0 and then read the byte from serial. You can then have an if statement, or switch statement to determine what should happen when a given byte is received.
Logged

Pages: [1] 2   Go Up
Jump to: