The concept of topology is well known in mathematical sciences. Recently, the material scientists have used it to fabricate topological metamaterials, such as topological photonic crystals. In this study one dimensional topological photonic crystal heterostructure have been designed numerically. It shows the topological protected multiple resonant modes. At the interface of two photonic crystals, the topological edge states occur, and with the addition of third photonic crystal it induces the effect of rainbow trapping. The effect of temperature tuning may also be introduced with a modification in its design, which can be used to fabricate a sensor.