8-pin chipThe PR26MF22NSZ and it’s larger cousin the PR39MF22NSZ  are miniature 8-pin devices which look for all the world like any other 8-pin chip – but are able to switch mains power at up to 0.9amps – i.e. up to 200w. Seems unbelievable but that’s the claim – sensible you could certainly run a typical mains light.

Given the very small size of our ESP-01 boards and the equally small size of the mains power supplies I found earlier, these would appear to be an ideal companion. Right now they are marginally more expensive than the cheapest Chinese relays and even very slightly more expensive than some solid state relays – but the size has to make it all worthwhile?

Digikey have the larger one at 1.18 but the postage kills that option – you have to wonder what their marketing people are thinking about – 1.18 for the chip – 12.00 for postage – come on guys – it’ll fit in an envelope!!!

The best I’ve seen up to now is £1.97 with free postage here..

 Here is some more info and a diagram.

So – the one I ordered turned up and has 7, not 8 pins. It is marked R39MF5. It is the surface mount version but in this case is no smaller, just has short leads, flattened for SM use. Pin 7 is missing.  I went out and bought the highest power bulb I could  – a halogen 75w lamp. I attached one end of the lamp to LIVE mains, the other end of the lamp to pin 8 of the chip and connected NEUTRAL to pin 6.   DO NOT DO THIS AT HOME UNLESS YOU ARE HAPPY TO DIE or know what you are doing.

I connected pin to a 330r resistor… so that the resistor would be + input and pin 3 would be – input.

That’s it. I tried with an isolated battery first – fine, checked with a meter, fine,  put pin 3 to GPIO0 on the ESP8266 and the resistor to the 3v3+ supply.   Works perfectly with the light going on and off on demand.

Finally, I left the light on for 10 seconds, disconnected the mains and immediately felt the chip – freezing cold.  So would I be happy to put some more power in there? YES. Mounted on a board with some copper to get rid of any heat I see no reason why this chip should not handle a 100w lamp. For the size I think that’s pretty good.


19 thoughts on “SOLID STATE MINI-RELAY FOR ESP8266

  1. Hello Peter,
    I just ordered a couple of those relays and I want to drive them from the ESP8266.
    I am wondering how you got the value of the resistor. Isn’t that quite high?

    I calculated a resisitor value of around 120 ohm, as the datasheet states, the Forward Voltage should be 1.2V @ 20mA.


    1. I think this must be old as I can’t remember specifying a resistor – but unless I got it wrong my suggestions are entirely based on experience, not maths. Each has their advantage.

  2. Talking about power supply,
    Is there any cheap and easy way to get 3.3V from mains A/C?

    I understand that currently best option is to use a cheap 5V (USB) adaptor and add a 3.3V reg.
    I’m wondering what circuitry there is in those adapters, and if that would be available separately.

    Ideally a chip as this PR39MF22 could have a 3.3V output. Ideally it could be stuffed into a (somewhat large) mains power plug together with the ESP.
    Of course, that’s only for fully-enclosed units with no connections to the outside or user.

    My fear with mains is not the risk of electric shock (as long as we keep it enclosed), but the risk of fire with low-end USB adapters that remain plugged all the time.

    Any thoughts?

      1. I only tried a bulb – and it was ok, did not try a compact fluorescent and that is more likely to need a snubber. in the past we’ve used a VDR.

    1. But am I not right in saying that it has lower current (0.3amps) capacity and more’s the point needs 6v in to trigger???

  3. that is just perfect to drive some “larger Relais” or even small appliances ..
    how much power does it all together draw then (the Relais and the ESP) ?

    i researching some solutions for very basic http/rest/json controlled WiFi Switches ..

    1. Not sure what “Relais” is but the ESP takes a fair bit of current. Not suitable for low power battery installations unless you have a large battery.

      1. sorry i meant “Relay” 😉
        the idea is to drive something larger to switch serious load (3000++ Watts)

        in my mind i was planning use some tiny SD Relay which drives a large Contactor.
        so i have physically seperation and not need to care about load issues ..

  4. Good find! A chinese seller on seems to have them for a bit cheaper if you order 15 or 20 pieces. Just search for PR39MF22 on the site and you’ll find said seller. BTW, the datasheet shows pin-7 is missing in the DIP package.

  5. You mention some cheap power supplies you found a while ago. But a search through here only found the article warning against the fake iphone chargers. (: would love to find a cheap mains psu option

    1. Check these out but the 3v3 suppliers are not very good – the 5v ones are – use a 3v3 linear reg as well to feed the boards.

  6. Pete
    Would you kindly share this other guy’s web site ?
    It might have also other interesting things for us.

    1. I think I lost it in the shuffle to the new blog… I have scanned up and down and can’t find it.

Comments are closed.