In the last few months I’ve made over 40+ P1 modules. Each module I’ve sent to the customer is fully tested on my own P1 meter. That means each time I have to disconnect my own, to connect the to-be-tested module. Now I’m lazy and don’t like to connect my own module each time (read: I just want to make/start a new project 😂). So I figured I wanted a splitter of which each port acted like a P1 interface.
The idea is simple: create an identical internal of a smart meter, double it, and control it via the original P1 interface. As it is an ongoing project and not working (yet), I’m not going into too much details.
The P1 port has two optocouplers. One to enable the port and one to get the signal. So each port on the splitter should have this too, to be sure my modules responds the same on the splitter, as on the P1 port.
I use my latest inverter (the same as on the ethernet module) to get a normal signal, which wil be used to control the optocoupler for the outgoing signal. The other optocoupler wil be used the same as in the P1 port, to enable or disable the outgoing signal.
The first results where… not good 😂 The power functionality was working good though. Yet there was no signal going into the module. So it was time to hook up the oscilloscope and see what is going wrong. The oscilloscope showed that the output power on the data line from the two ports on the splitter was not good. When there is no signal, it should be high due to the pull up resistor in the module. When there is a signal, it should be pulled low via the optocoupler. Low means any voltage lower than 0.8v.
In my case, low was about 3.5v, which is way too high. After search through the specs of the optocoupler, I noticed that the voltage on the led of the optocoupler was good, yet more important, the power was way too low. It should be around 5mA and due to the 10K resistor it was only 0.4mA. Changing the resistor to 1K, I started to see some date on the modules. Yet this time, unreadable 😢
That oscilloscope was the best buy of the year 😁
So again, what is going wrong, what am I missing? I hooked up the oscilloscope again and this time I compared the incoming and outgoing signal. These two should be the same, with a little voltage differences allowed.
I immediately saw what is going wrong. The symptoms are that it looks like a RC filter. Blue is incoming and red is outgoing. Only on the long high signals you can see the output voltage is rising. As if a capacitor is getting charged. Yet I’m not using any capacitors on the signal line. Looking again at the specs of the optocoupler, it had response time from a few µs, and a on time from 2µs and an off time from 25µs.
If you look closely to the oscilloscope result, the time between the smalles signals is around 6~7µs. The widest puls/signal (where you can see the red line go up) is about 42µs. Only after ~24µs the outgoing signal starts to come up. Working at 115200baud, means that each bit us 8.3µs… meaning this optocoupler ain’t gonna work.
For now I’m going to try to find another optocoupler with same package. If that ain’t going to work, I do have some good other optocouplers, yet I have to redesign the pcb (meaning all the current can go into the trash 😅😅