# Embedded Systems Future: Design of optimized Energy Metering Devices

Embedded Systems Future: Design of optimized Energy Metering Devices. Embedded Systems are the longer term of our technology world. At the core of each vital technological piece lie components of embedded systems. There are variety of devices which is working on the embedded system technology. Embedded Systems (ES) are systems operating at intervals different systems to build them a lot of economical and effective.

This paper elucidates recent technological advancements during this field of Engineering and identifies its connexon to nearly every other area of twenty first century technology.

To offer a transparent understanding of the rising level of connexon of this rising field of Engineering, this paper any narrows down on the trendy energy metering styles that currently incorporates embedded systems dynamics to boost its functionalities thereby painting a vivid image of the positive effects delivered by Embedded system Engineering.

# Introduction

Embedded systems are the future of the technology world as the technology has evolved from development of a rigid mechanical and electrical solutions to consumer problems .For instance modern cars have been transitioned from being purely electrochemical machines to the masterpiece having numerous micro controller devices computing millions of lines of code. Research shows that the typical new model vehicle comes with over 100 million lines of code which would run within its embedded controllers all would be performing specific functions that would increase its efficiency the same technology is applied in the aviation medical as well as oil and gas industries .embedded system over the years being defined to have a dedicated functions. Embedded systems controls many devices in common use today about 98% microprocessors uses the embedded system. Since they are dedicated to a specific task design engineers can optimize it.AS this paper aims to show that multiple improvement have been done in this field. Electricity meters operates usually by measuring voltage current or product of these two they r mainly positioned to enable easy quantification of energy .THE concluding part of paper explains the methodology adopted in to deign and stimulate modern day energy metering the paper gives us info about benefits advantages and improvement areas against previous analogue metering system.

## Embedded System Overview

Embedded systems call for real-time operation, reliability, maintenance and cost-effectiveness, which therefore places heavy demands on software (user interfaces, data processing, and machine control) and hardware (I/O, Asics, DSP, FPGA). This explains why Embedded Systems is broadly divided into two major parts, as follows: 1. Embedded Software and 2. Embedded Hardware the FPGA design for system on chip and PCB Design etc. are two major segments of Embedded Hardware. Embedded Software involves Software development which includes mobile application development and Embedded Operating Systems. The Operating System (OS) is one of the most important middleware components that abstracts the underlying hardware and presents a simplified interface to the software application. In embedded systems such as smart-phones, automotive, and avionics, the OS also presents a simplified interface to the multitude of sensors and actuators that these systems interact with. Such systems are highly resource-constrained, therefore, the OS must, be efficient in processor and memory usage. Additionally, the ES OS must also support real-time scheduling, to provide service guarantees on systems‟ timing constraints.

### Core Components

The major building blocks of an embedded system are listed below:

1. Microcontrollers / digital signal processors (DSP)
2. Integrated chips Real time operating system (RTOS) – including board support package and device drivers
3. Industry-specific protocols and interfaces
4. Printed circuit board assembly

### Application Areas

1. #### Televisions:

A television has an embedded system that allows users to change channels while sitting just a few feet away. The user sends the input via the wireless remote control, the microcontroller in the TV receives the input via the receiver, the microcontroller recognizes which button is pressed and executes the output on the screen. In this case, the input device is a remote control and buttons on the TV, and the output device is a TV monitor.

2. #### Digital Calculator

: It is purely an embedded system that collects input from the user via buttons/keys on it, the microcontroller inside it performs the calculations according to the pressed keys and sends an output to the display. Again, the input device is the keyboard, the brain is the microcontroller, and the output device is the display.

3. #### Air Conditioner:

An embedded system is in an air conditioner that collects information from the user for the desired temperature via wireless remote control and decides when to turn the air conditioner on and off to maintain the desired temperature set by the user, 2 input devices are used here, one is remote controlled to capture the desired temperature from the user. The second is the temperature sensor, which continuously senses the current room temperature and sends input to the microcontroller. When the room temperature falls below the desired temperature, the microcontroller turns the compressor OFF and when the room temperature falls above the desired temperature, it turns the compressor on.

4. Microwave
5. Mobile phone
6. Laptop
7. Audio player
8. Digital Camera
9. Printer
10. Automatic functions in cars
11. Traffic lights
12. Digital thermometer
13. Wi-Fi router Modems
14. Geyser with automatic functions
15. Automatic faucets in hotels

