The Internet of Things can reduce costs. Here’s how
Will Wong
By Will Wong


I’d never really appreciated how of much of an impact the Internet of Things could have on a business. All it took was the right business case to make me look again. In this blog I will give an overview of the business case and technical solutions used to demonstrate our Smart Post Box idea.  


At the beginning of May a number of us from the AgilityWorks Technology team attended the first SAP InnoJam held in the UK. This was an event centred around the Internet of Things working with SAP. In the 2 day hackathon we combined HANA Cloud Platform (HCP) with a Lego Mindstorms EV3 kit to “make SAP real”. There was stiff competition amongst the teams with a Rubix cube solving production lines, a security robot that lets you through based on ID and a quality control line that rejected discoloured prawns. The winning solution however was a postal delivery system from Team 4 that Pranav and myself were part of. You can get more details of the event here.


Our idea centred around using a proximity sensor for a smart post box with Royal Mail. A sensor would enable the business to know which post boxes are empty and avoid sending employees to check and in turn reducing costs to visit those locations. After doing some research we found that Royal Mail currently use over 115,000 collection points in the UK with roughly 50,000 of those classified as “low-use”. This translates to 45% of post boxes on any given day that could be empty and do not require an employee to visit as part of their collection route. When you consider that Royal Mail operate with a fleet of 37,000 vehicles this can equate to significant savings in fuel and time.


Armed with a compelling business case our solution became a smart post box and depot parking management combined. The physical demo had a post box that could detect the arrival of items as well as a parking barrier equipped with a sensor, sensor data is then sent to the IoT service of an HCP account. A UI5 dashboard could consume this information and update a tile to alert users of new content and available parking spots.


Inspired by the practicality and potential of the solution as SAP themselves noted, we sought to build our own internal demo at AgilityWorks to capitalise on this idea.


Where to begin?

From the SAP InnoJam we had some exposure as to what was needed to get a working solution:

  1. HANA Cloud Platform trial account
  2. Enabling and configuring the IoT service on HCP (Device/message ids, auth tokens)
  3. UI5 development to create a frontend
  4. Read IoT data from HANA tables in HCP

Since our implementation does not rely on Lego Mindstorms for sensory data we had to research and consider our options in terms of hardware:

  1. Hardware platform: Arduino, Raspberry Pi or other?
  2. End to End communication with HCP
  3. Sensor to detect content


Sensors and electronics platform

Thanks to Guy we had a wide selection of devices from Arduinos, Raspberry Pi’s, ESP8266 WiFi modules and their variants to research and develop a suitable prototype.

Quick rundown of the two main platforms.


  • Simple to work with and program via Arduino IDE.
  • Safe to turn off abruptly (harder to brick)
  • Lower power consumption
  • More complex tasks like networking can be more challenging


Raspberry Pi:

  • Works as a standalone computer
  • Much more powerful software (Linux distro)
  • Simpler for networking
  • More work with initial set up (installing Linux and libraries then coding in Python)
  • Must be procedurally shutdown to avoid corrupting data 


To detect fill level we used the HC-SR04 ultrasonic sensor that can give an indication of how full a container is based on obstacle detection. It was trivial hooking up the sensor to an Arduino or Raspberry Pi.

Our first wirelessly connected prototype was a combination of the SR04 sensor and an Arduino Yun. The Yun model has an integrated WiFi shield and an official library for sending HTTP requests. Through this set up we could now interact with the IoT service on HCP and send sensor data that will be stored in a HANA instance.


Looking the part

In parallel to our research around hardware, Guy ingeniously fashioned a container out of drainage pipes to act as housing for the solution. The end result bears a striking resemblance to a UK post box.

Electronics were mounted inside a with a USB battery pack and having the sensor pointing to the bottom of the container. When an item is posted the sensor will detect an obstacle and a message will be sent to HCP with the new reading.


Using the data

The next step was to build a UI5 application that consumes the data within the HANA tables on HCP.

Each sensor represents a post box and we're only interested in the latest reading so to achieve this I created a HANA XS application that returns this information as a web service.

The final app was not designed with a clear use case in mind but simply demonstrates how we can make use of this sensory information. Several devices were created in the IoT service that represent various post boxes with only one configured to the physical demo box.

On the main screen devices are displayed either in a map view or a table with various details such as actual fill level percentage and address.


Key benefit

With the map view it is clear at a glance which post boxes need to be checked, when an item is placed into our physical box the post box icon will change to a mail icon in real time. To really benefit we'd need to provide end user a new route from this information.

The "Toggle Route" button calculates an optimised route from the depot exclusively for post boxes with content. Distance is displayed and can immediately be compared to the max distance travelled if all the locations had to be checked. This example uses a small sample of 6 locations but when scaled up it is clear to see the potential daily savings over a route that covers 30 or so post boxes. 


Cost and effort

With just a HCP trial account and some hardware IoT can be implemented easily and in a relatively short space of time. As far as hardware costs are concerned the prototype with Arduino Yun did cost £80 however during this process Guy had a working solution with a much cheaper ESP8266 WiFi module that is available for £4.

  • D1 Mini  = £4
  • Ultrasonic sensor = £5

The cost is £9 if we ignore economies of scale and the cost of a suitable means to power the device indefinitely (real world bespoke sensor solutions use lithium ion batteries that can last up to 10 years).


Taking the Royal Mail example this would cost the business:

115,000 post boxes x £9 = £1,035,000


Realistically we'd expect a final solution to use some variant of 3G mobile communications instead of WiFi meaning an added operating cost.

Using a suitable low tariff sim of £5 for each device we have the following cost:

£5 x 12months x 115,000 devices = £6,900,000


Let's say that through this they save on average a modest £3 every day per vehicle in a fleet of 37,000.

In a year this equates to a saving of:

£3 x 37,000 vehicles x 6 days x 52 weeks = £34,632,000


Net saving in the first year:

£34,632,000 - £6,900,000 - £1,035,000 = £26,697,000

Granted that these are not exact figures they do give an indication that IoT on this scale and for the right business case can massively reduce costs.


In conclusion

HCP is a great candidate for implementing IoT due to UI5, HANA and IoT services being tightly integrated. Whilst the example here was for a postal service like Royal Mail the expertise we gained from developing this could easily serve as a template to any IoT project.

We demonstrated that getting off the shelf hardware communicating with HCP is relatively easy while the potential benefits can be rather astounding given the business case makes sense.

Will Wong
By Will Wong

Will is an SAP Developer at AgilityWorks and has worked with SAP products for over 8 years. Primarily skilled in ABAP whilst branching out into other areas such as Gateway, MDG and UI5. Providing customers with high performance solutions that add value and improve the user experience is a core motivation. Outside of SAP he can be found practicing martial arts or snowboarding at every given opportunity.

Follow us on Social

And get access to even more digital insights


Just want to talk, call us on:
+44 (0)844 5610930

Join us

Life doesn't wait and neither should you. If you want to join a bunch of people intent on changing the world, you've come to the right place.


Latest opportunities