Monday, November 28, 2016

IR receiver + IR transmitter + RTC for Raspberry Pi

I needed an IR receiver for my Raspberry Pi which I use as an internet TV receiver with some custom program.  As expected, I could not find any IR receiver module that fits nicely in my favorite simple & discreet Rasperry Pi case which only exposes all connectors and GPIO.  A USB adapter was an option, but I did not want anything sticking out of the pi.  Solution: make my own.

The board is shaped so it fits nicely in the case.   Since there was plenty of board space left, I also put an IR transmitter and RTC (DS1308U)+battery in addition to the IR receiver.  The IR receiver and transmitter are connected to the standard LIRC GPIOs (GPIO18 for receiver and GPIO17 for transmitter).  The RTC is connected to the I2C bus, and is compatible with the DS1307 driver which is included in the current Raspibian Kernel.   All GPIOs used on this board belong to the upper 12 pins of the GPIO header so a 12-pin female connector can be used instead of a full 40 pin (SMT 40-pin female connectors are really pricey!)



The PCB is available here.

A low-power battery-operated 2-to-1 stereo combiner

I was shopping for a simple compact device which simply combines two stereo inputs into one, but couldn't find such a thing.  There are a bunch of products with fancy mixing and such, but I am not interested in those.  Long-life battery operation was another thing I was looking for.  My solution turned out to be making my own.

This is just a couple of text-book inverting amplifiers with AC coupling on both inputs and output sides to minimize DC current draw from the battery.  This way, DC current draw from the battery consists of just the opamps and the voltage divider for common mode generation.  Total DC current draw should not exceed 21 uA.  Optimistic battery life expectation is 220 mAh (from CR2032)  / 21 uA  = 416 days which of course depends on the actual usage of the device.

The PCB can be ordered at (I do not make any money).

Monday, August 8, 2016

Improving TX3 Pro Amlogic S905X Android box's IR remote sensitivity

TX3 Pro is a decent and affordable Android box based on Amlogic S905X.  Unlike many other cheap Android boxes, this box does have an window for the IR receiver.  Its IR sensitivity turned out to be indeed better than Tronsmart S95 Pro's, which is horrible due to the poor IR transmission of the body and lack of IR receiving window (you can drill a hole and replace the receiver with a decent one).  However, it is still not as good as I expected.  For example, it cannot detect IR reflection from the ceiling, which decent IR receivers with a proper window can handle.

I tried to align the IR receiver with the window as much as possible, but no noticeable improvement was seen.  So, I replaced the IR receiver with Vishay TSOP34438, which is pin compatible with the original. The legs of the receiver need to be bent so the receiving dome touches the IR window when the board is mounted on the case.  Now I can point the remote at the ceiling and the box still recognizes the signal with no problem - SUCCESS.

By the way, the IR remote control can be easily customized by editing /system/etc/remote.conf which has a mapping table from IR code to Linux key code (not Android key code!).  Here is a nice Linux key code table along with Android key code.  If remote.conf keeps being overwritten by the default one at reboot, make it readonly with chmod so it won't be overwritten.

IR window

Motherboard with the new IR receiver

New IR receiver

Original IR receiver