Riders of electronic scooters will be required to wear helmets in Barcelona under a new law which comes into effect on Saturday in Spain's second-largest city.