SPI Sensors

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Arek1990
New user
Posts: 1
Joined: 09 Mar 2016, 19:25

SPI Sensors

#1 Post by Arek1990 » 09 Mar 2016, 20:02

Is it possible to add to the ESP Easy SPI sensors?

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: SPI Sensors

#2 Post by costo » 10 Mar 2016, 01:33

No . . . . . . . . unless . . .
.
you write your own SPI-controller plugin and your own SPI-device plugin.

bigal
New user
Posts: 4
Joined: 17 Mar 2016, 21:00

Re: SPI Sensors

#3 Post by bigal » 17 Mar 2016, 21:39

For my latest Energy Metering project I wish to communicate with an SPI slave - a Microchip MCP3911 dual ADC.
I realize this means writing a driver.
Can you help with the requirements for writing a driver please?
Of course I will release the code so that you can incorporate into future ESP Easy firmware builds.
But as my C ability is beginner level I do need help.

Al

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: SPI Sensors

#4 Post by costo » 17 Mar 2016, 22:43

bigal wrote:For my latest Energy Metering project I wish to communicate with an SPI slave - a Microchip MCP3911 dual ADC.
...............
But as my C ability is beginner level I do need help.
My advice is to use a Arduino as SPI controller and get that working first with the MCP3911.
Later when that is working fine you can get the Arduino communicate with the ESP over I2C with the PME-plugin to send measurements to ESPEasy.
That may be easyer for a beginner.

bigal
New user
Posts: 4
Joined: 17 Mar 2016, 21:00

Re: SPI Sensors

#5 Post by bigal » 19 Mar 2016, 06:16

Costo,
OK I will do that, thanks.

Martinus

Re: SPI Sensors

#6 Post by Martinus » 19 Mar 2016, 13:22

No option to use the ADS1115 4 channel ADC instead? Already supported in ESP Easy.
Image

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: SPI Sensors

#7 Post by costo » 20 Mar 2016, 01:38

Martinus wrote:No option to use the ADS1115 4 channel ADC instead? Already supported in ESP Easy.
I wonder how you can measure 50/60Hz AC current with the ADS1115 connected to ESPEasy.

Thanks to the offset of 1/2 Vcc the ADS can measure alternating current at a rate of maximum 860 samples/second. The measurement data can be read from the I2C of the ADS1115. A dedicated master controller could read the data at this samplerate but ESPEasy cannot. ESPEasy has the bottleneck of a slow communication_channel to the server. The fastest measuring rate that you can select in ESPEasy is once/second I guess. That is not fast enough for AC linecurrent

ESPEasy can undersample the AC wave. But the result will be ambiguous. At best you can calculate the effective current by measuring long enough but I doubt if it will be accurate because the actual current you want to measure will also variate in time.

Post Reply

Who is online

Users browsing this forum: No registered users and 47 guests