Barcelona: From a town in the Roman empire to a modern smart city

In the 3rd century BC, the Carthaginian conqueror Hamilcar Barca established a settlement on the mouth of the rivers Llobregat and Besòs. He named it Barcino after his family. In the 15th century BC, Romans conquered Barcino and used it as their military base. As time passed, Barcino became popular as Barcelona.

Barcelona is the second-largest city in Spain with a population of 1.8 million inhabitants. It is a compact city with an ever-increasing population. There were certain factors that were hindering normal life, such as:

  • Traffic congestion
  • Noise pollution
  • Bad drainage system
  • Insufficient local transport system
  • Inefficient waste management
  • Unavailability of parking space, and more

In 2012, the city government of Barcelona found a solution for these problems in a project that was undertaken 30 years ago. The project was to network 2 municipal buildings with an optical fiber network. This sparked the idea of building a smart city under the umbrella of Smart City Barcelona. The technology infrastructure of Smart City Barcelona is built on top of this optical fiber network called Transversal. Currently, Barcelona is connected with an optical fiber network of a whopping 500 km!

Building Smart City Barcelona

So just how was the ambitious goal of converting “Barcelona, a heritage city” to “Barcelona, a smart city” accomplished?

To start with, the Barcelona city government divided the Smart City Barcelona project into 22 programs comprising 83 individual projects. These projects were chosen such that it addressed all the factors that were hindering normal life in Barcelona.

The approach for smart city Barcelona is the idea that the city would function as a network of networks. In this way, it could connect different individual networks in the city, for example, transportation, pollution board, technology etc..

Barcelona city government structured its various smart city projects in the following 3 technology layers:

Layer 1: Sensors to sense activities in the environment

The government has installed a sensor platform called “Sentilo”. Considering the potential of the platform, the city government has made the Sentilo platform open source and the repository is available on Github. This will enable anyone in the world to use the platform to build their own applications.

The sensors are deployed across the city based on the requirements of the projects. These sensors are used to monitor and detect changes in the environment, for example, changes in the pollution level in a specific area.

Layer 2: City OS

City OS is the key for unlocking IoT benefits associated with data analytics and predictive modeling. It aggregates the data from various city applications and Sentilo and analyses it. For example, using the data collected from Sentilo about the pollution level, City OS can create a graphical visualization. It can also predict the pollution level for the rest of the week. This mechanism helps the Pollution Control Board to take proactive measures..

Layer 3: Service layer for data sharing

The third layer is a service layer that is used for sharing the data and analytics that are collected from the City OS layer. This data can be used by the public to enhance the city services and operations. For example, with the data and predictions available at the City OS layer, application developers can build a mobile app. This app can be used to alert users about the pollution levels and recommend appropriate measures.

Now let’s take a look at different projects and their impact,

Transit system

Transports Metropolitans de Barcelona (TMB) has introduced an innovative orthogonal bus network (horizontal, vertical, and diagonal lines) with hybrid buses. With this initiative the buses are now faster, frequent, and easy-to-use.

The goal of TMB’s orthogonal bus network is to ensure that travelers make just one transfer between any two points to cover 95% of their journeys. To achieve this objective, TMB has 16 orthogonal bus lines. This ensures that all parts of the Barcelona are covered. With this improved geographical coverage, the distance from any point in the city to nearest bus stop is less than 400 m.

Hybrid buses in Barcelona

Hybrid local transport buses in Barcelona

Local transport system in Barcelona

Orthogonal transit network

Local bus stop in Barcelona smart city

Smart bus stop powered by solar energy, displaying the waiting time on a touch screen


  • Bus frequency increased from 12 min to 5 min
  • Travelers can reach any part of Barcelona in less than 40 min
  • Travelers can save ~10 million hours annually
  • CO2 emission reduced by 5000 tons/year
  • Construction cost is recovered in just 2 years through reduction in operational cost (Construction cost: 17 million euros. Savings in operational cost: 8.8 million euros annually)

Rainwater harvesting system

While many countries around the world are worried about providing quality drinking water to their citizens, Barcelona has moved ahead. It is now thinking about providing quality water for bathing!

Barcelona, like all coastal cities, has always had a threat of sewage overflow. Barcelona City Council came up with a mega project of constructing 33 underground water-retention tanks with a total capacity of 1168900 m3. The water retention tanks have 18 gates, which are controlled from a remote control station.

Rainwater retention tank in smart city Barcelona

Rainwater retention tank


  • Water retention tanks have prevented more than 940 tons of suspended matter from joining the sea.
  • Saved 3.7 million m3 rainwater from flowing into the sea annually.
  • Barcelona is now a robust flood-resistant city.

Bicycle sharing system

Barcelona City Council introduced Bicing, a bicycle-sharing system, with an objective to provide a sustainable mode of transportation and to address traffic-congestion issues.

Bicing is an on-street scheme that is available all year round. Riders use an RFID swipe card to unlock a bike. The rider can keep the bike for a maximum of 2 hours, after which the rider will be fined. There are 420 Bicing stations in the city with a capacity of 20 bicycles each. Each station is strategically located near public transport stops to facilitate easy intermodal use.

The Bicing parking and release system is connected to a central server & management system that enables an operator to keep a tab on which bike is parked where and who is using it. Similarly, a user can see which stations have bikes for rent and the parking points by using the Bicing mobile app.

Bicycle sharing system in Barcelona smart city

Bicing station

Bicing station in Barcelona

Bicing stations in and around Barcelona


  • Acquired 99,600 subscribers
  • Each bike is used 7.5 times a day i.e 1.4 million journeys per month
  • Average ride time is 13 min
  • Reduces CO2 emission by 4000 tons annually

Power generation and distribution network

To reduce both the dependency on fossil fuels for power generation and CO2 emission, the Barcelona City Council in association with other private players has established 2 power generation units in Forum (an auditorium & exhibition hall) and 22@ (a township).

The power plants produce energy by using the steam that is exhausted during the incineration of urban waste in the treatment plant. The energy that is produced during the low demand season is stored by using an advanced ice storage system. The power generated at these plants is distributed through a network of pre-installed hot and cold water piping systems to the buildings in their respective areas.


  • Decreased fossil fuel dependency by 22% for power generation
  • Reduced CO2 emission by 17,000 tons annually

The Barcelona city government has taken many other initiatives to improve the quality of life in the city. The Smart City Barcelona project has not only increased the revenue for the city government but also created 47,000 new jobs for its people.

While countries around the world are highly sceptical about accepting IoT and implementing it, Barcelona has demonstrated how a smart city makes economic sense to increases revenue, decrease unemployment, and solve greater problems like pollution levels and global warming.

Read this article for a detailed description about the Information and Communications Technology (ICT) architecture of smart cities.

Originally published at HackerEarth Blog.

Like what you read? Give HackerEarth a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.