logo elektroda
logo elektroda
X
logo elektroda

How do you control an RS485 system from an Android device? Converters and a Java app

webas 5043 7
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 11143517
    webas
    Level 10  
    Posts: 32
    Hello,
    I have a control system for lighting, sockets and switches based on RS485 communication and controlled via a computer using an app.

    I have a problem: I would like to be able to control this RS485-based system using Android (phones and tablets running this operating system).
    And here I am addressing my question to you, the experts.
    -What converters do I need to buy for my home system so that I can control all the existing modules?
    -Is this via 485 over LAN?
    -And what kind of application would I need to write in Java so that it can work with this RS 485?

    Thank you in advance for any replies.
  • ADVERTISEMENT
  • Helpful post
    #2 11143564
    Pawel2420
    Level 31  
    Posts: 1554
    Help: 136
    Rate: 101
    1. Bluetooth -> RS485
    2. LAN -> RS485
    3. USB -> RS485 (from Android version 3.0)
    4. USB -> RS232 -> RS485 (from Android version 3.0)
  • ADVERTISEMENT
  • #3 11144028
    webas
    Level 10  
    Posts: 32
    If it were a LAN to RS485 option, how would you connect it to an Android device? Would this converter act as a server, and would the Android device have to connect to it via TCP/IP and send it commands, or how would that work?
  • ADVERTISEMENT
  • #4 11144402
    Pawel2420
    Level 31  
    Posts: 1554
    Help: 136
    Rate: 101
    You will likely find detailed instructions on how to communicate with the converter in its documentation.
  • #5 11145994
    picia_p
    Level 12  
    Posts: 17
    Rate: 4
    Hello,

    This is how I would go about it:

    - BTM222, Bluetooth-to-RS232 module,
    - a microcontroller such as an Atmega8 or 168,
    - Max487 or equivalent,

    And you’ve got your setup ready; whether you want to control it from a computer or a smartphone, it’ll work via Bluetooth.

    The Android app is written in Java and runs a treat:)
  • #6 11146159
    webas
    Level 10  
    Posts: 32
    Good idea.
    But how should it be set up so that I can connect it to the internet and link it to my Android device via Wi-Fi? Because Bluetooth has a limited range, whereas with the internet you can connect from anywhere, and on a local network via Wi-Fi?
  • ADVERTISEMENT
  • #7 11147553
    picia_p
    Level 12  
    Posts: 17
    Rate: 4
    Hello,
    Controlling it via Wi-Fi is definitely possible from an Android device.
    At the moment, I’ve got the Bluetooth control sorted.
    I’m working on the graphical interface; once I’ve got the control interface more or less sorted, I’ll take a few screenshots and post them on elektroda.pl, and you can judge for yourselves what it’s worth:) .

    Constructive criticism is welcome.

    I have developed a lighting control system using power cables of my own design. I intend to integrate this solution with Android. This cable-based control offers extensive possibilities for lighting control, which is precisely what it was designed for.

    Here’s an example: we have a room with 8 halogen spotlights, and it’s controlled by a single switch, just as was usually done with halogen lighting systems.

    My solution allows you to control each of these 8 lights individually without major alterations to the wiring, and as we all know, any alteration comes at a cost.

    With a smartphone in hand, we can control the brightness of the lighting, make it flash, switch it on and off at times set by the user, and so on. In any case, the possibilities are there, and they’re considerable.

    In my own setup, I’ve replaced the halogen lights with LED ones. For several reasons. Firstly, halogens consume a lot of energy compared to LEDs. The lifespan of halogens is negligible compared to LEDs. Another reason is that the electronics controlling the lights would have to handle the high currents involved in halogen power supply. High currents mean high losses and more expensive electronics.

    That’s the gist of it; if there’s interest in this topic, I’ll expand on it and post a few photos.

    I have quite a few DIY LED light circuits lying around that I could put to good use :) .
    If there’s any interest, I can sell the circuits on.

    It’s late already and there’s still so much to do.
    Please forgive any grammatical errors – it’s late.

    Best regards
  • #8 11147903
    Pawel2420
    Level 31  
    Posts: 1554
    Help: 136
    Rate: 101
    I have a suggestion. New TVs allow you to run your own apps on them. Develop a solution so that, in future, everything can be controlled from the TV. Unfortunately, Bluetooth isn’t supported as standard.
ADVERTISEMENT