I have an old iPhone 3GS, want a cheap plan. Any help?

I have the iPhone 3GS and it currently has no plan. It is working off of wifi and I just restored it to its factory settings. I don't have a lot of money, the most I can afford is around 40$ a month. Can anyone help me find a cheap plan for it? Unlimited data and messaging is what I'm looking into, talk minutes is almost irrelevant because I talk on my phone rarely and when I do it's for only a minute or two. If anyone can help me understand some of these plans better I would greatly appreciate it. Also I would appreciate any I sites on other possible smartphones with a plan that could work for me?

Look into metro.

You could do something like tracfone and buy one of their sim cards and stick it into your phone.

Straight Talk wireless - $45/month unlimited talk/text/data. Compatible with AT&T's network.

T-Mobile $30/month unlimited text/unlimited data (first 5GB at high speed)/100 minutes talk - Uses T-Mobile's network which will only give you 2G speeds (not 3G) unless you live in a refarmed 1900 Mhz area, then you will get 3G speeds. See link in the source to see if your area has 1900 Mhz.