Also, there’s one more task for you, knowing that you can automate anything with embedded systems. So try to figure out what things you can automate to solve problems in real life. The above example is just crazy, embedded systems is an ocean, there are a large number of products in medical electronics, aerospace, automotive, defense, toys, consumer electronics, food industry, telecommunications, industrial machinery, space, agriculture, construction , simply put term everywhere.

### Design of Modern digital Metering system:

A key aspect of embedded systems engineering is the connection to digital signal processing. It is important to note that computers work with digital signals and the processing and generation of results in digital form empowers both users and developers Score the processed data numerically. That explains why the digitization of metering System leads to much better development and user-friendly device First and foremost, the high-resolution Sigma-Delta Analog-to-digital conversion capability of the PIC Microcontrollers are used to digitize voltage and current felt. These values ​​are then appropriate manipulated to get their decimal equivalents. Calculate the product of the decimal voltage and Current gives the instantaneous power in watts and its Integration over time gives the energy consumed, i.e. usually measured in kilowatt hours (kWh).

### Voltage Sensing & Transformation Stage:

There are many electrical signals around us analog nature. That means a lot varies directly with another crowd. The first lot is mostly tension while this could be second magnitude temperature, pressure, light, force or acceleration. When designing the embedded systems Digitized measuring device, the voltage measurement is carried out with a Voltage step-down transformer with a Primary to Secondary Turns Ratio No. of 55:1. That Voltage from the house power distribution box is connected to its primary winding Transformer. The energy meter is designed to measure maximum of 240V, 100A AC signal. This tension is then converted into an equivalent between the Ranges from 0 to 5V DC. With the transformation System present, other inputs between 0 and 240 V AC are also automatically transformed to their 0-5V DC equivalent. This is due to the maximum voltage Level the analog pin of the PIC microcontroller can Measurement is 5V DC. Using the 240V input as an example, from Equation 1 above we can deduce that the transformer sinks an input voltage (Vp) of 240 VAC in 4.35V R.M.S on its secondary pin and also, From equation 2 we can calculate the peak power Voltage of the transformer to 6.2 V peak. This summit Secondary terminal output voltage passed through the Rectifier circuit will drop 1.2 volts thereby supplying a total of about 5V DC to the analog pin of the MCU.

Vp/Vs=Np/Ns

#### Current Sensing & Transformation Stage:

For current sensing and transformation, a toroidal current transformer is used. The current transformer (C.T) is an “instrument transformer” that is designed to produce an alternating current in its secondary winding which is proportional to the current being measured in its primary.

therefore, the toroidal current transformer is designed with 1 turnings in its primary coil, and 2000 in its secondary coil. Substituting these winding parameters into equation 4 above, at a maximum primary current of 100A in the primary terminal, 50mA will be produced in the secondary. The current transformer is also designed to have an inbuilt burden resistor of 87.6 ohms, hence, the 5A produced, will generate 4.384V RMS which translate 6.2Vpeak by applying (2) above. As in the case of the voltage sensor, the rectifier circuit drops 1.2V out of the 6.2V peak, leaving the output at about 5V DC. This 5V DC is then supplied to the AN3 pin of the PIC18F4550.

### LCD Interfacing Stage

The Liquid Crystal Display (LCD) LM044L is used to display the meter reading. This LCD has 4 visible display rows.

#### Storage Stage

The readings of the energy meter are stored in a Set of .txt files created on the multimedia card (MMC) Memory integrated in the Energy Meter Module; this storage takes place hourly, daily, weekly, monthly and yearly. The stored data can be accessed through an interface desktop application.

#### Firmware Code:

Below is the full firmware code for the PIC18F4550 Microcontroller. The compiler used is the C Pro Compiler and language deployed is the C programming language.

#include<stdio.h>

#include <string.h>

3: #include <stdlib.h

4: #include <float.h>

5: #define INT_RANGE 1000

6: #define DEC_RANGE 10

9: // LCD module connections

10: sbit LCD_RS at RD2_bit;

11: sbit LCD_EN at RD3_bit;

12: sbit LCD_D4 at RD4_bit;

13: sbit LCD_D5 at RD5_bit;

14: sbit LCD_D6 at RD6_bit;

15: sbit LCD_D7 at RD7_bit;

16: sbit LCD_RS_Direction at TRISD2_bit;

17: sbit LCD_EN_Direction at TRISD3_bit;

18: sbit LCD_D4_Direction at TRISD4_bit;

19: sbit LCD_D5_Direction at TRISD5_bit;

20: sbit LCD_D6_Direction at TRISD6_bit;

21: sbit LCD_D7_Direction at TRISD7_bit;

22: // End LCD module connections

24: //MMC Module Connection

