Decoding help.

Hi all,

I have a project I'm currently working on and it has me stumped so I thought I'd come here for one last attempt.

To modify existing machine to work for the intended purpose or purchase.

The company I work for were sold a linear weigher to reduce man power on a production line. It basically has 4 lanes that are fed from one hopper, you set the desired weight for each lane and it vibrates along untill the bucket is at the set weight. (Slows down nearer the target weight to avoid over weights).

We were sold this machine (Chinese imported rubbish) over a 18 months ago on a promise it will do what we want.
Much politics and many meetings later it's agreed it won't. This is where I step in as an engineer that is always trying to find solutions.

Basically we do wet/sticky products this machine is designed for dry products it will not work so after a meeting we decided to see if we could convert it to augers instead of vibration to push the product down.

So we have contacted the actual manufacturers in China who don't really want to help fair enough I guess.

So it's up to me to try and here is a basic explanation of how it works and hopefully some one can say oh do this and it'll all be good.

The vibration PCB has an pic16fxxx MCU on it that outputs a signal to optocoupler that has a triac connected to it's other side and this controls a 110vac supply to a vibrator coil.

I have since learnt about triacs and that to control the power output you must change the firing angle etc etc.

Our plan was to somewhere from the MCU pin onward intercept the signal with an Arduino and find it's minimum signal (0% on the HMI) and maximum signal (100%) on the HMI and convert it to a usable output for a motor type as yet undecided. So 0% would be 0rpm 25% would be 25rmp etc etc.

Using and UNO
I have tried a few things and haven't had any success.
I've measured frequency (it stays at 50Hz regardless of percentage)
I've measured duty cycle (stays at 6% regardless of percentage)
I've tried analogue read (stays at 0 with a very occasional 1023).

My oscilloscope shows the same readings so I think the UNO is ok?

I can't think what else to look I've tried both triac side (with load) and MCU side by removing the optocoupler and connecting the Arduino GND and pin 7.

Any tiny bits of help would be very gratefully appreciated.

I can provide photos if required no code to post as it's only basic stuff but maybe that's what I'm doing wrong?


Hey so I know it hasn't been long but to have 80 odd views and not one response is a sign that either I'm asking the wrong questions or it's not possible?

Is there another way I can interpret the output of the MCU that drives the opto-triac?

I think the zero switching is done elsewhere on the main motherboard as the driver board doesn't have any ac on the MCU side, only on the triac side, and the only link I can see between the two is the opto triac.


This seems like the perfect project to toss all the old electronics and design something that will actually work for your company. Don’t keep dumping money into such a project with no clear plan that it will ever work the way the company wants.


Hi Paul

You know it is a thought that has crossed my mind. That would entail a lot more knowledge beyond my skillset.
For example a way of inputting target weights, and under/over weights.

Interface with the existing load cells which look like they are addressed as lane 1,2,3 & 4. Each load cell has a bucket attached to it that has a stepper motor with a flag, that does one rotation to dump the bucket when it's at the correct weight.
And finally I would need an Arduino to be able to pick which bucket to to dump when one is available and how to pick one of more than one is ready.

Any ideas :stuck_out_tongue:


i expect the original vibrator stopped before dumping a bucket and then restarted after the bucket returned to it's home position.

Well, you have begun a nice list of requirements. You need to continue with it and then begin to add details until you have a clear specification for a replacement system. Then someone can decide which direction to go. Probably need to add time and costs to the final document.


Yes it had different levels of vibration so for example if you had a 800g target it would vibrate at 100% untill it has 700g in then would vibrate at 50% untill it has 785g in then would slow down again say 20% to load the last 15%.

This comes out of the unknown MCU via an optocoupler then to the triac to the vibrator coil.

My initial plan was to translate this signal some how and go from there.

As for budget I'm not sure as they have had it over a year and in total are in for about £16,000 so they are reluctant to spend more yet want it to work. Catch 22 really.

As it's at 50Hz would the Arduino be fast enough or serial fast enough to read any changes?


Then you and the company are facing a logistics problem, How do they continue to use the machine and at the same time make modifications that cannot be tested without endangering the continued operation of the machine. I am guessing some things you may have to do will not be reversible.


Its been trialled online a couple of times and just not performed so it is sat in our workshop awaiting it's fate. Even other engineers have given up on it.
I feel like it's a loosing battle

Hmmm... I was assuming it was running in production, just not very well. If you have nothing better to do , then if you were working for me, I would say continue.


Yes I do intend to but we currently are preparing for an audit so production and facilities take over at the moment.

Do you have any knowledge on electronics?

I'm thinking to before major reworking of the while thing I might look at swapping the triac for a mosfet and just seeing what the output signal is like.

I'm very much a trial and error engineer. Old school engineers at work sent really keen on it but it gets results....

Most of the time

Yes, I have knowledge of electronics, but you need to hire a local consultant to help you on-site.


Well that's not going to happen sadly.

Paul is the Arduino fast enough to read what the other MCU is outputting to the opto isolator?

The clock is 16Mhz so I assume so?

To control a opto isolator for triacs I have read it is basically a triac itself so would the MCU need to output a sine wave ?

I've been reading up on control of triacs etc but you get so much conflicting information it becomes difficult to narrow down a solution.


"Paul is the Arduino fast enough to read what the other MCU is outputting to the opto isolator?

The clock is 16Mhz so I assume so? "

Wrong question. The question is does the other MCU output a clock or other signal to tell the Arduino when to look at the signal line. Otherwise anything the Arduino sees is ambiguous. The Arduino could read the same signal 10 times and assume that is what the other MCU wants. OR the Arduino could read the other signal during a transition and have to assume the line was high or low or something in between.


Ahh ok, so as it's phase angle then the MCU on the driver board must know the Zero Crossing Point. I think this is probably done on one of the other boards as I can't see it on the vibrator drive board.
Do I need the Arduino to also see the zero cross point to "sync" with the MCUs output signal.

When I measured the MCU pin I desoldered the opto and then soldered one wire to each through hole on the input side. I then connected ground ground and pin 7 to the other wire. Should this instead come straight off MCU?

It's.hard to probe around as the PCBs are covered in a resin film of some sort.


I worked for years reverse engineering data communications, and had proper equipment and many pounds of documentation.

I have go as far with your project as I can. Good luck!


Hi Andy,

Where are you based? I realise you mentioned not being able to get outside help but if you reach the point of wanting outside help I know someone who might be interested in this project. He would want paying however. He is based close to Nottingham in the UK, how does that fit with you? (No, it's not me!)