20170213_221200x

The mysterious IC

Sometimes Chinese manufacturers throw a mysterious, unlabelled, IC into their designs so we can spend a few hours trying to figure out what they are and what they do. It’s such fun! I’ve been playing with one of those this afternoon, trying to answer those questions but also trying to understand why! Why is that chip there? Why did someone decided she needed that chip there?

20170210_142531x

Some weeks ago a user of ESPurna asked me if the firmware supported Itead’s 1CH self-lock/inching board. My answer was “why not” since all Itead’s products are very much alike. Wrong. This one is different. Let me summarise why:

  • There is no entry in the Itead’s wiki for the device
  • There are no schematics, drawings, in the store
  • It uses (and brings out) a Songle SRD-05VDC-SL-C SPDT relay (there is only one other product using this relay in Itead Studio store)
  • It uses Itead Studio PSA-B module
  • It does not have an AC/DC transformer
  • My module supports 12VDC connection
  • It features a second button exclusively for the pulsing feature
  • There is no header to program the PSA-B module

All these things together kept me wondering… is this an Itead’s product?

I have no idea but I guess Itead sell products from other manufacturers in their web page (like everybody else). Actually you can find the same module under different brands on Aliexpress (herehere or a very similar one here [Aliexpress]). In this case the selling point is its “inching” feature. I call it “pulse” feature. There is a hardware button you can use to set the module in self-locking mode (basically like any smart device out there) or in inching mode, where the relay will change back after 1 second. Then you can connect your load to the NO or the NC terminals to suit your needs: always ON and turn OFF for 1 second or the other way around.

20170210_142515x

The button closer to the board edge is the inching button. It is next to an LED that show the current inching status: self-locking (or normal) when lit, inching mode when off.

Discovering

By discovery I mean to know what GPIOs are connected to what. The initial discovery was done why the same user that was asking for support. Using the typical Itead configuration (relay on GPIO12, LED on GPIO13 and button on GPIO0) worked fine. But we could not find where the inching button or LED were connected to.

im150310008-psa-pinmapx

The “schematic” of the PSA-B module in Itead’s page suggests that all those NC (non-connected) terminals are actually connected to GPIO14, GPIO15, TXD, RXD and RESET. But 14 and 15 did not seem to work with the second button.

So I asked Itead if I could have a sample of the board and they sent me one. Now: there are two versions of the board in Itead’s store: the 5V one and the 5V/12V one. Both have a PSA-B module, a Songle relay with COM, NC and NO screw terminals, two buttons and a microUSB port for power. But the 5V/12V one has also a screw terminal and a L7805 linear regulator.

I got the second, but not exactly the same model they have pictures of. Instead mine had a second 6 holes unpopulated header by the relay and an LED next to the inching button. Also, in my model the 4 hole header is not labelled. Because it is connected to the mysterious chip! I guess that in the 5V model the header is connected to the WiFi module.

The mysterious IC

20170210_142545x

Here it is!! On the center top of the bottom of the board. Unlabelled. Unknown. Unnecessary. Mysterious.

Grabbed my tester and my RocketBook and started sketching some notes. The mysterious IC is (obviously) managing the inching button and functionality. Contrary to some board by Itead (like the Dual), the main button is attached to the PSA-B module but since the mysterious IC needs to know about the relay being triggered it sits in the middle between the PSA-B module and the relay.

The 4 hole header looks like a programming header for the mysterious chip. Whilst the 6 hole header is only using 3: 5V, GND and pin to trigger the main button that could be useful if you use a case for the board (you should somehot, high voltage there).

rocketbook-2017-02-13-205025-page002

I never said I was good at drawing

There are two missing resistors (R4 and R5) that were designed to get rid of the unkown chip and drive the relay directly from the KEY pipn of the PSA-B module.

But the reality is that all the inching functionality is out of the hands of the ESP8266 based module. So bad luck here. But, why did they decide to add this chip? There is no need for it, the PSA-B module has 2 free GPIO that could be used for the inching button and the LED…

Using it with ESPurna

Flashing the PSA-B module

Since the header is not connected to the module flashing it is a bit harder. But not much. The main button is tied to GPIO0 so you can easily enter flash mode powering the board while pressing the button (the one that’s closer to the electrolytic capacitors).

Pins 7, 8 and 9 of the PSA-B module are RX, TX and GND (check my drawing above). I guess a 3-pin header might work but I happened to have some really tiny pogo pins that fit inside a female header just tight, so that’s what I did. An easy pogo-programmer.

20170213_221001x 20170213_221105x 20170213_221200x

OK, be quite and do not disturb

Since I don’t have access to the mysterious chip, I just let it there. Set it to self-locking mode (LED on) and forget. Be quite and do not disturb. I cannot use the hardware inching button but I have that same functionality from the web interface of ESPurna. Actually not the same: better. In ESPurna I can define the toggle back timeout (it’s 1 second fixed in the stock version).

Actually, there is something good about it

Actually, there is one good thing about the unkown IC. It has some kind of memory and stores the last status of the relay and the inching mode. That means that a reset in the PSA-B module (either user-driven or caused by the WDT) does not make the relay flicker.

But I still don’t know why…

CC BY-SA 4.0 The mysterious IC by Tinkerman is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

4 thoughts on “The mysterious IC

  1. freezing

    Because the PSA-B module is design for smart socket or other wifi switch product, it comes with firmware and just some easy hardware connection, then it can work with ewelink app without any coding. But PSA-B module just support one self-lock mode (All function as same as sonoff basic) – press the button pin or the app button, the relay pin output switch and keep in that status, so if you want the inching mode, you need add one more MCU to read the relay pin status and output a signal to button pin of the PSA-B module to switch it back after the delay you need~

    Yes, if you update the PSA-B firmware can get the inching mode without a outside MCU, but ITEAD just sell the PSA-B with the self-lock mode.

    Reply
    1. Xose Pérez Post author

      Hi
      I was waiting for someone from Itead to answer 🙂 Thank you!
      You basically mean the firmware on the PSA-B was not customized for the 1CH board because it comes as-is and it is closed source. So any partner willing to add more functionality while keeping support for the eWeLink App has to include a second microcontroller with that custom functionality.
      I guess it’s a business decision. You are providing an app and a cloud service that gets funded by purchasing hardware either by end users or partners.

      Reply
  2. Mariusz

    Dear Sir,
    i am struggling with very similar (not exactly the same) module – https://www.aliexpress.com/item/AC-220V-WIFI-Relay-Switch-Module-Low-Power-Self-Lock-Mode-Phone-Remote-Timer-Control/32785604742.html?spm=2114.13010608.0.0.qRE1sC
    Its smallest from any I found ready made without designing one myself. It seems to have pinout like on Your notes, however I am not able to flash it with alternative soft – pressing button or setting low gpio 0 makes led stop blinking at all but still no luck with flash mode. Anything else I could check ? I would appreciate any suggestions. This one seems to be almost perfect my use put mobile app is sort of pain and it uses cloud not to mention I cant integrate it with any opensource smart home soft.

    Best regards
    Mariusz

    Reply
    1. Xose Pérez Post author

      Hi Mariusz

      This one seems to have a PSA-B module. I suggest you to read my post about the Itead 1CH Inching board that uses the same module, there is a section about the flashing method. Hope it helps!

      Reply

Leave a Reply (all comments are moderated, be patient)