Fire alarms or smoke detectors (which is what they're usually called) may begin chirping for several reasons. Most often, it's because their in-unit batteries are about to run out of energy. In some cases, such alarms are hard-wired directly to a house's electrical system, meaning they have no actual batteries. When that's the case, other issues such as dust or other obstructions in the alarm could be the issue. Lastly, many eventually just wear out.
Home fire alarms or smoke detectors are powered in two ways: battery or direct electric. This means they make use of 9-volt or lithium batteries or they're hard-wired (with or without a battery back-up) directly to a building's electrical system. They also use a couple of different means for sensing fire and smoke that emanates from fire. These include various sensors and measuring units, all of which can experience problems.
Often, the simplest reason for why your fire alarm may begin chirping is because there's an interruption in power to the alarm. Either the battery is about to die or electricity from your home's electrical system isn't reaching the alarm as it should. A dying battery's easy enough to solve; just replace it with the same voltage or battery type (9-volt or lithium, usually). Interruption of house power, though, may require the services of an electrician.
In many cases, the delicate sensing equipment within a fire alarm can be blocked or obstructed by dust or grime. Such equipment includes a photoelectric sensor, and it needs to be bathed in clean, clear light to work properly (smoke can obscure it). When not enough light is hitting the sensor, the alarm is programmed to deliver a warning chirp. Usually, wiping or vacuuming clean the alarm's surfaces or their photoelectric sensors is enough to clear the obstructions.
All fire alarms depend on electrical current to operate. Ensuring regular battery changes is vital. As well, checking to make sure your home's electrical system is properly maintained is important if the alarm is hard-wired to that system. Lastly, many alarms are rated for a finite number of years of service. At the end of that life, they simply stop working optimally and require replacement. When that happens, they're programmed to start chirping intermittently.