Analog output 0-10V?

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Analog output 0-10V?

#101 Post by Ath » 30 Jan 2024, 08:40

localhorst wrote: 30 Jan 2024, 00:14 Wait, wait, wait!
Now I've set "Spare" to initial 5V as well. Tested again, coming up with all 5V except for Kinder still 2V.
Looked back in ioBroker and found this from testing:
Bildschirmfoto 2024-01-30 um 00.07.59.png
This cmd is containing:

Code: Select all

gp8403,preset,0,2
and going besides the MQTT Import plugin, kicking in right after booting and is responsible for the value 2V.

Emptied the cmd in ioBroker and checked again: all fine and like it should be.
Sorry for giving you a headache! :oops:
Well, all we need to do is find and fix as many bugs as possible, and that's what we did, though maybe as a side-effect, but it's fine with me :lol:
/Ton (PayPal.me)

localhorst
Normal user
Posts: 125
Joined: 10 Jan 2024, 17:44
Location: Hamburg,Germany
Contact:

Re: Analog output 0-10V?

#102 Post by localhorst » 30 Jan 2024, 08:55

That’s a very reasonable approach! 😆
(German) documentation of making a decentralized ventilation system with heat recovery smart, based on CO2 sensors with ESP Easy: https://luft.breest.eu

TD-er
Core team member
Posts: 8755
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Analog output 0-10V?

#103 Post by TD-er » 30 Jan 2024, 10:18

But how do we fix those PEBKAC bugs? ;)

localhorst
Normal user
Posts: 125
Joined: 10 Jan 2024, 17:44
Location: Hamburg,Germany
Contact:

Re: Analog output 0-10V?

#104 Post by localhorst » 30 Jan 2024, 10:41

Maybe creating a ESP unit which can be attached to the head, with servo and an arm with a hand, slapping remotely if needed?
You can send one out to me directly.
(German) documentation of making a decentralized ventilation system with heat recovery smart, based on CO2 sensors with ESP Easy: https://luft.breest.eu

TD-er
Core team member
Posts: 8755
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Analog output 0-10V?

#105 Post by TD-er » 30 Jan 2024, 10:42


User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Re: Analog output 0-10V?

#106 Post by chromo23 » 30 Jan 2024, 10:43

TD-er wrote: 30 Jan 2024, 10:18 But how do we fix those PEBKAC bugs? ;)
You need to implement AI in ESPEasy as an intermediate.... :D
This solves every problem nowadays so I've heard.

TD-er
Core team member
Posts: 8755
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Analog output 0-10V?

#107 Post by TD-er » 30 Jan 2024, 11:08

Easy-AI
Yep working on it, but I'm having a hard time to fit it in those 16M flash units.
Also needs some extra RAM and a small datacenter.

User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Re: Analog output 0-10V?

#108 Post by chromo23 » 30 Jan 2024, 11:13

TD-er wrote: 30 Jan 2024, 11:08 Easy-AI
Yep working on it, but I'm having a hard time to fit it in those 16M flash units.
Also needs some extra RAM and a small datacenter.
If anyone can fit all this together on an ESP it´s you.
[Feature request] Maybe while you at it you can add the option to generate images based on Plugin values.

localhorst
Normal user
Posts: 125
Joined: 10 Jan 2024, 17:44
Location: Hamburg,Germany
Contact:

Re: Analog output 0-10V?

#109 Post by localhorst » 30 Jan 2024, 19:24

TD-er wrote: 30 Jan 2024, 10:42 A bit like this: https://www.youtube.com/watch?v=T8XeDvKqI4E
I would love it, to be slapped with a fish! :D
chromo23 wrote: 30 Jan 2024, 10:43 You need to implement AI in ESPEasy as an intermediate.... :D
This solves every problem nowadays so I've heard.
And we need a sticker "industry 4.0" on it as well.

But back to topic:
When I came home today, the unit was frozen / not reachable anymore. Needed a hard start. Have been idling with 10V on all DAC channels before.
No idea where it came from. I've now enabled logging to my Synology. Should the log level be Info or better debug?
(German) documentation of making a decentralized ventilation system with heat recovery smart, based on CO2 sensors with ESP Easy: https://luft.breest.eu

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Analog output 0-10V?

#110 Post by Ath » 30 Jan 2024, 23:28

@localhorst I've added documentation, can you please proof-read, and give feedback on this? (The board doesn't allow .pdf files as attachment)
/Ton (PayPal.me)

