Saturday, November 3, 2018

Read Energy Meter- EM1340(Rishabh Instruments) data in Raspberry Pi via Modbus communication







Overview of the Energy Meter:
RISH EM series measures important electrical parameters in 3 phase and single phase Network & replaces the multiple analog panel meters. It measures electrical parameters like Active / Reactive / Apparent energy , power as per models. It has inbuilt RS485 port available to transfer the data in realtime. The instrument has optional output as one pulse output for energy measurement.
Its Application:
Energy billing
Electrical load monitoring
Sub-metering
Genset, Test Benches and Laboratories


      EM1340 Manuals Click here


Configuration of the Energy Meter for enabling RS485 :

  • Set Slave Address(Between 1-247)
  • Set Baudrate(9600-115200)
  • Set Parity Bit(odd : odd parity with one stop bit , no 1 : no parity with one stop bit , no 2 : no parity with two stop bit,  E : even parity with one stop bit)
  • For Configuring CT:  Set-AP=100(Primary value), Set-AS=5(Secondary Value)[ If CT value= 100/5A]


Connecting the RS485 to USB Converter:

 Connect -      A(meter_side)  ---------A(converter_side)
                       B(meter_side)  ---------B(converter_side)



Getting data's on the PC Side:

   Modscan Software:
         Plug the USB converter into your PC and get the COM PORT no device manager section and  than do the necessary configuration settings .




  
Enter the  Slave Address of the meter in the Device ID and Select the Input Register from the drop down.
Here in the respective register address, you will be able to see the real time values.

Note: Select the device length maximum upto 30, else you will encounter an error.


Getting data's on the Raspberry Pi :


  •  Plug the USB to RS485 Converter into the USB port of the Raspberry Pi
  • Open Terminal and type the command- ls/dev. It will show that the converter is connected to ttyUSB0.
  • In the terminal, type - sudo pip install minimalmodbus   (We will be using minimal modbus library)
  • Open Python IDLE and run the following program

Python Code:


import minimalmodbus

import time

while True:
    try:
        powermeter1 = minimalmodbus.Instrument('/dev/ttyUSB0', 1) 
        # serial port name, slave address (in decimal)
        powermeter1.serial.baudrate = 19200
        powermeter1.serial.bytesize = 8
        # use only one of the 3 lines below to set the parity, and remark the other two lines 
        powermeter1.serial.parity   = minimalmodbus.serial.PARITY_NONE
        powermeter1.serial.stopbits = 1
        powermeter1.serial.timeout  = 1   # seconds
        powermeter1.address
        M1_volts1_address=0x00
        M1_volts2_address=0x02
        M1_volts3_address=0x04
        M1_frequency_address=0x46
        M1_volts1= powermeter1.read_float(M1_volts1_address, 4)
        print("Line 1 Voltage(R)   ")+ str(M1_volts1)
        M1_volts2= powermeter1.read_float(M1_volts2_address, 4)
        print("Line 2 Voltage(Y)  ")+ str(M1_volts2)
        M1_volts3= powermeter1.read_float(M1_volts3_address, 4)
        print("Line 3 Voltage(B)  ")+ str(M1_volts3)

        M1_frequency= powermeter1.read_float(M1_frequency_address, 4)
        print("Frequency  ")+ str(M1_frequency)
   
    except:
        print("Disconnected")



Watch The Video-












    

Raspberry Pi in Industrial Applications

Industrial operations require the combination of harsh operating environments, high I/O capacity, Robust and complex functionality requirements for which programmable logic controllers (PLCs) were mainly used but this increase the setup cost but however for many smaller operations, the Raspberry Pi 3 platform offers a low-cost solution with substantial performance capabilities. Fully capable of handling dedicated industrial applications tasks

Some of the Applications are described below:

1. Industrial Automation:




    Raspberry Pi can be used to automate various specific tasks such as:

  • Control of Three phase motors.
  • Controlling Inputs and Outputs.
  • Auto triggering of devices when sensor is being sensed.
  • Conveyor control.
  • Pick and Place of products.
  • Automatic sortation of products in a conveyor lines, and many more


2. Production and Machine Monitoring:




