You can request smoke alarms through Philly311 (via the app or by phone), and the Fire Department will install them in your home. You should have one alarm on each floor of your home, including the basement.
To receive smoke alarms, you must live in the City of Philadelphia in a one- or two-family home that is occupied by the owner. If you live in an apartment building, or are renting a house, the landlord must provide smoke alarms on every level of the home. If your landlord has not provided smoke alarms, call Philly311 to report the violation.
It might take up to 60 days from the time of your request until the actual installation.