localhorst
Normal user
Posts: 125
Joined: 10 Jan 2024, 17:44
Location: Hamburg,Germany
Contact:

Re: Analog output 0-10V?

#111 Post by localhorst » 31 Jan 2024, 09:03

Ath wrote: 30 Jan 2024, 23:28 I've added documentation, can you please proof-read, and give feedback on this?
Looking good to me!

This is the only thing, what maybe could be added:
Output - GP8403 Dual channel DAC 0-10V — ESP Easy 2.1-beta1 documentation.pdf wrote:and works from a single 3.3V power source
3.3V or 5V
(German) documentation of making a decentralized ventilation system with heat recovery smart, based on CO2 sensors with ESP Easy: https://luft.breest.eu

localhorst
Normal user
Posts: 125
Joined: 10 Jan 2024, 17:44
Location: Hamburg,Germany
Contact:

Re: Analog output 0-10V?

#112 Post by localhorst » 31 Jan 2024, 09:17

For "stress testing" the unit, I've made a script in ioBroker yesterday. It switches the output voltage of each DAC channel every minute to a random value 0-10V.

This morning the unit was dead again. Not reachable, the both LED of the LAN not flickering as normal, only periodically blinking - like every 2 seconds on/off.
On the DAC I measure 0V on both channel 0 - on channel 1 I can still measure 6V and 8V. This matches the last returned values to ioBroker.

The last things in the log:

Code: Select all

