system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do modern smartphones vibrate?

Like then they're sounding alarms or restarting. How exactly do they vibrate?
gpt
These devices are called haptic engines. Traditionally it was a regular electric motor but attached to an unbalanced weight. So when the motor spun up the weight caused it to vibrate. Not that different from how a washing machine vibrates during its spin cycle but on a much smaller scale. However these motors can be hard to fit into a modern cramped phone. So modern haptic engines are linear accurators. An iron slug is pushed back and forth by an electromagnet making the phone vibrate. In addition to taking less space it is also much easier to control the force and the frequency of the vibrations in these devices compared to the older ones.