A Michigan man has been fined $400 and given 40 hours of community service for accessing an open wireless Internet connection outside a coffee shop.

Under a little known state law against computer hackers, Sam Peterson II, of Cedar Springs, Mich., faced a felony charge after cops found him on March 27 sitting in front of the Re-Union Street Café in Sparta, Mich., surfing the Web from his brand-new laptop.

Last week, Peterson chose to pay the fine instead as part of a jail-diversion program.

"I think a lot of people should be shocked, because quite honestly, I still don't understand it myself," Peterson told FOXNews.com "I do not understand how this is illegal."

• Click here for FOXNews.com's Personal Technology Center.

His troubles began in March, a couple of weeks after he had bought his first laptop computer.

Peterson, a 39-year-old toolmaker, volunteer firefighter and secretary of a bagpipe band, wanted to use his 30-minute lunch hour to check e-mails for his bagpipe group.

He got on the Internet by tapping into the local coffee shop's wireless network, but instead of going inside the shop to use the free Wi-Fi offered to paying customers, he chose to remain in his car and piggyback off the network, which he said didn't require a password.

He used the system on his lunch breaks for more than a week, and then the police showed up.

"I was sitting there reading my e-mail and he came up and stuck his head inside my window and asked me who I was spying on," Peterson told FOXNews.com.

Someone from a nearby barbershop had called cops after seeing Peterson's car pull up every day and sit in front of the coffee shop without anybody getting out.

"I just curiously asked him, 'Where are you getting the Internet connection?', you know," Sparta Police Chief Andrew Milanowski said. "And he said, 'From the café.'"

Milanowski ruled out Peterson as a possible stalker of the attractive local hairdresser, but still felt that a law might have been broken.

"We came back and we looked up the laws and we figured if we found one and thought, 'Well, let's run it by the prosecutor's office and see what they want to do,'" Milanowski said.

A few weeks later Peterson said he received a letter from the Kent County prosecutor's office saying that he faced a felony charge of fraudulent access to computer networks and that a request had been made for an arrest warrant.

The law, introduced in 1979 to protect Internet and private-network users from hackers, and amended in 2000 to include wireless systems, makes piggybacking off of Wi-Fi networks, even those without a password, illegal.

"It wasn't anything we were looking for, and it wasn't anything that we frankly particularly wanted to get involved in, but it basically fell in our lap and it was a little hard to just look the other way when somebody handed it to us," said Lynn Hopkins, assistant prosecuting attorney for Kent County.

Under the statute, individuals who log on to a Wi-Fi network with the owner's permission, or who see a pop-up screen that says it's a public network, can assume they're authorized to use the network, Hopkins said.

If they don't, they could be subject to prosecution.

Peterson was given two choices: He could try to fight the felony charge and face a sentence of up to 5 years in jail or a $10,000 fine; or he could enroll in the diversion program, which would require paying a $400 fine, doing 40 hours of community service and staying on probation for six months.

After consulting two lawyers — both of whom were until then unaware of the law — Peterson decided last week to take the diversion program.

If he fails to complete it, the arrest warrant will be issued and felony charges will be filed, Hopkins said.

"A lot of people tell me I should fight this, but they're not the ones looking at the felony charges on their record if it happens to go bad," Peterson said.

The case has surprised locals, including the owner of the barbershop that initially called police, as well as Donna May, owner of the coffee shop.

"He could have just come in the cafe, even if he didn't have any money, I would let him get on it," May said.

May said that the wireless connection is free for customers to her cafe.

The barbershop owner defended his decision to call police.

"I felt bad about it, but we've had problems in the past," said the man, who declined to give his name. "I'd rather be safe than sorry."

For Peterson, who's never had a criminal record, the experience has been an eye-opening one.

"All over the TV, all the commercials and whatnot you see, they're all trying to get you to buy all these laptops and things that are wireless," he said. "They're trying to get you to buy this wireless stuff because you can go anywhere and still be connected.

"Well, they don't happen to tell you that it's illegal," he continued. "And I guess obviously you're just supposed to know that."

It's up to the consumer to figure that out, said Hopkins, the prosecuting attorney.

"When you buy a Wi-Fi equipped device, it's your responsibility to find out what you can and can't legally do with that device, just as it would be if you were buying a radar detector or any other piece of electronics," she said.

But don't look for a flurry of prosecutions anytime soon.

"We're not going to be running stings to go out looking for people who do this," Hopkins said. "But people should be aware that if we come across them, and it is a violation of the statute, then we will enforce the statute."