2024-01-31	02:58:18		WD   : Uptime 322  ConnectFailures 0 FreeMem 228016 EthSpeedState Link Up Full Duplex 100Mbps ETH status: Conn. IP Init
2024-01-31	02:58:00		EVENT: WZ_SZ#Kueche=2.00
2024-01-31	02:58:00		EVENT: WZ_SZ#WZ_SZ=7.00
2024-01-31	02:58:00		GP8403: 'volt' Output 0, value: 7.000V
2024-01-31	02:58:00		ACT  : WZ_SZ.gp8403,volt,0,7.00
2024-01-31	02:58:00		EVENT: MQTT_ioBroker#WZ_SZ_Switch=7.00
2024-01-31	02:58:00		EVENT: MQTT_ioBroker#ESP32_VentSwitch/WZ_SZ/WZ_SZ_Switch=7
2024-01-31	02:58:00		IMPT : [MQTT_ioBroker#WZ_SZ_Switch] : 7.00
2024-01-31	02:58:00		EVENT: Kinder#Spare=4.00
2024-01-31	02:58:00		EVENT: Kinder#Kinder=10.00
2024-01-31	02:58:00		EVENT: Clock#Time=Wed,2:58
2024-01-31	02:58:00		GP8403: 'volt' Output 1, value: 4.000V
2024-01-31	02:58:00		ACT  : Kinder.gp8403,volt,1,4.00
2024-01-31	02:58:00		EVENT: MQTT_ioBroker#Spare_Switch=4.00
2024-01-31	02:58:00		EVENT: MQTT_ioBroker#ESP32_VentSwitch/Kinder/Spare_Switch=4
2024-01-31	02:58:00		IMPT : [MQTT_ioBroker#Spare_Switch] : 4.00
2024-01-31	02:58:00		EVENT: WZ_SZ#Kueche=2.00
2024-01-31	02:58:00		EVENT: WZ_SZ#WZ_SZ=9.00
2024-01-31	02:58:00		GP8403: 'volt' Output 1, value: 2.000V
2024-01-31	02:58:00		ACT  : WZ_SZ.gp8403,volt,1,2.00
2024-01-31	02:58:00		EVENT: MQTT_ioBroker#Kueche_Switch=2.00
2024-01-31	02:58:00		EVENT: MQTT_ioBroker#ESP32_VentSwitch/WZ_SZ/Kueche_Switch=2
2024-01-31	02:58:00		IMPT : [MQTT_ioBroker#Kueche_Switch] : 2.00
2024-01-31	02:58:00		EVENT: Kinder#Spare=10.00
2024-01-31	02:58:00		EVENT: Kinder#Kinder=10.00
2024-01-31	02:58:00		GP8403: 'volt' Output 0, value: 10.000V
2024-01-31	02:58:00		ACT  : Kinder.gp8403,volt,0,10.00
2024-01-31	02:58:00		EVENT: MQTT_ioBroker#Kinder_Switch=10.00
2024-01-31	02:58:00		EVENT: MQTT_ioBroker#ESP32_VentSwitch/Kinder/Kinder_Switch=10
2024-01-31	02:58:00		IMPT : [MQTT_ioBroker#Kinder_Switch] : 10.00
But this doesn't help find the cause for the crashes. I'll change now to debug output.

Do you guys have any ideas, what could be the reason, that the board crashes frequently? Where I should start from?
(German) documentation of making a decentralized ventilation system with heat recovery smart, based on CO2 sensors with ESP Easy: https://luft.breest.eu

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Analog output 0-10V?

#113 Post by Ath » 31 Jan 2024, 09:36

localhorst wrote: 31 Jan 2024, 09:03
Ath wrote: 30 Jan 2024, 23:28 I've added documentation, can you please proof-read, and give feedback on this?
Looking good to me!

This is the only thing, what maybe could be added:
Output - GP8403 Dual channel DAC 0-10V — ESP Easy 2.1-beta1 documentation.pdf wrote:and works from a single 3.3V power source
3.3V or 5V
Technically that's correct, but when running the DAC board at 5V, then the I2C bus should use a level converter, as the ESP only accepts 3.3V on the GPIO pins, that's why I didn't mention 5V there. I'll add it to the documentation though, and probably add a picture of the board too (also mentioning the DFRobot source).
/Ton (PayPal.me)

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Analog output 0-10V?

#114 Post by Ath » 31 Jan 2024, 09:41

localhorst wrote: 31 Jan 2024, 09:17 But this doesn't help find the cause for the crashes. I'll change now to debug output.

Do you guys have any ideas, what could be the reason, that the board crashes frequently? Where I should start from?
When using the 'syslog' facility, there is a higher chance of networking/stack issues, as the syslog implementation has proven to be not really stable... but that was on ESP8266, where stack issues are more common because of limited memory
/Ton (PayPal.me)

localhorst
Normal user
Posts: 125
Joined: 10 Jan 2024, 17:44
Location: Hamburg,Germany
Contact:

Re: Analog output 0-10V?

#115 Post by localhorst » 31 Jan 2024, 09:46

Ath wrote: 31 Jan 2024, 09:36 but when running the DAC board at 5V, then the I2C bus should use a level converter, as the ESP only accepts 3.3V on the GPIO pins
Might this be a reason for my crashes? All, the board as the DACs, are getting 5V currently. Do I need some gentle, fishy slaps again? :?
I'll change to 3.3V now, disable logging and see...
Ath wrote: 31 Jan 2024, 09:41 When using the 'syslog' facility, there is a higher chance of networking/stack issues
The crash yesterday occured before I've enabled the logging.
(German) documentation of making a decentralized ventilation system with heat recovery smart, based on CO2 sensors with ESP Easy: https://luft.breest.eu

TD-er
Core team member
Posts: 8755
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Analog output 0-10V?

#116 Post by TD-er » 31 Jan 2024, 10:28

The ESP8266 should be 5V tolerant, as it has internal diodes to clamp to 3V3 if higher voltages are applied to a GPIO pin.
However this doesn't mean it is a good idea to do so as other I2C devices might not be 5V tolerant.

Also those diodes may pull the "high" level of the I2C signals to a level which may be close to the "low" level when considering 5V TTL level signals.
This can cause the I2C device and the ESP to get out of sync.
This should not cause hangs, but it can keep the ESP busy for too long so it can loose WiFi connection.

localhorst
Normal user
Posts: 125
Joined: 10 Jan 2024, 17:44
Location: Hamburg,Germany
Contact:

Re: Analog output 0-10V?

#117 Post by localhorst » 31 Jan 2024, 10:47

Thank you again!
So, from what I understand, it's in general not a good idea to power the ESP32 and the I2C devices with 5V.
So I'll leave the whole unit now running on 3.3V with ioBroker switching the output every minute. Switching with 2 sec offset each channel to a random voltage 0-10V. Let's see if it crashes again.
(German) documentation of making a decentralized ventilation system with heat recovery smart, based on CO2 sensors with ESP Easy: https://luft.breest.eu

TD-er
Core team member
Posts: 8755
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Analog output 0-10V?

#118 Post by TD-er » 31 Jan 2024, 11:00

Powering the ESP directly with 5V (thus not using a voltage regulator) is absolutely a bad idea.

localhorst
Normal user
Posts: 125
Joined: 10 Jan 2024, 17:44
Location: Hamburg,Germany
Contact:

Re: Analog output 0-10V?

#119 Post by localhorst » 31 Jan 2024, 11:25

Thank you!
localhorst wrote: 31 Jan 2024, 09:46Do I need some gentle, fishy slaps again? :?
There we are...
(German) documentation of making a decentralized ventilation system with heat recovery smart, based on CO2 sensors with ESP Easy: https://luft.breest.eu

TD-er
Core team member
Posts: 8755
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Analog output 0-10V?

#120 Post by TD-er » 31 Jan 2024, 11:32

Consider it a miracle the board did survive higher voltages.
So maybe also go outside and buy a lottery ticket :)

localhorst
Normal user
Posts: 125
Joined: 10 Jan 2024, 17:44
Location: Hamburg,Germany
Contact:

Re: Analog output 0-10V?

#121 Post by localhorst » 31 Jan 2024, 21:27

TD-er wrote: 31 Jan 2024, 11:32 Consider it a miracle the board did survive higher voltages.
So maybe also go outside and buy a lottery ticket :)
Luck with the board, no luck with the lottery. But I’m fine with it. 😊
Last edited by localhorst on 01 Feb 2024, 12:26, edited 1 time in total.
(German) documentation of making a decentralized ventilation system with heat recovery smart, based on CO2 sensors with ESP Easy: https://luft.breest.eu

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Analog output 0-10V?

#122 Post by Ath » 31 Jan 2024, 22:25

localhorst wrote: 31 Jan 2024, 10:47 So, from what I understand, it's in general not a good idea to power the ESP32 and the I2C devices with 5V.
I think a little more nuance is needed here:
- In contrast to many Arduino boards, ESP mcu's are to be powered with 3.3V, and use 3.3V logic on input and output pins.
- ESP boards can be powered with 5V via the USB connector (when available) or the 5V pin on the board, as nearly all ESP (dev)boards have a voltage regulator on board to convert from 5V to 3.3V. Don't power the ESP board with 5V via the 3.3V pin! That'll damage the mcu!
- The DAC (board) can be powered from 3.3V (you can use a 3.3V pin from the ESP board) or 5V. When powering the DAC with 5V, a level converter should be used on the I2C pins, to protect the GPIO pins of the ESP and any other I2C devices against these too high voltages.
- ESP8266 chips have clamping diodes installed on (most) GPIO pins, that protects them from 5V input signals, but they can't properly deliver the 3.5V level required for a 1/HIGH level of a 5V device input, so that combination either does not work at all, or is working unreliably. It is strongly advised not to use 5V input/output signals, but to use a level converter if the connected device requires 5V signals.

Side note: Most (if not all) I2C devices support 3.3V VCC and 3.3V I2C signal levels. Some also support 5V VCC, and then also use 5V I2C signal levels.
/Ton (PayPal.me)

localhorst
Normal user
Posts: 125
Joined: 10 Jan 2024, 17:44
Location: Hamburg,Germany
Contact:

Re: Analog output 0-10V?

#123 Post by localhorst » 01 Feb 2024, 10:17

Thank you Ton!
Of course, I don't plug 5V on the 3.3V pin.
Since I changed to 3.3V, the unit is running fine. I keep it running with my test script over the weekend. If everything is fine / no crash occurs, I'll build it into my server cabinet / ventilation automation next week.

But as I'm measuring in between, coming back to the documentation:
Output - GP8403 Dual channel DAC 0-10V — ESP Easy 2.1-beta1 documentation 2.pdf wrote:The outputs can supply up to 20 mA
The output is marked with 20mA "least" in the datasheet.
I measure around 60mA on all 4 channels of both DACs.

60 mA seems to be the nominal output. Do you see the same on your DAC?
Last edited by localhorst on 01 Feb 2024, 12:25, edited 1 time in total.
(German) documentation of making a decentralized ventilation system with heat recovery smart, based on CO2 sensors with ESP Easy: https://luft.breest.eu

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Analog output 0-10V?

#124 Post by Ath » 01 Feb 2024, 10:58

localhorst wrote: 01 Feb 2024, 10:17 Since I changed to 3.3V, the unit is running fine. I keep it running with my test script over the weekend. If everything is fine / no crash occurs, I'll build it into my server cabinet / ventilation automation next week.
Ah, great, we already merged the plugin into the 'mega' branch, that also publishes the documentation to ReadTheDocs, so it's already available for anyone using the mega code branch ;) Will be included in the next release.
localhorst wrote: 01 Feb 2024, 10:17 But as I'm measuring in between, coming back to the documentation:
Output - GP8403 Dual channel DAC 0-10V — ESP Easy 2.1-beta1 documentation 2.pdf wrote:The outputs can supply up to 20 mA
The output is marked with 20mA "least" in the datasheet.
I measure around 60mA on all 4 channels of both DACs.:
IMG_2820.jpeg
60 mA seems to be the nominal output. Do you see the same on your DAC?
Ah, I missed that, will update in a documentation update round,. I do from time to time :)
That 20 mA is mentioned in some discussion I found on the DFRobot site, and I mistakenly took that for the maximum.

The documentation you linked is technically quite challenging to decipher, so I only had a quick look at it. All is based on the source code for their library, though I didn't (want to) use the sine/triangle/square-wave code.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8755
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Analog output 0-10V?

#125 Post by TD-er » 01 Feb 2024, 11:56

Hmm I find it strange that there is no mention of the max current on the outputs.

However there is a very important remark in the datasheet which must be taken serious:
When the GP8402 chip is used as an interface chip for the system, a 10uF capacitor and a 12V unidirectional TVS need to be connected to ground on the VOUT output pin, to ensure the chip hot plugging, static electricity, reverse connection and other protection.
A TVS is actually like 2 zener diodes connected in opposite direction.
It will break down (and recover, thus not like a single use fuse) when the voltage exceeds some threshold.
It protects both the GP8403 as well as the device you connect to.

When both devices are powered off when connecting, this is less of an issue and probably the devices acting on the 0...10V may also have a TVS present.

Maybe the board you're using already has one of these too?
They look like a beefy SMT diode.

Edit:
This board does indeed have the 10uF & TVS present.
See schematic: https://dfimg.dfrobot.com/nobody/wiki/a ... 8e8c79.pdf

localhorst
Normal user
Posts: 125
Joined: 10 Jan 2024, 17:44
Location: Hamburg,Germany
Contact:

Re: Analog output 0-10V?

#126 Post by localhorst » 01 Feb 2024, 12:22

TD-er wrote: 01 Feb 2024, 11:56 Hmm I find it strange that there is no mention of the max current on the outputs.
Yes, this is indeed weird.
TD-er wrote: 01 Feb 2024, 11:56This board does indeed have the 10uF & TVS present.
See schematic: https://dfimg.dfrobot.com/nobody/wiki/a ... 8e8c79.pdf
Great, thank you, this is good to know!
(German) documentation of making a decentralized ventilation system with heat recovery smart, based on CO2 sensors with ESP Easy: https://luft.breest.eu

localhorst
Normal user
Posts: 125
Joined: 10 Jan 2024, 17:44
Location: Hamburg,Germany
Contact:

Re: Analog output 0-10V?

#127 Post by localhorst » 04 Feb 2024, 12:30

Already some wrap-up for this project, the unit is running fine since a couple of days and will be integrated in my automation next week:

If someone wants to build the same unit: Power board/ step-down module used: LM2596S Step-down Module or Shop link
Attachments
IMG_2829.jpeg
IMG_2829.jpeg (2 MiB) Viewed 1325 times
IMG_2828.jpeg
IMG_2828.jpeg (1.62 MiB) Viewed 1325 times
(German) documentation of making a decentralized ventilation system with heat recovery smart, based on CO2 sensors with ESP Easy: https://luft.breest.eu

localhorst
Normal user
Posts: 125
Joined: 10 Jan 2024, 17:44
Location: Hamburg,Germany
Contact:

Re: Analog output 0-10V?

#128 Post by localhorst » 06 Feb 2024, 15:21

localhorst wrote: 04 Feb 2024, 12:30 Already some wrap-up for this project, the unit is running fine since a couple of days and will be integrated in my automation next week
So today is the day and ESPEasy took over the control of switching my ventilation.
Not even a month later, since I started this thread. Thank you all so much again! :)
(German) documentation of making a decentralized ventilation system with heat recovery smart, based on CO2 sensors with ESP Easy: https://luft.breest.eu

Post Reply

Who is online

Users browsing this forum: No registered users and 38 guests