25: sbit Mmc_Chip_Select at RB3_bit;

26: sbit Mmc_Chip_Select_Direction at TRISB3_bit;

28: //Declaration of Variables

29: unsigned int v,i,verificationformat, filehandler, k;

30: unsigned long time=1;

31: unsigned int dayCounter=1,weekCounter=1, monthCounter=1,

yearCounter=1;

32: char *voltageTXT[11], *currentTXT[11],

*energyKWHTXT[11], *energyJoulesTXT[11];

33: char *hourCounterTXT[11], *dayCounterTXT[11],

*weekCounterTXT[11];

34: char *monthCounterTXT[11], *yearCounterTXT[11];

35: float Joulespower, Joulespowerbefore=0, energyKWH,

energyJOULES;

36: float voltage, current,KWHpower, KWHpowerbefore=0;

37: char txt1[] = “INITIALIZING ENERGY METRE”;

38: unsigned char readbuff[256], writebuff[256];

39: char newline = ‘\n’, carriagereturn=’\r’;

40: //End of Variable Declaration

42: //Function for reading voltage values through the ADC

Analogue terminal

43: void get_Voltage(){

44: v = ADC_Read(2); //Get ADC value from the voltage input at pin a2

45: voltage = (float) (v/204.6);

46: voltage = (voltage*240)/5; //Because 5V == 240Volts

47: }

48: //End of function

50: /*Function for reading voltage values equivalent to the current flow

51: through the ADC Analogue terminal */

52: void get_Current(){

54: current = (float) ((i/204.6) * 20); //Because 5V =100A

55: }

56: //End of function

58: //Function for computing power

59: void compute_Power(){

60: Joulespower = voltage*current; //Watts

61: Joulespower = Joulespowerbefore+Joulespower;

62: Joulespowerbefore=Joulespower;

64: KWHpower =voltage*current; //Watts

65: KWHpower = KWHpowerbefore+KWHpower;

66: KWHpowerbefore=KWHpower;

68: }

69: //End of function

72: //Function for computing Energy Expended in kWh

73: void get_energyinKWH(float sumpower, long time){

74: time = time/3600; //3600 seconds makes an hour

75: //sumpower = voltage * current

76: /*Energy Usage in watt-hour = Voltage*current*time(in hours)

77: Divided By 1000 to make it in to make it in kilowatts */

78: energyKWH = (float) (sumpower*time)/1000;

79: }

80: //End of function

82: //Function for computing Energy Expended in kWh

83: void get_EnergyinJOULES(float sumpower){

84: energyJOULES = (float)sumpower; //Cummulative watt usage persecond

85: }

86: //End of function

87:

88: //Write to Storage

89: void store_energy_Hourly(){

90: LCD_Out(1,1,” “);

91: LCD_Out(1,1,”SAVING USAGE STAT…”);

92: Mmc_Fat_Assign(“UsageH.TXT”,0xA0);

93: Mmc_Fat_Write(writebuff, 0); //Where file writing begins from

94: Mmc_Fat_Append(); //Moves pointer to end of file

95: Mmc_Fat_Write(“Hour”,4);

96: Mmc_Fat_Write(“:”,1);

97: Mmc_Fat_Write(energyKWHTXT,11);

98: Mmc_Fat_Write(” kWh, “,6);

99: LCD_Out(1,1,” “);

100: LCD_Out(1,5, “ENERGY METRE”);

101: Mmc_Fat_Append();

102: //Mmc_Fat_Write(carriagereturn,1);

103: //Mmc_Fat_Write(newline,1);

104: //Mmc_Fa_Append

107: }

108: void store_energy_Daily(){

109: IntToStr(dayCounter, dayCounterTXT);

110: Mmc_Fat_Assign(“UsageD.TXT”,0xA0);

111: Mmc_Fat_Write(writebuff, 0);

112: Mmc_Fat_Append(); //Moves pointer to end of file

113: Mmc_Fat_Write(“Day “,4);

114: Mmc_Fat_Write(dayCounterTXT,6);

115: Mmc_Fat_Write(“:”,2);

116: Mmc_Fat_Write(energyKWHTXT,11);

117: Mmc_Fat_Write(” kWh, “,6);

118: dayCounter = dayCounter+1;

119: }

120: void store_energy_Weekly(){

121: IntToStr(weekCounter, weekCounterTXT);

122: Mmc_Fat_Assign(“UsageW.TXT”,0xA0);

123: Mmc_Fat_Write(writebuff, 0);

124: Mmc_Fat_Append(); //Moves pointer to end of file

125: Mmc_Fat_Write(“Week “,5);

126: Mmc_Fat_Write(weekCounterTXT,6);

127: Mmc_Fat_Write(“:”,2);

128: Mmc_Fat_Write(energyKWHTXT,11);

129: Mmc_Fat_Write(” kWh, “,6);

130: weekCounter = weekCounter+1;

131: }

