Understanding the DAC or ADC conversion is the basic and most important part to create the interface between different microprocessors, Microcontroller, Sensors, Actuators etc. For creating this communication we will be using AD5669 DAC converter which is connected with Arduino with the help of I2C Sheild sharing the data via serial port in Node-Red
HardwareArduino
Arduino IDE
Node-Red
About AD5669The Advance I2C 4mHz communication speed help the AD5669 to work maximum 16 Bits of Resolution Per Channel using a step voltage of 0.0000763V which shares the programmable voltage output ranges between 0–5V. The source has vast application usage in various tech automation to work with AD5669 I2C module. It sends the analog output signal converted from the digital output using microcontrollers with the help 2 wire signal interface process.
About AD5669 applicationWe were successfully able to use AD5669 modules to send the analog signal ranges between 0–5V which give the signal to motor drivers which control the movement of smart parking barriers which is using the Analog motor drivers to automate these parking barriers.
We are sending the signals to Parking barriers motor drivers using the DAC converters interface by Arduino
I2C Code- Initialize the Wire.h file called as I2C Library especially use in Arduino IDE
#include<Wire.h>
- Initialize the I2C registers of sensor module which is specified to work with 2 wire protocol.
#define Addr 0x56
- Begin the I2C transmission and Initialize the baud rate as per the requirements for serial communication.
Wire.begin(); // Initialise serial communication, set baud rate = 9600 Serial.begin(9600);delay(300);
- Request for 2 bytes of Data which we want to read from the module through I2C connection
unsigned int data[2] = {0x80, 0x00};
- If 2 bytes of data is available then use the mentioned below formula will help to convert the data bytes and display desired values
// Convert the data, Vref = 5 V float voltage = (((data[0] * 256) + (data[1])) / 65536.0) * 5.0;
- Manipulate the parameters as per the requirement of precision settings which is given in the datasheet
- Using Serial.print you will be able to read the sensor data in the serial monitor screen.
// Output data to serial monitor Serial.print("Voltage : "); Serial.print(voltage); Serial.println(" V"); delay(500);
Node-Red
With the help of node -red you will be able to display the I2C Modules data in dashboard format which is already been mentioned in previous blogtuts.
The newbies can check out the tutorial for Node-Red installation here.
Besides that, you can also check out the better way to display the dashboard in your smartphone only if your smartphone is connected to the network
Codehttps://github.com/varul29/AD5669/blob/master/Arduino/AD5669.ino
https://github.com/varul29/Node-Red_Tutorial
Credits- Control everything
- Node-Red
Comments