Admit it: Sometimes you just want to punch your PC, or slap your smartphone, or knock your notebook.

We all get riled by technology once in a while, with all those feeble batteries, endless updates and spinning wheels of death.

But what if our devices could see it coming? What if they could pick up the tics and tells of our brewing anger — or, for that matter, any other emotion — and respond accordingly?

It’s not as crazy as it sounds. To hear experts tell it, this is where technology is going. Researchers and companies are already starting to employ sensors that try to read and respond to our feelings.

While this sort of technology is still in its early days, the possibilities seem many. One day, your PC might sense your frustration when a program keeps crashing and politely suggest that you take a walk while it contacts tech support. Or your smartphone could sense that passions — of one sort or another — are running high and, in response, disable messaging. Or your car might discern an early case of road rage and soften the car’s lighting and stiffen its steering.

Researchers have been trying to read emotions for years by monitoring facial expressions. But a new generation of sensors can judge emotion through people’s skin and breath.

One area where this could really take off is gaming. Last month, engineers at Stanford University outfitted an Xbox game console with sensors that monitor players’ emotions and alter the game play accordingly.

Photo

Corey McCall, a doctoral candidate who oversaw the experiment, said that the modified controller he built tapped into people’s autonomic nervous system — the part of the brain that operates largely below our consciousness to control things like heart rate and breathing. By watching this control system, the sensors could tell if people were happy or sad, excited or bored.

Mr. McCall told me that to quantify emotions, his sensors measured how long it took for a slight electrical current to pass from one arm to another. “If you’re tense, it’s going to be more difficult for the current to pass through than if you’re relaxed and calm,” he explained.

In the past, the only way to get such readings was with an electroencephalogram. But EEGs must be attached to a person’s head. And, even then, they only work with a special gel — and, sometimes, only if the subject’s head is shaved. In Mr. McCall’s experiment, all it took was an innocuous sensor.

The game controller was part of research being conducted in the Stanford lab of Gregory Kovacs, a professor of electrical engineering, whose students are working with Texas Instruments. In addition to gaming, they are experimenting with sensors in vehicles that monitor emotions and alertness.

A number of technology companies have been exploring this area, too.

As far back as 2005, Research in Motion patented sensors for smartphones that convey emotions when people are sending text messages. Sony Ericsson has experimented by monitoring facial expressions on smartphone cameras. The latest Samsung Galaxy S5 smartphone has a built-in heart-rate monitor that could be used to determine its user’s health or state of mind. A company called Affdex tries to assess people’s emotional connection with advertising, brands and media.

And from the Massachusetts Institute of Technology comes AutoEmotive, an experiment that envisions a car that could warn other motorists if a driver was angry by changing the vehicle’s color through conductive paint.

Photo

Rosalind W. Picard at the M.I.T. Media Lab, who is credited with starting what is known as affective computing, has run experiments using a variety of sensors all over the human body. In some instances, her group has put sensors in socks and shoes, wrists and elbows. In others, the group has employed sensors to monitor sweat.

In the future, such technologies could also be used to help children learn by monitoring if they are bored or fidgety, and then enticing a teacher to change a lesson plan or assignment.

For such technologies to work reliably, Ms. Picard said, the sensors and software must be aware of where you are and what you are doing. “If it doesn’t work, people will think of this technology in the same way they thought about Clippy,” she said, referring to the annoying little paper clip once a feature of Microsoft Office.

To some, all this technology might sound a bit scary. Do we really want our computers, smartphones and cars to know if we’re happy or sad?

Dr. Kovacs of Stanford said this is the price we may have to pay not only to improve technology but also to protect people.

“While some might see it as an invasion of privacy, I think operators of such vehicles should give up some privacy in exchange for the trust of human lives placed in their hands,” he said. And, in many cases, you could probably turn the sensors off anyway.

Hey, it beats smacking your PC.