Can ultrasonic sensor send compartible data to other PCB?

In my workplace, there’s a ticket redemption machine called Pop It & Win where its ultrasonic sensor and the small PCB that contains the programmable IC (STC15W204S) used to program the sensor was no longer functional. The ultrasonic sensor (in my case, it’s RCWL-1601) is used to measure the distance between the balloon above and the sawblade below.

For the machine itself, the PCB that holds the ultrasonic sensor contains 3 pins; 5V, GND, and SIG, to be connected to the game’s internal PCB, and the game also contains test menus displayed in a liquid LCD, where one of the menus is sensor detection (there’s a manual link below for more detailed explanation):

  1. If the sensor is functional, it’d display the balloon’s size in percentage (how far the balloon is from the sawblade, like 50% if it’s halfway there)
  2. If the sensor isn’t functional, it displays “no sensor response”

Can Arduino’s program (perhaps would be similar to the programmable IC’s program before) be made to send data that is compartible to said game’s internal PCB? To be able to make the game’s internal PCB respond with showing the balloon’s size if the sensor/program works?

Or what’d be another way to get/replicate the program from said programmable IC? Buying the sensor + PCB again isn’t an option as it can’t be accessed/the stock runs out.

Edit: Also an important note, the ultrasonic sensor isn’t only about displaying the balloon size, it also affects how the game works, like the pump inflating the balloon into its last known size if the machine is turned on again after it was shut down before.

Edit: Here’s the manual for the machine (Explosive, but it’s the same as Pop it & Win but 2 players), for more detailed explanation as provided by @JohnLincoln .

You mean it's not a long term option because the stock will run out soon?

If so, grab one now and analyse it with an oscilloscope. Only then will you be able to make an Arduino based replacement.

The problem is the "SIG" connection could use various ways to communicate its data to the main board. Not knowing what protocol makes the project very difficult.

Short of capturing and analyzing how the original STC15W204S IC outputs the sensor data on the SIG pin—its timing, voltage levels, and data encoding—it's going to be hard. If your unit is broken and the stock has run out, maybe the vendor can provide you with technical details?

(typical data encoding could be pulse-width modulation, where pulse length corresponds to distance; frequency modulation, where frequency varies with distance; serial communication protocols like UART or SPI sending digital values; and analog voltage proportional to distance. Sometimes simple digital pulses represent trigger and echo timing for distance calculation).

I found a photograph of the ultrasonic sensor at a website selling spare parts: spares.udc.co.uk/pop-it-and-win/SPRE0632.

It is made by parallax.

There is lots of information about it on the manufacturers web page: parallax.com/product/ping-ultrasonic-distance-sensor/

Do you know which is faulty, the sensor or the IC?

There is a tutorial telling you how to use the parallax ping sensor at learn.parallax.com/kickstarts/ping-ultrasonic-distance-sensor/

The tutorial even has some Arduino code for using the sensor:

const int pingPin = 11;
unsigned int duration, inches;

void setup() {
  Serial.begin(9600);
}

void loop() {
  pinMode(pingPin, OUTPUT);          // Set pin to OUTPUT
  digitalWrite(pingPin, LOW);        // Ensure pin is low
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);       // Start ranging
  delayMicroseconds(5);              //   with 5 microsecond burst
  digitalWrite(pingPin, LOW);        // End ranging
  pinMode(pingPin, INPUT);           // Set pin to INPUT
  duration = pulseIn(pingPin, HIGH); // Read echo pulse
  inches = duration / 74 / 2;        // Convert to inches
  Serial.println(inches);            // Display result
  delay(200);		                 // Short delay
}

It looks as though it operates in the much same way as the more common and cheaper HC-SR04, except that it only uses a single pin for trig and echo.

It would be possible to write Arduino code to use the more common 4 pin HC-SR04 in place of the original.

The stock isn’t available to be ordered. And there are no oscilloscope in my place. It’s also risky to grab a working example to be analyzed like, if it can get damaged too.

The IC, because I’ve tried using a brand-new working ultrasonic sensors on said IC/PCB, and it still doesn’t work

Ways to capture how the original IC’s program works? (and they’d have code protection enabled) This’d be the photo of the PCB that contains the IC and how there’s 3 pin socket with SIG, 5V, and GND that is connected to the main board. RCWL-1601 is said to be able to be replaced by HC-SR04

Still, are there other cases of Arduino program that is able to send compartible data to something that has an internal working data on its own? If yes give me an example (simple one).

Yes, there are hundreds of thousands of examples that fit your request.

I once used an accelerometer sensor connected to an Arduino Pro Micro to control movement of the mouse pointer on a PCB screen.

I built a weather station that has wind, light, temperature and humidity sensors connected to an Arduino which sends the readings over WiFi to a database on a server.

In my mind these are quite different scenarios to your game machine, but they fit your request for examples!

For the server database example, what’d happen if said server database has no Arduino/one of the devices connected? Would the server actually give an output itself about no data detected? (means perhaps the server has its own coding work too).

In my case, it’s the game’s internal PCB itself that outputs “no sensor response” in the LCD when there’s no working sensor/the program is incompartible, and with working sensor/program it outputs “balloon size: [x]%”, and the info isn’t only displayed in the LCD, the sensor’s result affects how the game works too.

Yes. The server coding is in PHP. It flags any Arduino/sensor that had not sent any values for 1hr in red. Not sure how this is relevant to your question. Can you please explain?

Guess to put it into words, I want to know how the Arduino value output is written in the IDE, like how it has to be written so that the Arduino/sensor isn’t flagged despite still sending data (e.g. because the IDE programming of said values isn’t compartible to the server coding).

My question can seem similar in how the game’s internal PCB outputs balloon size in percentage or “no sensor detected”, and that even if the ultrasonic sensor outputs something, if what’s written in the IDE coding isn’t compartible, it’d still be not detected in the game’s internal PCB. And the data is also required by the game not only for displaying the size, but also for its functions like the pump inflating the balloon into its last known size if the machine is turned on again after it was shut down before.

Ok, I guess that's probably pretty simple. The main board sends a trigger signal to the sensor. The sensor sends back a signal indicating, in this case, the distance. If no signal is sent back at all, probably after a timeout,the main board knows the sensor is missing or faulty.

My next question is, why do you think an Arduino will be helpful to fix your game? Would the signal from another similar sensor not be acceptable, but the Arduino could translate the signal somehow?

As yeah, so far for what I know, Arduino is the one that may be able to replicate the program in the original IC STC15W204S to activate the ultrasonic sensor, take data from it, and send that through SIG pin.

If not Arduino, then what’d be the alternative? I’d need something to send data through said SIG pin that the balloon size is displayed in the game’s Test Menu and have the data affect other things too like pumping the balloon to last known size when turned on.

Did you figure out which data and what’s going on with that SIG pin?

Note that an ultrasonic sensor can not tell you the size of a balloon. It can only tell you the distance between the lower edge of the balloon and your sensor. This is providing that the balloon is not closer than the minimum distance the sensor will work from.

Maybe you know this, but it doesn’t come across in the words you are using.

Not yet, which is why I asked here about if Arduino can send acceptable type of data to the game’s PCB like the program in the original IC.

And I don’t know how to figure out said data if the IC’s programs are read-protected and using the working ones in other machine can put them at risk.

Yeah, though the lower edge of balloon and sensor’s distance would indirectly indicate the balloon’s size, as the bigger the balloon is, the shorter the distance between the balloon and sensor and vice-versa.

The balloon is pumped up bigger and bigger from above, in the exact same spot, until its lower edge reaches the sensor/sawblade below.