The HC-SR04 is a popular, and very inexpensive, ultrasonic ranging device and I'd like to modify one to change its functionality. If I can identify the controller I might be able to reprogram it, or at least replace it with one I can program myself.

The controller is a 14 pin SOIC and has pin 4 Vcc, pin 11 Gnd, Xtal between pins 5 and 6, and I think pin 7 might be a Reset. It has no markings at all on it, so the manufacturer obviously doesn't want me to know what it is.

The pinout doesn't seem to match any 14 pin PIC, or Atmel chip that I can find.

Is anyone familiar with this device or care to make an educated guess as to what the microcontroller might be?

  • \$\begingroup\$ Do note that if the device is cheap, the microcontroller may be one-time programmable or it may even use mask-ROM and not be programmable at all when manufactured. \$\endgroup\$ – AndrejaKo Jun 23 '12 at 19:42
  • \$\begingroup\$ Yes I thought it might be an OTP version of a standard device, but at least there might then be a reprogrammable version available that I could substitute. I expected that would be the most likely option. \$\endgroup\$ – Eddie Jun 24 '12 at 10:24
  • \$\begingroup\$ @Eddie - I've seen controllers which only exist in mask programmable and OTP. No reprogrammable version. (But from your other comments I understand that recovering this microcontroller is not that important, since you were mainly after the US transmitter/receiver, and you want to create a completely different application with it.) \$\endgroup\$ – stevenvh Jun 24 '12 at 15:00
  • \$\begingroup\$ have you been able to make a bat detector from the transducers? I had the same idea, but I was unsure, if frequency rage and sensitivity is sufficient for that purpose. Regards Joachim, Germay \$\endgroup\$ – user68450 Feb 23 '15 at 19:22
  • \$\begingroup\$ Out of curiosity, did anyone ever manage to replace the µC with something more sensible (PIC, AVR, anything)? \$\endgroup\$ – Florian Echtler Aug 22 '18 at 6:50

I think it might be EM78P153A microcontroller or something from that family, at least the pinout seems to match. And yes, it has OTP ROM.

enter image description here

Manufacturer's page: http://www.emc.com.tw/eng/8bit_gpio_ds.asp

  • \$\begingroup\$ Yep, that might be the one. +1 \$\endgroup\$ – stevenvh Aug 1 '12 at 16:07
  • 1
    \$\begingroup\$ Interesting device. The per-unit cost must really be worth it; I can't find compilers, debuggers, etc. outside from the vendor's own website. It's been my experience that vendors providing the tools for their own devices tend to do a poor job of it. \$\endgroup\$ – akohlsmith Aug 12 '13 at 22:34

The processor on the HC-SR04 is EM78P153A. A man named Emil has done a lot of work recently (2014) on the HC-SR04. http://uglyduck.ath.cx/ep/archive/2014/01/Making_a_better_HC_SR04_Echo_Locator.html

Here is schematic he has derived on the HC-SR04 : (edit : I posted this because it gives an up close view of the analog section on the receiver portion) enter image description here


It will be very difficult to find out what it is. The things you can be reasonably sure of is that it will be very very cheap (in high quantities), 8-bit, and if made in the far east a popular micro there. Maybe an 8051 of some sort.

Rather than trying to find out the micro used, since you have the transducers there I would just use them to make your own version, either by adding a little PCB to the existing one or moving the transducers onto a new one. There a quite a few tutorials on how to make your own around:

PIC sonar
PIC sonar 2

sonar schematic

PIC sonar

  • \$\begingroup\$ Actually, the reason I bought the HC-SR04 in the first place was to extract the transducers, as buying them here in the UK is more than double the cost of buying an HC-SR04 from China - including the delivery charge! However, I'm not using them for distance measurement - I'm making a bat detector. When I received the module I saw that it contains all of the circuitry I need, if only I could reprogram the controller. \$\endgroup\$ – Eddie Jun 24 '12 at 9:58
  • \$\begingroup\$ @Eddie - Ah I see, they are quite expensive here in the UK - the cheapest I recall seeing are at Rapid. \$\endgroup\$ – Oli Glaser Jun 24 '12 at 17:20
  • \$\begingroup\$ Yes, that's the cheapest I've seen from a UK supplier, and yet when you add VAT that makes £4.30 for a pair of transducers plus £5.95 post and packing. I paid £2.09 including shipping from China for the complete HC-SR04 module. I'm going to have to move to China! \$\endgroup\$ – Eddie Jun 25 '12 at 8:58
  • \$\begingroup\$ Yes that's the issue with RS/Farnell/Rapid, they all have a minimum order for free delivery. \$\endgroup\$ – Oli Glaser Jun 25 '12 at 10:50

It seems like you are referring to something like this schematic:


This is the datasheet for the stc11 series 8051 compatible microprocessors.


I don't think this is exactly what you are looking for as the controller (a PIC12C508) is a 16-pin SOIC. But it seems like a similar product. Maybe it will put you on the right track. Or maybe you could use one of these instead as you would have the full schematic. It is 3x as expensive as the HC-SR04 but I think a known PIC would be easier to modify than a brand-less micro.


  • \$\begingroup\$ Thanks for the reply - I'd seen the schematic of the SRF04 and another derivitive which is even closer to the HC-SR04 but, as you mention, they're PIC based which would be much easier to modify. I might just extract the controller and tack on a PIC with my own code in it. It just seems a pity to have to hack the board when everything is there that I need. It could make a VERY inexpensive bat detector! I can't really complain though - I only bought the module to extract the transducers!!! \$\endgroup\$ – Eddie Jun 24 '12 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.