Production monitoring can be done in real time from by interfacing Raspberry Pi to any machine ranging from CNC,  VMC,  SPM or  having PLC . This helps the Supervisor  as well as the stake holders to track the production in real-time and henceforth it can help them to achieve their target better.

          Some Features are:
  • Live Monitoring of Production Count.
  • Hourly, Daily, Monthly analysis of production and its predictions based upon previous trends with advanced Machine Learning algorithm.
  • Downtime of your machine.
  • Machine Status(Run/Idle/On/Off).
  • Current Tool in Use.
  • Cycle time of Jobs.
  • Time difference between two Jobs(It can be used to track operator's efficiency).
  • Power ON time of machine.
  • Motion Time of Machine.
  • CNC/VMC Program currently running.
  • SMS and Mail Alerts.


3. Fault identification:




Raspberry Pi connected to any machine can track down the error codes and faults occurred in real-time of that machine and the operator & Supervisor can get the error information via alerts and it will helps them in quick diagnostics. Enhanced features such audio and visuals can also be given connecting Pi to large TV screens and monitors.

The status of these machines can also be monitored remotely by Company Owner sitting at home or any remote location.  


4. Barcode Recognition System: 




 By connecting a camera to Raspberry Pi and mounting it in fixed position by the side of running conveyor lines, we can capture the barcodes of each passing boxes/products and as well as their images in real time by using advanced computer vision and machine learning algorithms.

Camera based production counting ,Quality and separating  the damaged product can also be implemented.


5. Predictive Maintenance: 




Predictive Maintenance is to predict when equipment failure might occur, and  to prevent the occurrence of the failure by performing maintenance. Monitoring for future failure allows maintenance to be planned before the failure occurs. Ideally, predictive maintenance allows the maintenance frequency to be as low as possible to prevent unplanned reactive maintenance, without incurring costs associated with doing too much preventive maintenance. For Predictive Maintenance to happen, we have to capture lots of realtime data's from the machine for the Analytics. 

Raspberry Pi can be used here as a data-logger by interfacing it with the machine via communication interface. It will capture the real-time data, process it and henceforth send it over to Cloud platform or centralized server for the Analytics engine running advanced machine learning Algorithm.



6. Energy Monitoring System:





Energy monitoring system is management technique that uses energy information as a basis to eliminate waste, reduce and control current level of energy uses and improve the existing operating procedure.
Raspberry Pi can be interfaced with any Smart Energy Meters/ Energy Meter having communication interface. It can capture all the real-time energy parameters of the whole industrial plant and send it over to cloud platform for its live monitoring as well as for the  analytics.
If energy meter is connected directly to machine, than its live status can be monitored  such as Machine OFF, No Load, Full Load & Ideal running state from the current consumption parameter.

6. Monitoring of Variable Frequency Drives(VFD):


Variable Frequency Drives (VFD) are often used on critical applications in remote locations. Examples of remote and critical VFD applications would be Automation industries, Compressor station, oil and gas pipelines, water treatment and pumping, and oil production, etc.
Raspberry Pi can be used to capture the realtime operational status and parameters from these VFD via any communication interface and send it to cloud platform. With that we can  monitor the VFD's live parameters remotely  and get alerts if any fault occurs.

                                                                                                                Image Source: Google(For Reference)

These are some of the used cases of Raspberry Pi in Industrial environment. If someone have any other applications implemented than please mention in the comment section


Monday, September 3, 2018

What is Raspberry Pi?




The Raspberry Pi is a series of small single-board computers developed in the United Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer science in schools and in developing countries. The original model became far more popular than anticipated,selling outside its target market for uses such as robotics
The organisation behind the Raspberry Pi consists of two arms. The first two models were developed by the Raspberry Pi Foundation. After the Pi Model B was released, the Foundation set up Raspberry Pi Trading, with Eben Upton as CEO, to develop the third model, the B+. Raspberry Pi Trading is responsible for developing the technology while the Foundation is an educational charity to promote the teaching of basic computer science in schools and in developing countries.
According to the Raspberry Pi Foundation, more than 5 million Raspberry Pis were sold by February 2015, making it the best-selling British computer. By November 2016 they had sold 11 million units, and 12.5m by March 2017, making it the third best-selling "general purpose computer".In July 2017, sales reached nearly 15 million. In March 2018, sales reached 19 million.

Most Pis are made in a Sony factory in Pencoed, Wales; some are made in China or Japan.


                         To Set Up & Start your Raspberry Pi

The Raspberry Pi board comes equipped with an SD card. This slot permits us to insert an SD card and that can use it as our devices. The SD card is a main storage device for raspberry pi board like a hard disk of a personal computer. The bootable Linux operating system is loaded onto the card, you are planning to use. The raspberry pi supports Linux, Qtonpi, ARM, Mac operating systems. You can select one OS; you will need to write it to an SD card using a Disk manager application. You can also use other storage mechanism, like USB external hard drive or USB drive. There are a numerous brands of SD cards are available in the market in  different sizes. The raspberry pi supports max 64 GB SD card.
Before you start your raspberry pi, you are going to need to connect a display, keyboard, mouse like as a PC. It supports three different O/Ps like  HDMI video, composite video, and DSI video, where the DSI video needs some specific hardware. When you buy a raspberry pi board it may sold with or without an SD card. It is a very important specification  in raspberry pi board. Because, it keeps its operating system, documents and programs. If your raspberry pi did not come with an SD card, then the min size you should get is 4GB.
Advantages of the raspberry pi is, it is small in size, and it works as a normal computer at low cost server to handle web traffic.

                    Applications of Raspberry Pi

The raspberry pi boards are used in many applications like Media streamer, Arcade machine, Tablet computer, Home automation, Internet radio, Controlling robots, Cosmic Computer, Hunting for meteorites, Coffee and also in raspberry pi based projects.

                       Raspberry Pi models comparison




Raspberry Pi 3 B+

Raspberry Pi Zero WH

Raspberry Pi Zero W

Raspberry Pi 3

Raspberry Pi Zero

Raspberry Pi 2

Raspberry Pi A+

Raspberry Pi B
Source of the list: http://socialcompare.com



Image

Release date
2018 Mar 142018 Jan 122017 Feb 282016 Feb 292015 Nov 302015 Feb 12014 Nov 102012 Feb 15

Description
Same as Raspberry Pi Zero W with header already solderedmodel B mostly w/some model A detail
Product details

Price
US$35.00US$15.00US$10.00US$35.00US$5.00US$35.00US$20.00
SOC

SOC Type
Broadcom BCM2837B0Broadcom BCM2835Broadcom BCM2835Broadcom BCM2837Broadcom BCM2835Broadcom BCM2836Broadcom BCM2835Broadcom BCM2835

Core Type
Cortex-A53 64-bitARM1176JZF-SARM1176JZF-SCortex-A53 64-bitARM1176JZF-SCortex-A7ARM1176JZF-SARM1176JZF-S

No. Of Cores
41141411

GPU
VideoCore IVVideoCore IVVideoCore IVVideoCore IV 1080p@30VideoCore IVVideoCore IVVideoCore IVVideoCore IV 1080p@30

CPU Clock
1.4 GHz1 GHz1 GHz1.2 GHz1 GHz900 MHz700 MHz700 MHz

RAM
1 GB512 MB512 MB1 GB DDR2512 MB1 GB256 MB512 MB
Wired Connectivity

USB Ports
Yes 4xUSB 2.0Yes micro & micro OTGYes micro & micro OTGYes 4Yes micro + micro OTGYes 4Yes 1- 2

Ethernet
Yes Gigabit - Over USB 2.0NoNoYesNoYes 10/100MNoYes

SATA Ports
NoNoNoNoNoNoNoNo

HDMI port
Yes 1Yes miniYes miniYesYes miniYesYesYes 1.3

Analog Video Out
Yes shared with audio jackYes via unpopulated pinYes via unpopulated pinYes shared with audio jackYes via unpopulated pinYes shared with audio jackYes shared with audio jackYes Composite

Analog Audio Out
Yes 3.5mm jack- HDMI audio- HDMI audioYes- HDMI audioYesYesYes

Analog Audio In
NoNoNoNoNoNoNoNo USB mic or sound-card could be added

SPI
YesYesYesYesYesYesYesYes

I2C
YesYesYesYesYesYesYesYes

GPIO
Yes 40-pinYesYesYes 40-pinYesYesYes- 26-pins

LCD Panel
YesNoNoYesNoYesYesYes DSI

Camera
YesYesYesYesYes latest version include a camera connectorYesYesYes DSI

SD/MMC
Yes micro-SDYes microSDYes microSDYes microSDYes microSDYes microSDYes microSD- SD

Serial
Yes RX/TX UART------- Through Expansion Connector, needs level shifting
Wireless Connectivity (On-Board)

Wi-Fi
Yes 2.4GHz and 5GHz 802.11 b/g/n/acYes 802.11nYes 802.11nYes 802.11nNoNoNoNo

Bluetooth®
Yes 4.2, BLEYes 4.1Yes 4.1Yes 4.1 LENoNoNoNo
Dimensions

Height
3.37 in (85.6 mm)1.18 in (30 mm)1.18 in (30 mm)3.37 in (85.6 mm)1.18 in (30 mm)3.37 in (85.6 mm)2.55 in (65 mm)2.12 in (53.98 mm)

Width
2.22 in (56.5 mm)2.55 in (65 mm)2.55 in (65 mm)2.22 in (56.5 mm)2.55 in (65 mm)2.22 in (56.5 mm)2.22 in (56.5 mm)3.37 in (85.6 mm)

Depth
0.66929 in (17 mm)0.51181 in (13 mm)0.19685 in (5 mm)0.66929 in (17 mm)0.19685 in (5 mm)0.66929 in (17 mm)0.39370 in (10 mm)0.66929 in (17 mm)

Weight
1.58 oz (45 g)0.42328 oz (12 g)0.31746 oz (9 g)1.58 oz (45 g)0.31746 oz (9 g)1.58 oz (45 g)0.81130 oz (23 g)1.58 oz (45 g)

Website
raspberrypi.org/...raspberrypi.org/...raspberrypi.org/...raspberrypi.org/...raspberrypi.org/...raspberrypi.orgraspberrypi.org/...raspberrypi.org
Power

Power ratings
1.13 A @5V180 mA180 mA1.34 A @5V160 mA800 mA200 mA700 mA @5V

Power sources
microUSB or GPIOmicroUSB or GPIOmicroUSB or GPIOmicroUSB or GPIOmicroUSB or GPIOmicroUSB or GPIOmicroUSB or GPIOmicroUSB or GPIO

Power Over Ethernet
- with PoE HatNoNoNoNoNoNoNo