PDA

View Full Version : Connecting a cell phone / iPhone with Basic Stamp Homework Board



hameem
04-09-2010, 12:15 PM
How do i connect a cell phone or an iPohne with basic stamp?
My idea is to use the sensors of the cell phone (camera or bluetooth) to send instructions to the microcontroller.
Please help me with ideas.
Thank you.

Franklin
04-09-2010, 10:00 PM
You communicate to the stamp with serial communications. The stamp works reliably up to 9600 baud so you need to configure your phone to send data to the stamp at that rate. You need to send data the stamp can understand, not raw data so programming the phone is the key to your task.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen

hameem
04-09-2010, 10:04 PM
Thanks Stephen. Can you give me a little bit more concept on how I can get a serial communication working for handsets like Nokia or iPhone? Like where's the serial port located on the phone and all?

Spiral_72
04-09-2010, 10:06 PM
Ah, wow. I suppose you could connect via bluetooth but I imagine you'd only be able to send files (pics, videos, maybe contacts?).

I seriously doubt you phone will send anything useful over USB unless it were programmed (hacked) to do so.

The only way I can think of is two phones, one on the receiving end, and send DTMF. You'd initiate the call, have the receiver set to auto-answer, and send DTMF tones with the keypad of the transmitter.


If your working locally 100ft or so away, there are better ways to do this. Infrared should work line of sight to about 30ft max. RF should work to ????? 200ft or maybe farther? Parallax sells RF Tx / Rx modules.





After I read your question again... I dunno if that information is valid..... Most (all?) phones have a USB communication port. It's still up to the phone's software what goes across the port though. I'd suggest reading hack sites on the web.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"puff"...... crap, there went another one.

Post Edited (Spiral_72) : 4/9/2010 3:12:06 PM GMT

hameem
04-09-2010, 10:23 PM
Thank you Spiral_72. So if I send DTMF and receive it with another phone that is attached to the basic stamp, do I need to program the receiving phone explicitly to make that phone send meaningful signals to basic stamp's microcontroller? Can you tell names of some known phone brands/models that have serial ports?

Mike Green
04-09-2010, 10:26 PM
Solutions to your question depend on the particular cell phone involved. Some phones (like the iPhone) are very limited in how they can connect to something. Others are more flexible. In all cases, there's no simple solution and you'll have to do research in the manufacturer's documentation to see how you can make a serial connection to the phone and, in most cases, you'll have to write a program for the phone to do the actual communications.

For example, the iPhone can connect via the Internet and you can even get an "off the shelf" free program ("Mocha Telnet Lite") to do all the work on the iPhone, but you need a Telnet to serial interface on the Stamp side (www.netmedia.com/siteplayer/telnet/spt1.html (http://www.netmedia.com/siteplayer/telnet/spt1.html)) and you'll need to figure out how to use it.

Other cell phones may be easier to use, may allow Bluetooth serial connections that you could use with a Bluetooth to serial interface like that sold by Parallax, and may come with "off the shelf" software or you may need to get the manufacturer's SDK and write it yourself.

Most cell phones have some kind of serial connection available, but you'd have to hunt up the documentation on it and you'd have to write your own program to manage it including a terminal program.

As Spiral_72 mentioned, you should be able to find "hack" sites on the web that would have more information specific to a particular phone, but you're on your own.

Regarding using a cell phone on both ends and using DTMF for signalling ... You'd have to write your own software for the phone on the Stamp side. Without a specific program on the phone, the DTMF is used only to make beeps on the speaker.

Post Edited (Mike Green) : 4/9/2010 3:31:36 PM GMT

hameem
04-09-2010, 10:32 PM
Thank you Mike Green.
For the moment lets forget about the sensors. If I wanted just two cell phones on both ends, just like the Spiral_72 said, and I wanted to send DTMF from the sender cell to the receiver cell so that it could give the microcontroller some kind of instructions, would I have to program the receiver cell? Or the DTMF signals received would go through the serial port automatically and give the microcontroller some meaningful signals?

Mike Green
04-09-2010, 10:43 PM
Like I said, the DTMF on the receive side just goes to the speaker as tones. If you want any other kind of behavior, you will have to learn how to program the cell phone to do something different and we're not talking about a simple program.

You could build a microphone / amplifier / DTMF decoder that literally listens to the cell phone's speaker and produces signals for the microcontroller, but you'd have to also make something that would detect the ring tone and get the cell phone to answer the call.

Jonathan
04-10-2010, 09:37 AM
On a remote alarm project I wanted to do basically the same thing. I wanted to send a text message. I wanted to use a cheapie prepaid cell, and the possibilities in my area were limited. So, the phone I ended up with didn't have a serial interface. My solution was to hack the keyboard itself. This approach had it's problems and limitations, but it worked and I caught the guy. Anyway, just an idea to throw in the pot.

Jonathan

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info (http://www.madlabs.info) - Home of the Hydrogen Fuel Cell Robot

hameem
04-10-2010, 12:08 PM
Thanks Jonathan. Interesting idea. But what do you mean 'hack the keyboard'? How exactly did you do it?

Mike Green
04-10-2010, 11:40 PM
Most keypads just have lots of switches on them. You can take the phone apart and connect reed relays so that their contacts substitute for the keys on the keypads, then have the microcontroller activate the relays as if the keys were being pushed. The advantage of using reed relays is that they provide isolation and they're just contact closures, just like the keys themselves. You can't run into trouble if the phone uses some kind of weird connections for scanning the keypad.

Spiral_72
04-13-2010, 10:08 PM
Mike Green said...
You could build a microphone / amplifier / DTMF decoder that literally listens to the cell phone's speaker and produces signals for the microcontroller, but you'd have to also make something that would detect the ring tone and get the cell phone to answer the call.


Yea, THAT'S what I had in mind. I THINK it would be pretty simple actually. And you might be able to skip the microphone and amplifier by plugging right into the headset port with something for impedance matching. There are DTMF decoders IC's available for cheap. I Thought Parallax had one... but I don't see it.

For answering the call, your phone may (will?) have an auto-answer setting.... Mine does. Some phones require a hands free device to be plugged in before auto answer works.....


So theoretically, you'd call the receiver phone, it rings twice or whatever, auto-answers..... then you push numbers on the cell. The receiver get's these though the call and plays the button pushes as DTMF tones through the headset port where your BS is connected. The BS listens for the signals from the DTMF decoder and does some function according to the tones sent.


It's a remote control with a range of at least 24,901 miles! :o)

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"puff"...... crap, there went another one.

Jonathan
04-14-2010, 09:56 PM
Sorry, was away for a few days. Mike has it, use reed relays or transistors. I pulled the keyboard apart and soldered onto the pads. You could tie into the speaker to detect rings.

Jonathan

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info (http://www.madlabs.info) - Home of the Hydrogen Fuel Cell Robot

nrsmac
01-23-2012, 11:30 AM
Hey Guys! Take a look at this! You cold use it along with Processing to control the Stamp. http://hexler.net/software/touchosc