A garbage container, including: a main body, a receiving opening being formed on a top of the main body; a controller being disposed on a bottom of the main body, at least one sensor disposed in the main body, a connecting member being able to move longitudinally between a first position near the bottom of the main body and a second position away from the bottom of the main body, a driving mechanism connecting to an end of the connecting member and, being able to elevate or descend the connecting member when receiving a signal from the controller, a power supply providing power to the controller and the driving mechanism, and a lid disposed outside of the receiving opening and being able to pivot relatively to the receiving opening, a fringe of the lid connecting to the other end of the connecting member, the lid covering the receiving opening to segregate the receiving opening from an external space when the connecting member is at the first position, the lid pivoting away from the receiving opening to enable the receiving opening to communicate with the external space when the connecting member is at the second position, characterized by at least one pedal, the at least one pedal contacting with the sensor, pressure the sensor receives being changed when the at least one pedal is pressed, the sensor being able to change resistance when the sensor is under a change of pressure, the sensor being able to send signals to the controller when the sensor is changed in resistance, and by an opening formed on a wall of the main body near the bottom of the main body whereby an end of the at least one pedal is arranged through the opening to contact with the sensor. a main body, a receiving opening being formed on a top of the main body; a controller being disposed on a bottom of the main body, at least one sensor disposed in the main body, a connecting member being able to move longitudinally between a first position near the bottom of the main body and a second position away from the bottom of the main body, a driving mechanism connecting to an end of the connecting member and, being able to elevate or descend the connecting member when receiving a signal from the controller, a power supply providing power to the controller and the driving mechanism, and a lid disposed outside of the receiving opening and being able to pivot relatively to the receiving opening, a fringe of the lid connecting to the other end of the connecting member, the lid covering the receiving opening to segregate the receiving opening from an external space when the connecting member is at the first position, the lid pivoting away from the receiving opening to enable the receiving opening to communicate with the external space when the connecting member is at the second position, characterized by at least one pedal, the at least one pedal contacting with the sensor, pressure the sensor receives being changed when the at least one pedal is pressed, the sensor being able to change resistance when the sensor is under a change of pressure, the sensor being able to send signals to the controller when the sensor is changed in resistance, and by an opening formed on a wall of the main body near the bottom of the main body whereby an end of the at least one pedal is arranged through the opening to contact with the sensor.