Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Tuesday, September 6, 2016

5$ TV Remote Control Using Smart Phone

I have following goals for controlling my Infrared Controlled Appliances:
  • Towards the goal of the controlling my TV, Set-Top-Boxes,AC,etc, at lower cost less than 5$ (or even go less in case one has  more IR appliances or one has already a raspberry/chip in home for Home Automation/IoT works) per device. I am leaving the cost of central controller, whose cost would be around 9$.
  • Design/Develop an Open Sourced system like LIRC project that controls the IR appliances using smartphone and WiFi(there by avoiding line of contact issues in IR based remote controls)
  • Make any old TV(including CRT TV and LED TVs that are not smart TVs,etc) to be  controlled from any smart phone
  • Also ensure that smartphone SHOULD not require  IR  based emitter (as smartphones with IR transmitter are little costlier)

To achieve these goals,  I have designed and tested initial version of my Centralized Home IR Appliances control system that can adapt and control different IR appliances at very cheap cost. The system has following features:
  • It is cheap
  • It Generic and one can add any number of IR devices
    • All one has to for adding new IR appliance is to add the IR codes in form of property file
  • Works with most of the smartphone (at present only android phones)
  • Gives generic REST based interfaces to control these appliances (TODO)
  • Gives generic RBAC control of these IR appliances (TODO)

For implementing initial working prototype, I chose:
  • Common costs for all IR appliances in a Home
    • 9$ Chip Computer as central control system where all Smart Phones sends commands . This device is common for all IR appliances in home (that are in same WiFi network). Though  I have chose 9$ chip-computer, once can use Raspberry-PI or any computer that run python.


  • 2A Power supply for each IR transmitter 2$ (approximate)
      • Per IR appliance costs for IR Transmission
        • For each IR appliance, I have put one ESP8266 device to send IR commands (which costed me 2.82$). For each IR appliance , we need to this board (in case if both appliances are not in same IR visibility)
        • I bought one IR Transmitter for 1.1$ (approximate) 
        • Power supply for each IR transmitter 1.1$ (approximate)

      At present the system control my TV and set-top-box. In future, I am going add more devices like my LG-Air-Conditioner

      I have put code in 3 projects in Git-Hub:

      Wednesday, July 13, 2016

      Get Current Time from Bed while sleeping (without seeing Watch/Phone) by simple Hand waving

      As a part of  Home Automation jobs, one of my use case is:


      • Know the current time in night (in pitch dark room)
        • with following requirements
          • I am still sleeping 
          • I don't want to open my eyes for seeing time on watch/phone
          • My phone or watch are 4 meters from bed, I don't want to go to that place to pickup phone/watch
      So thought that let me use latest hot/cheap wifi-chip ESP8266 (NodeMCU version) to do this job.

      I used a Passive Infrared Sensor (PIR - ~1$) , ESP8226-NodeMCU-Board ( ~4$) and Android phone (~your capacity)  for this purpose.

      • PIR 
        • Will sense any movement. I had kept this sensor at back of bed. If I wave my hand near PIR sensor, it will sense and give input to ESP8266 Chip
      • ESP8266
        • This will work as WiFi Access Point for Android mobile
        • Runs embedded firmware to sense the PIR reading & debouncing the PIR signal
        • Sends a HTTP call to Android Phone for speaking the time 
      • Android Phone
        • It will connect to WiFi-AP (from above ESP8266 )
        • It works as HTTP-Server for requests from ESP8266
        • It will run a Speaker service for any incoming requests from ESP8266
        • Ensure that works when phone in deep sleep mode

      I have finished 3rd version of the code (FW at ESP8266 & Android-App in Smartphone). I will put code and pictures in the weekend.

      Sunday, August 17, 2014

      Home Access Control System

      I was planning a Home Access Control System for lots of days. Finally got some time over past few months. Finally I finished version-2 of my Home Access Control System.

      Current version uses Raspberry for controlling the Main Door lock. Client are: Smartphones and RFID keys.

      At present, I have written Android client for controlling. But the system is capable to handle iOS/WinPhones.

      I will add more photos and code in coming weeks. More info can be found at at this place


      Friday, March 8, 2013

      OpenCL Helloworld program on Nexus 4 device

      After getting the CLInfo for Nexus Devices, I tried to map all OpenCL symbols for writing full fledged OpenCL applications on Nexu 4 devices.

      As part of this exercise, created mappings to all OpenCL exported functions and wrote one helloword example. With this mapping it is fully possible to write any OpenCL 1.1 specification based programs on C/C++ on Nexus-4 phones.

      Code is hosted at aopencl project .

      For a change this time used program to create command line executable at Nexus 4 phone. So to execute, one needs Android-NDK needs to be installed along with Android-SDK. More instructions are in README.

      BTW, output from the Devices comes likes this:


      shell@android:/data/local/tmp $ ./helloworld                                   
      Loaded library name:/system/lib/libOpenCL.so
      input string: GdkknVnqkc
      output string: HelloWorld
      shell@android:/data/local/tmp $


      As we can see from output, .so file mapped is: /system/lib/libOpenCL.so


      Tuesday, March 5, 2013

      CLInfo for Nexus 4

      Finally I submitted the changed code at  google-code.

      All Nexus-4 (possibly Nexus 10) users can try the application in download section at the same place

      In future, I will add more programs for Nexus 4 at same location.

      Happy coding :)