Skip to content

Latest commit

 

History

History
193 lines (134 loc) · 6.43 KB

README2.md

File metadata and controls

193 lines (134 loc) · 6.43 KB

Supermarket

We're extending electrical project into supermarket project.

Supermarkets need not only to monitor 1 electrical meter, typically they wan't at least 4.

Not only they want to monitor electricity, also: Temperature in Refrigerators, Illumination, and some Digital (boolean) I/Os like check if a refrigeration door is open/close.

Our goal: Energy monitoring/controling HIGH QUALITY software.

Supermarket Side

Inside the supermarket, 2 RS-485/Modbus networks are proposed.

2 RS-485 to 1 USB physical port, leads to two: /dev/ttyUSB0 and /dev/ttyUSB1

Probably no 2 supermarkets would have the same configuration. @radu proposes to use an xml, so C program could read an xml for supermarket configurations. We should not focus in makin 1 size fits all, we could have different C program in each supermarket, but we should keep them as similar as possible. XML also allows to modify supermarket on the fly as well.

Example XML configuration: Perhaps it's better to use different header files.

<configs>
   <Name: SouthWalmart />
   <device: 1>
     <modbus_address: 11/>
     <register>
       <number: 12563 />
       <number_of_registers: 1/>
       <offset value: 0/>
       <multiplication value: 1/>
    </register>
      <register>
       <number: 12564 />
       <number_of_registers: 2/>
       <offset value: 0/>
       <multiplication value: 0.5/>
    </register>
  </device>
     <device: 2>
     <modbus_address: 13/>
     <register>
       <number: 12561 />
       <number_of_registers: 1/>
       <offset value: 0/>
       <multiplication value: 1/>
    </register>
  </device>
      .
      .
      .
</configs>

Offset and Multiplication values refer to sum/substraction and multiplication of the value read before saving to db.

Electric Network

This will consist of 1 to 10 electrical meters. Meters can be of different models.

If they are different models, we need to find a way to have the same data in DB tables.

Each meter should have it's own set of tables. So if 1 meter has 3 DB tables, 3 meters will have 9.

Sensors Network

To bring reality into digital world, we use 3 different types of daqs (data acquisition equipment), we use Advantech ADAM 4000 series. A supermarket should have one of each kind, but it's not fixed. Each meter should have it's own DB table.

  • ADAM-4015: This device has up to 6 channels of temperature, means it can take up to 6 different temperature probes. I suggest having one column for each channel, if only 1 probe is installed, values of others should be null. Temperature should be in Celsius degrees, with 16-bit resolution.

  • ADAM-4017+: Analog to digital converter has up to 8 analog channels that measure either voltage or current, with 16-bit resolution. These a/d converter will be used to measure illumination. Supermarkets internal illumination range from 0 to 1000 lux. Luxmeter can output both 0 to 100 mv or 4 to 20 ma. It's better to pick only one for the long term.

  • ADAM-4055: This module provide our only controlling capability since it has outputs. Digital Input / Output module. 8 Input channels can take 10-50 VDC, 8 Output channels can deliver from 5 to 40 VDC. Digital Inputs might be refrigerator doors status (open/closed), so for example if a door is open for more than 1 hour, we might push a button on the web interface to trigger for example a local horn/siren.

Temperature Readings

Temperature probe to use (could vary) AKS 12

Example Table: TEMP1

IDTemp1Temp2Temp3Temp4Temp5Temp6TIMESTAMP
1-4-22013-30-10 14:59:30.252
2-1-32013-30-10 15:05:30.252

Lux Readings

Light Sensor

Example Table: LUX1

IDLux1Lux2Lux3Lux4Lux5Lux6Lux7Lux8TIMESTAMP
1300500 2013-30-10 14:59:30.252
1350440 2013-30-10 15:05:30.252

Open/Closed Readings

Door open closed switch example.

This logic is different from others, because we cannot only read to the device, we can write as well. Write to the daq means controlling something. We can have the NUC query a specific URL like:

  • /supermarket1/control2/chann2/ every 5 minutes, with a boolean variable.
  • NUC should read that value and compare it to the actual value, if it's different, write to modbus register.
  • NUC should read last stat and report to the server. server should keep track of the user that did this.

Server Side

We need to expand what is done now, they basically need a good dashboard.

  • Graphs, we need a good library that suits AngularJS. Google Chart seems simple to implement. We dont' need complex graphs, I like the look of simplistic things.
  • Authentication: Must drop Basic and switch to our own authentication, since we use ssl, this should be easy.
  • Control Logic, a URL should be available for each PC in each supermarket, to query if new actions are to be performed.
  • Keep the Calendar at all times.
  • Implement mail alarms. For example temperature reading, should be within tresholds if it escapes that range, then alarm e-mail should be sent.

It is extremely important to keep in mind ZERO UNNEEDED LINE OF CODE although comments are welcome.