Saturday, December 3, 2016

The ESP Easy firmware can be used to turn the ESP module into an easy
to use multifunction sensor device for Home Automation solutions, been easy to integrate it in setups based on Domoticz, OpenHUB, etc.
The configuration process of the ESP Easy is entirely web based, so once you've got
the firmware loaded, you don't need any other tool besides a common web
browser.

First thing that I want to mention, as I found that a lot of people
sometime forget about this simple one: You DAC/ADC/PWM, etc Input/Output
is as good as your Power Supply/Voltage regulator!! If you have a crap
power supply/regulator output with bad filtering & stuff, don't expect
miracles happening!

It is working OK as long as you don't have any blocking process running
on the ESP8266 that can badly interrupt your PWM signal (1/2 second and
more). With a bit of attention to some details and also for not to
complicated lighting setup scenarios is working very nice.
I will do also a more complicated setup example Youtube Video showing you the MPDMv4 AC Dimmer working OK driven directly by
ESP8266 PWM pin, connected as a daughter board on the MPRSx8 Home Automation board.
From Domoticz you can drive thru ESPEasy the MPRSx8 8ON/OFF AC Relays
AND MPDMv4 AC Dimmer channel without any problems at all!

MPDMv4 AC Dimmer board has a first order filter on the VCNT input so can handle even noisy PWM and decent level of duty cycle skipping/derating.

2.Dedicated PWM IC.

I have used with a lot of success the PCA9685, working very smooth and has no
problem related with ESP8266 workload process, etc. You can find more
about a PCA9685 Board here. Probably the best solution for multiple AC Dimmer boards (upto 16 per each PCA9685 Extension Board).

3. Digital driver using a dedicated DAC IC.

VCNT input voltage driven from a MCP4726 12 bit DAC output is working very smooth and has no problem related
with ESP8266 workload process, etc, same as with PCA9685.
As been a 12 Bit DAC it's giving you
very fine VCNT control. I have designed also a Dimmer board with
integrated DAC and digital control, but that's another story.

For programming and uploading the driver and the software we will use the ESPBasic

Connection with the ESP8266 nEXT EVO Board is very easy, as PCA9685 Module connector
is fully compatible with the nEXT Bus connector.Driver implementationAs been a I2C compatible device you need to have a standard I2C Bus Initialisation function as usual and also to know the I2C address of the device.For a more detailed hardware overview go to PCA9685 General Description Article.

PCF8591 Module like the one from here or here, advertised as new versions.

For programming and uploading the driver and the software we will use the ESPBasic

Connection with the ESP8266 nEXT EVO Board is very easy, asPCF8591 Moduleconnector
is fully compatible with the nEXT Bus connector.

Driver implementationAs been a I2C compatible device you need to have a standard I2C Bus Initialisation function as usual and also to know the I2C address of the device.For a detailed PCF 8591 Control Byte description go to PART1.

Friday, November 11, 2016

The PCF8591 is a single-chip, single-supply low-power 8-bit CMOS data acquisitiondevice with four analog inputs, one analog output and a serial I2C-bus interface. Threeaddress pins A0, A1 and A2 are used for programming the hardware address, allowingthe use of up to eight devices connected to the I2C-bus without additional hardware.Address, control and data to and from the device are transferred serially via the two-linebidirectional I2C-bus.

The functions of the device include analog input multiplexing, on-chip track and holdfunction, 8-bit analog-to-digital conversion and an 8-bit digital-to-analog conversion. Themaximum conversion rate is given by the maximum speed of the I2C-bus.

PCF8591 Module like the one from here or here, advertised as new versions.

For programming and uploading the driver and the software we will use the ESPBasic

Connection with the ESP8266 nEXT EVO Board is very easy, asPCF8591 Moduleconnector
is fully compatible with the nEXT Bus connector.

Driver implementation

As been a I2C compatible device you need to have a standard I2C Bus Initialisation function as usual and also to know the I2C address of the device.

Control Byte is the second byte sent to a PCF8591 device and is stored in its control register and is required to control the device function :

Things to take care about:

The upper nibble of the control register is used for enabling the analog output, and for programming the analog inputs as single-ended or differential inputs. The lower nibble selects one of the analog input channels defined by the upper nibble .

If the auto-increment flag is set, the channel number is incremented automatically after each A/D conversion. If the auto-increment mode is desired in applications where the internal oscillator is used,the analog output enable flag must be set in the control byte (bit 6). This allows theinternal oscillator to run continuously, by this means preventing conversion errorsresulting from oscillator start-up delay.

The analog output enable flag can be reset at other times to reduce quiescent power consumption.

The selection of a non-existing input channel results in the highest available channel number being allocated. Therefore, if the auto-increment flag is set, the next selected channel is always channel 0.

The most significant bits of both nibbles are reserved for possible future functions and must be set to logic 0. After a Power-On Reset (POR) condition, all bits of the control register are reset to logic 0. The D/A converter and the oscillator are disabled for power saving. The analog output is switched to a high-impedance state.

As this time we will talk about the Software side we will design a very simple driver for our board that will include also a interactive Web command interface for the MPRSx8 Home Automation Dev Board Relays.

To keep things simple, we will just add in our Web Interface 8 ON/OFF Buttons and one general OFF one, from where we can turn ON/OFF all the Relays switches.

Friday, October 14, 2016

This time we are exploring the Real Time Clock implementation and we will see how easy or complicated is to set & program the onboard RTC Clock.

And the story behind: For a complete monitoring/ data logging experience, a nice to have feature is a proper RTC clock. Having this in mind, for the new version of the SmartMon I choose to add it on-board for a very simple and easy integration in your related Voltage, Current, Power projects. The choosen one is the PCF8563 from NXP, a very nice and easy to program CMOS Real-Time Clock (RTC) and Calendar optimized for low power consumption.
A programmable clock output, interrupt output and voltage-low detector
are also provided. All addresses and data are transferred serially via a
two-line bidirectional I2C-bus with a maximum bus speed of 400 kbit/s.

Features:

• Provides year, month, day, weekday, hours, minutes, and seconds based on a

This time we are talking here about ESP8266/LUA driver but also Arduino implementation will follow.

If you use another ESP8266, or Arduino, ARM, PIC, whatever MCU you use there days for your projects, then just be sure that you are connecting the I2C lines (SDA/SCL) on the allocated pins for your setup. Driver implementation