Flight Crew Air Transport Pilot (ATP)
Flight Deck / Cabin / Aircraft Event Smoke / Fire / Fumes / Odor
Flight Crew Diverted; General Declared Emergency
Environment - Non Weather Related
At cruise altitude (FL280); near ZZZ1; our plane entered a cloud; requiring us to turn on anti-ice. Within seconds after turning on engine heat; the flight attendants chimed and reported 'an odor' in the cabin. There was also an odor in cockpit. Nothing visible; just a smell. The smell was described as a 'burning electrical' smell.  I decided to declare an emergency and divert to ZZZ. We landed safely. ARFF inspected the aircraft before we taxied to the gate.It is very possible we flew through a smoke cloud that was from the massive forest fires in the region.  If I had been aware of the possibility of that smell entering the aircraft; I could have done something to prevent an unnecessary divert. On the return trip; I made a PA that alerted the passengers and flight attendants that we may get an odor inside the airplane. While flying over the forest fire area; it is very possible to get that smell in the cabin. Armed with this knowledge; I believe there would be far less fear and panic.
In cruise at FL280; MD-82 flight crew detected 'burning electrical' odor after turning on engine heat. Flight attendants reported same odor in the cabin. Crew declared an emergency and diverted to ZZZ where odor was attributed to massive forest fires in the area.