Wash masoor dal until water is clear, drain and set aside.
Heat ghee or oil in a pot at medium heat and put in carrot and potato. Coat with oil and stir a bit. Add in drained lentil and sautee for a few minutes. Add 6 cups of water. Bring to a boil under medium/high heat. Ladle out any foam that comes to the surface. Once foam stops, add turmeric and mix up. The dal and vegetables take about 30 minutes to cook.
Add sambar powder and mix well. Simmer for 5 minutes. Add salt to your taste, tamarind and coconut and mix well. Turn off heat.
In a separate small pan, heat 2 teaspoons of ghee or oil and put in mustard seeds. Wait for them to pop a bit. To help this happen, you can put a lid over the pan. Once its popped for a few seconds, turn the heat down a little and put the curry leaves and broken up chilis. Coat the leaves and chili with the oil and fry for a few seconds. Pour this oil mixture over the lentils and vegetables and mix well.
In the same small pan put a teaspoon or 2 of ghee or oil and fry onion until they are fragrant. Add these onions to the sambar and mix well.
Garnish with cilantro leaves.
You can serve with rice and some yogurt on the side.