Showing posts with label 9$ chip. Show all posts
Showing posts with label 9$ chip. 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:

      Monday, August 15, 2016

      Data mining by Python script to get data from 9$ Chip's battery health

      I got finally my 9$ chip boards. Fortunately this boards comes with LiPo battery connector and charging IC (named axp209). One can query this chip's i2c subsystem by i2cget/ic2set commands to get the data about system's battery status like:

      • Battery voltage
      • Charging current
      • Battery connected
      • Battery charging
      • etc
      NTC provides a shell script that fetches above data. But running this script in daemon mode and collecting data from multiple chips (which are in network) would put  strain on CPU/battery resources of chip as this script executes almost 50 unix processes for getting 10 sensor values and it also might drain battery (when main power goes off AND monitoring scripts should not drain resources).

      As I am going to monitor system using other python scripts as well, I started porting the axp209 script to python script using i2c-tools/py-smbus module. But this porting does not work in  python as smbus python-module does not provide forceful read/write of i2c-device addresses (for safe reasons). 
      Similar options were provided in command line tools of  i2c-tools (like i2cget, i2cset, etc). So I have hacked  i2c-modules/py-smbus code and changed/added 3 lines to get similar forceful opening in smbus module of python.


      Changed i2c-tools/py-smbus code is at github

      Using the above  modified smbus module, I wrote python script that collects 9$ chip data in daemon mode. Source code is at github


      This changed i2c-tools/py-smbus code can be used for raspberry pi as well (one has to change i2c-bus and device addresses accordingly)

      Warning: Developer should be aware that forceful read/write of i2c devices can lead to dangerous consequences (if done unknowingly/inappropriately/etc). So developer is responsible for using this changed code :)