132: void store_energy_Monthly(){

133: IntToStr(monthCounter, monthCounterTXT);

134: Mmc_Fat_Assign(“UsageM.TXT”,0xA0);

135: Mmc_Fat_Write(writebuff, 0);

136: Mmc_Fat_Append(); //Moves pointer to end of file

137: Mmc_Fat_Write(“Month “,5);

138: Mmc_Fat_Write(monthCounterTXT,6);

139: Mmc_Fat_Write(“:”,2);

140: Mmc_Fat_Write(energyKWHTXT,11);

141: Mmc_Fat_Write(” kWh, “,6);

142: monthCounter = monthCounter+1;

143: }

144: void store_energy_Yearly(){

145: IntToStr(yearCounter, yearCounterTXT);

146: Mmc_Fat_Assign(“UsageY.TXT”,0xA0);

147: Mmc_Fat_Write(writebuff, 0);

148: Mmc_Fat_Append(); //Moves pointer to end of file

149: Mmc_Fat_Write(“Year “,5);

150: Mmc_Fat_Write(yearCounterTXT,6);

151: Mmc_Fat_Write(“:”,2);

152: Mmc_Fat_Write(energyKWHTXT,11);

153: Mmc_Fat_Write(” kWh, “,6);

154: yearCounter = yearCounter+1;

155: }

156: void main() {

157: ADCON1 = 0; ///Configure AN pins in Port A as analogue inputs

159: //Port Configurations

160: TRISD = 0xFF; // Configure PORTD as input

161: PORTD = 0xFF; // Configure PORTB as output

162: TRISC = 0x00; //Configure PORTC as output

164: TRISA = 0xFF; // Configure PORTA as input

165: TRISB = 0; // Configure PORTB as output

167: Lcd_Init(); // Initialize LCD

168: LCD_Cmd(_LCD_CURSOR_OFF); //Remove LCD Curs

171: LCD_Out(1,1,txt1);

172: for(k=0; k<5; k++){

173: LCD_Out_Cp(“.”);

174: delay_ms(500);

175: }

176: // Initialize SPI1 module and set pointer(s) to SPI1 functions

_SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_LO

OW, _SPI_LOW_2_HIGH);

178: Delay_ms(100);

179: Mmc_Fat_Init();

181: verificationformat = Mmc_Fat_QuickFormat(“STORAGE”)

182: LCD_Cmd(_LCD_CLEAR); //Clear LCD Screen

183: Delay_ms(200);

184: if (verificationformat==0)

185: {

186: Lcd_Out(1,1, “ENERGY RECORD”);

187: Lcd_Out(2,1, “STORAGE INITIALIZED”);

188: Delay_ms(5000);

189: Lcd_Cmd(_LCD_CLEAR);

190: Delay_ms(50);

192: //Create File for Currently Bought Energ

193: Mmc_Fat_Assign(“Bought.TXT”,0xA0);//File Created to Save kWh purchased

194: Mmc_Fat_Write(“1000”, 4); //Signifying that user bought 1000 kWh

196: //Create File to record Yearly Energy Consumption

197: Mmc_Fat_Assign(“UsageY.TXT”,0xA0);

200: Mmc_Fat_Assign(“UsageM.TXT”,0xA0);

202: //Create File to record Weekly Energy Consumption

203: Mmc_Fat_Assign(“UsageW.TXT”,0xA0);

205: //Create File to record Daily Energy Consumption

206: Mmc_Fat_Assign(“UsageD.TXT”,0xA0);

208: //Create File to record Hourly Energy Consumption

209: Mmc_Fat_Assign(“UsageH.TXT”,0xA0)

211: Mmc_Fat_Write(writebuff, 0); //where the writting would start from

212: }

213: LCD_Out(1,5,”ENERGY METRE”);

