Carbon monoxide alarms will have to be fitted when new boilers or gas appliances are installed in Scottish properties, under a change to the law.
New building regulations will apply from October this year.
The devices, which detect the presence of the so-called "silent killer", will have to be installed when boilers, heaters, cookers and fires are fitted in houses, hotels and care homes.
At least 50 people die every year from carbon monoxide poisoning in the UK.
The Scottish government's planning minister, Derek Mackay, said: "Not a year goes by where there isn't an avoidable death in Scotland from carbon monoxide poisoning caused by faulty heating appliances in buildings.
"There are also a considerable number of incidents where people are treated in hospital for the effects of carbon monoxide poisoning.
"That is why, from 1 October, the Scottish building regulations will require carbon monoxide alarms to be fitted when a new or replacement boiler or other heating appliance is to be installed in a dwelling and other buildings with bedrooms."
Iain Johnstone, from Stirling-based Scots Gas Training, welcomed the change in regulations.
"You're protecting the owner and the people who live in the domicile," he told BBC Radio's Good Morning Scotland programme.
But Mr Johnstone, who has 15 years' experience as a gas fitter, said new appliances were "intrinsically safe. It's only poor workmanship that lets them down."
He said they were much safer than the older, more inefficient devices still in use in many homes.
"It would be beneficial," he added, "if politicians would get together with the carbon monoxide alarm manufacturers and insurance companies to push for a retro-fit so every house in the country has an alarm."
Louis Blake, from the Carbon Monoxide - Be Alarmed campaign, added: "An audible carbon monoxide alarm is the only way to protect yourself and your family.
"This change to the Scottish building regulations will see more detectors in Scottish homes, which will save lives.
"However, we urge people to act now to protect themselves from carbon monoxide and buy an alarm today."
Carbon monoxide cannot be seen, smelt or tasted.
Combustion appliances fuelled by solid fuel, oil or gas all have the potential to cause carbon monoxide poisoning if they are poorly installed or commissioned, inadequately maintained or incorrectly used.