what do you want to control? motor, light, heater?
the device you linked is not intended to be controlled by Arduino. there are other solutions to control AC power.
I need to control a dump load .
Now I use heater to control my exporting solar energy. (energy injected to the grid that now it's been taxed)
But i need to tune the power so i stay below the export maximum, otherwise i lose my own energy and also export some, not ideal.
I'll try to find a pontentiometer that be able to control programmatically but no cigar.
Well, Sir, phenomenal job, but a little over my head.
I'll try to wrap the concept of your regulator but it's too much 'load' for my load.
I know that the Triac is the way to go but i do not trust myself to build it from the scratch. Eventually i would like to try when i'll had the time and expertise, but now it's a question to find a more fast simple solution to cut some money from going down the sink.
I use a module with Triac and zero crossing detector. I use a popular module by Robotdyn. https://robotdyn.com/
The core of the project is small. The additional functions make most of the code.
I can help you with the project.
How do you read the amount of surplus power?
Apreciatred.
My system has been update recently as The Grid installed a smart power meter.
From this meter i read real time (1 second sampling) all the power exported and consumed. (among other data)
I've also connected my two Inverters (SolarEdge) to my system (Modbus) so i get the solar production real time (1 second sample max)
So Real time I've got:
-Power Consumption.
-Power Exporting
-Solar Production.
Obviously when Power Consumed is >0 Exporting is 0 and vice verse.
I have several Python scripts which control several smart plugs (Tapo Tplink) and a isolated Mains relay circuit I've installed two days ago.
Usually i connect 1 or two small heaters connected to the plugs (500 ,1000, and 2000w) that are activated when the export reach 600 1100 and 2000 w.
Again no perfect because the exporting intervals are not 100% cover.
My objective is to connect some kind of heater element (3000 w) in winter and a cool unit in summer and programmatically 'mimic' the power export with some kind of real time pot.
For your info, as the Chinese pot from my first post is terrible, I've purchased this two modules not yet received): Kemo M028N
and its digital controller piece: Kemo M150
They look more professional.
The battery option is budged forbidden for now. (as a lot of things)
I'ave already studied the Triac fundamentals, Zero cross point, isolated mains etc. I understand the basics but i don't see me soldering something real.
I read Modbus every 4 seconds. SolarEdge uses SunSpec standard too?
I used the Kemo modules for some time, but the regulation of Triac in M028N over digital potentiometer M150 controlled by PMW was not accurate. The direct control of Triac from Arduino is very good. My TriacLib which is in the Regulator repository handles the Triac and the zero crossing and works with classic ATmega or with SAMD21 MCU.
After you read my README on GitHub you can read my discussion with ' stealth-ultd', who made his version of my Regulator project. He has a Fronius inverter without battery. https://github.com/jandrassy/Regulator/discussions/1
For the Solaredge I think that it's also SunsSpec but i did the hack 10 years ago.
Just recently i connected 4 spares pzems (ct's) from my old system (i used them for get the power consuming no needed now) to get more solar readings, but the the smart meter set the pace in one second so i remove them, the data was pretty consistent anyway.
I see your github thread and Wow some serious stuff
So do you think i must cancel the order for the Kemo and get a Robotdyn?
what Arduino do you plan to use?
I don't recommend the Kemo modules.
The Triac module doesn't need any soldering. It may need to attach a bigger cooler as you can see on stealth-ultd's photo. I made this weekend a cooler for a single Triac module to replace the double version I use now just for double cooler.
Ok, Triac module is a go. (but i keep the kemos as I've got a super promo)
I've got some Arduinos nano but the thing is that my system is controlled from an old mini-PC with a node-red framework and a bunch of python scripts.
So need to control arduino from node-red and hard wired, because i have some problems with aerial connection (lagging in MQTT and wifi).
I supposes i can do it trough usbSerial but this another complication layer.
I'look out for the python way but i doubt that python could manage the interrupts. Seen your vast experience, do you know something about it?
Another question, for my pure resistor load, It'll be better PWM or Pulse Skip Modulation?
I need to read more, so many doubts... What are your thoughts?
I use phase cutting. It allows smooth regulation. The Kemo module does phase cutting too.
My project started as a Java program which sent PWM values to Arduino. (Then I had a PWM controlled device similar to the Kemo modules).
Making a PC to control the Triac would be hard.
You could use my TriacLib in Nano and receive the required cutting period over USB from the PC. I can write and test the sketch for you. It is simple.
Of course if the mini PC has a PWM output, you could use the Kemo modules. It is not bad. I used them 2 seasons.
From your experience, I see phase cutting as the way to go. Today i order the Robotdyn regulator (16A) form aliExpres so it'll be some waiting.
I'll try the kemos with PWM as it'll be the more rapid and a first implementation test.
From my experience connecting MCU's to the PC it's been more trough USBserial, using MQTT to retrieve some data less time sensitive.
I'll remember using pyfirmata library to contact directly the pins for some small projects but again with some latency problems I recall.
Years ago i start using Raspberry Pi's but with no very 'wow' about them. I tried this lenovo mini Pc (30watts 50$, less than the raspberry's) and it now it's been taken care of four usb controllers (two solar readings , one relay and one connected to the smartmeter) plus severals servers, cameras, sensors, plugs etc, without a hiccup. Really happy, super fast compared with the raspberry, just some more lengthy cables to manage.
I strayed from the topic, sorry. In this case as i only want feed data one way to the arduino. The more direct way it will be a simple serial write from python and read in the arduino loop.
Perhaps there's some usb shield with this PMW possibility. My DIN rail contactor it's controlled by one usb_relay, who knows.
I'll saw in one of your project this similar kemo regulator, and they really look more solid that the chinese's.
The thing is my exporting power is reaching peaks of 4000 watts nowadays (Very good weather but my tax bill is getting fatter) and we aren't yet in the high season, so i'll really like to be in the safe side.
If you send my the sketch it'll be a serious help into the phase cutting idea.
I'll get you posted the moment i get my kemos and everything.
how much power can you use for heating? 4 kW is too much for the DIY Triac modules. I wouldn't even trust the Kemo module to handle that much for longer time.
a 3 phase heater could be the solution. 1 phase regulated by a Triac and the other two switched in by relays when the regulated phase is at max.
I make the sketch for Nano on weekend. It is even possible that I already have it as a test for the TriacLib.
Well I don't want my house in fire, so actually I split the export into several circuits.
The system now is managing four smart plugs of 10A each and a direct connect wired circuit with 25A (with all the fuses and breakers required of course), ready to welcome the kemo/Robotdyn
The way it works is trough some script which add or subtract loads to cut the export proportionally. Some advantage is i can move the plugs to one room or another and connect one or another appliance. But again, this is a 'linear cut' letting some (250w or more) power out. Hopefully, the triacs will managed this variable part.
Anyway, i'll take note for your 3-phase solution as it would be very interesting for a future upgrade. A big appliance; air conditioning or some big 3-phase water boiler.
I'm still waiting the kemos, but i found already some code i used for communication between a Raspberry ->Arduino (USB serial). I'll adapt it to do some test with the PWM signal but without triacs i don't know exactly about the phase-cut way.
for the Triac you can use the TriacLib from my Regulator project. on Nano you have to use pin 2 or 3 for the zero crossing detector and pin 9 or 10 for the Triac pin. Triac::setup(ZC_EI_PIN, TRIAC_PIN);
the power is set with Triac::setPeriod(period); where period is a decimal number from 0.0 to 1.0 where 0.0 is oiff, 1.0 is full power and for example 0.5 is half power.
Ok, but how i wire the arduino with the kemo (kemo M150 + M028N)? it's possible? I can't decipher your schematics.
In the software department, I've already did some tests with python talking to the arduino inside Node Red and it's working, but not as fast as I expected, as the maximum communication data rate is 3-4 seconds?? More obstacles, more tuning...
Some guy advice it's using a multiple relay solution (usb relay module) attached to small loads. Faster and reliable. I should also try that ( I've got one).
Well I'm still a little bit far from the solution.
Anyway thanks a lot. and have a nice Weekend.
Nope, my miniPC can't do pwm. I dont know much about it but Afaik there are only 'special' usb cards capable of this.
In fact this Weekend I'll intended to connect the arduino to feed the kemo with the pwm signal and control some load. If I don't see enough performance in the node-red- python-arduino system, I've got a raspberry pi somewhere (these boards can do pwm) I'll hook it to the smart meter to read the data and start again (Plan B).
I'll keep you update with the results.