214: do {

215: FloatToStr(energyJOULES,energyJoulesTXT);

216: FloatToStr(energyKWH,energyKWHTXT);

217: FloatToStr(current,currentTXT);

218: FloatToStr(voltage,voltageTXT);

219: LCD_Out(2,1,energyKWHTXT);

220: LCD_Out(2, 17,” kWh”);

221: LCD_Out(3,1,voltageTXT);

222: LCD_Out_Cp(” Volt(s), “);

223: LCD_Out(4,1,currentTXT);

224: LCD_Out_Cp(” AMP(S)”);

225:

226: get_Voltage(); //Get instantaneous voltage reading

227: get_Current(); //Get instantanious current reading

228: compute_Power(); //compute instantaneous & power

229: get_energyinJOULES(Joulespower); //compute cumulative & instant energy usage

230: get_energyinKWH(KWHpower, time);

231: if(time%3600==0){

232: store_energy_Hourly(); //Store Energy Usage Statistics to MMC every hour

233: }

235: if(time%86400==0){

236: store_energy_Daily(); //Store Energy Usage Statistics to MMC every day

237: }

239: if(time%604800==0){

240: store_energy_Weekly(); //St

243: if(time%2592000==0){

244: store_energy_Monthly(); //Store Energy Usage Statistics to MMC every month

245: }

247: if(time%31536000==0){

248: store_energy_Yearly(); //Store Energy Usage Statistics to

MMC every year

249: }

250: Delay_ms(850);

251: /* The computation and storage process is expected to make up for the

252: remaining 150ms that makes the complete 1 second cycle */

253: time=time+1;

254: } while(1);

255: }

### Future Work

5g will enable the transformation of embedded systems into different domains. In addition, 5G technology will have a greater impact on wearable medical devices, the Internet of Things, telecom providers, and the automotive industry, to name a few. With 5G, the internet, processors and systems will become super-fast. Undoubtedly, quantum computing will play a major role in boosting wireless connectivity — by 2025, the Internet of Things is expected to reach $1 trillion, according to Grand View Research, and this reflects that there will be and will be tremendous growth in wireless connectivity Greater use of IoT (Internet of Things) worldwide #### Scope of the field Embedded systems are the future. Every industry needs some level of artificial intelligence, and artificial intelligence can only be provided by embedded systems. No electronic product comes onto the market without embedded systems. And who develops future embedded systems? You! The embedded engineers. 1. According to a survey, the embedded systems industry will reach US$460 billion by the end of 2024.
2. The number of jobs in the embedded industry will increase to 1 Lac per year by 2027.
3. Companies like TCS, Wipro, L&T, TATA, Elexsi, Infosys, Zensar, Tech Mahindra, Patni, Volvo, Airbus and Toshiba are investing heavily in their embedded systems.
4. Mobile phone manufacturers like Foxcon set up their plants in India.
5. Experts say what IT was in the 90’s is embedded systems today and ready to explode.

#### Carrier opportunities

There are many career opportunities in embedded systems. Some of them are as follows:

1. Embedded software engineer (firmware)
2. Systems Software Engineer (Kernel & RTOS)
3. Application software engineer (device driver) Software test engineer
4. Embedded hardware engineer
5. Embedded systems trainer
6. Marketing and Sales Manager.

Undoubtedly, the starting packages are not very high, but once you gain 3-4 years of experience, you will get attractive packages.

#### Sectors which provide you Jobs

1. Medical Electronics
2. Aerospace
3. Automobiles
4. Defense
5. Toys Consumer
6. Electronics
7. Food industry
8. Telecommunication
9. Industrial machines
10. Space
11. Agriculture
12. Construction

### Skills you should have:

1. #### Software knowledge

• Interfaces of microcontrollers with various sensors and peripherals
• Kernel programming
• Device driver
• Real-time operating systems (RTOS)
• Innovative thinking
1. #### Hardware knowledge

• Design of electronic circuits
• Designing power supply circuits
• PCB design
• Troubleshooting skills

3.Other Skills

• Learn new microcontroller interfaces yourself
• Learn new hardware yourself

Previous embedded systems were 80% hardware and 20% software, but today they are 20% hardware and 80% software

### Conclusion:

We have concluded that they have a very positive role in the future technology this field of engineering has become a special importance oil and gas industries now employ embedded system to prevent pipeline vandalization in the field of medicine it is frequently used for human organs diagnostic equipment etc. Similarly banks financial transactions and operations are being performed via cards with embedded electronic chips it can therefore be stated that embedded system technology is and possesses the potential to be the core of every significant technological piece lie elements of embedded systems.

These range from self-controlled cars, intelligent building designs, automated factory processes, aeronautic gears to smart grid energy systems. As the name implies, Embedded Systems (ES) are systems working within other systems to make them more efficient and effective center the 21stcentury.the concluding part of the paper says that the methodology adopted in the embedded system in the design and stimulation of modern day energy metering devices the paper will also explain the benefits advantages and improvement areas in the areas against the previous employed people.