Shop OBEX P1 Docs P2 Docs Learn Events
Cheapest / Easiest way to wirelessly communicate with a microcontroller. — Parallax Forums

Cheapest / Easiest way to wirelessly communicate with a microcontroller.

wdfreemanjrwdfreemanjr Posts: 9
edited 2011-03-02 21:17 in Propeller 1
Hello,

I am trying to figure out the easiest and cheapest way to communicate a very small amount of data to a microcontroller.

The scenario would be to communicate a small amount of data to a microcontroller in a remote location, without using a cable, laptop, internet or other microcontroller.

Obviously, I could get a bluetooth module and write an application on the iPhone, but Apple's Bluetooth API is very limited.

So far, I have come up an idea to use a webpage and javascript that will send the data by blinking my iPhone screen on and off based on the data typed into a textbox. I have a photoresistor connected to my Propeller that can be held up against my iPhone to read the blinks using the RCTIME spin object.

Due to the refresh rate of the iPhone screen, I am only able to reliably send about 1.5 characters per second, but hey it works. Theoretically, this will work with any browser enabled smart phone. I still need to add some error checking, etc. I have considered using different shades of gray to increase the transfer speed. Rather than 1 bit at a time, I could possible transmit 4 bits at a time, based on the greyscale color of the screen.

I have also made the web page cacheble, so you don't have to be connected to the internet to use this web application after you have downloaded it once. This allows you to dynamically send data without cables, internet or bluetooth.

I have also considered using sound rather than screen flashes since it could be much faster, but that is a totally different discussion.

It gets pretty tricky since this the communication is only one-way and I wanted to know if anyone else out there has any other ideas or any standards for this type of one-way communcation.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-03-02 11:37
    It's very difficult to offer advice when you've given very little information about the conditions you have to fulfill. "Cheapest" and "easiest" often conflict with each other and with other things you haven't discussed at all, after all, an iPhone is not very cheap unless you already have one and can spare it, let alone the cost of an account for the phone service.

    How about discussing your constraints first ...
  • RaymanRayman Posts: 14,884
    edited 2011-03-02 12:52
    From you description, I'd say an IR transmitter/receiver might work... You can buy it in the Parallax store and use a spare IR remote control to send data...
  • HannoHanno Posts: 1,130
    edited 2011-03-02 13:20
    Micah used 4 cogs and a $2 bluetooth module to let you serially communicate with a prop. Is there a terminal blueetooth app for the iphone?
    Hanno
  • Mike GreenMike Green Posts: 23,101
    edited 2011-03-02 13:39
    The iPhone's Bluetooth stack is pretty limited. In any event, it doesn't support the serial port protocol. It supports Bluetooth keyboards and headsets including stereo audio. Some kind of WiFi interface would work. There's a free Telnet Lite program for the iPhone and iPad from MochaSoft that would work. You could wait for Parallax to release their WiFi module or use something like Lantronix's MatchPort. I think it would cost about $60 from Mouser.
  • Zap-oZap-o Posts: 452
    edited 2011-03-02 16:03
    I use the Bluetooth module from National LMX983. Its simply awesome, using voice and other features make it a great chip. Its a bit costly but compared to all that it can do I think its worth it.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-03-02 16:39
    I've run into exactly the same problems with an Android phone. They certainly are not designed by people who want to interface with the real world!

    1) Screen and flash areas on and off. The flash rate may vary depending on other background processes, so maybe two areas, one is the "clock" and one is the "data".
    2) Sound. Yes, that does work. I have created an RS232 data packet in software, saved it as a .wav file and played it back. Only catch on the Android is that you can't play it back from software. You have to save it to the sd card or internal flash, then play that file back. And that wears out the internal memory. Once you have sound you can do that wirelessly - indeed with 'raw RF' modules (the cheap $2 ones), you can feed 1200 baud data in and out of those without any pre or post processing. Just add about 12 ascii U characters at the beginning (this is01010101 in binary and it biases the AC coupling to neutral).
    3) Bluetooth?? Mike Green's comment is almost certainly true. Ditto USB - only a few things are supported (USB memory stick, USB keyboard in my case, but not a USB mouse). Maybe if you have a keyboard you could flash the leds on the keyboard?
    4) Wifi. But a wifi to serial device is so smart you may as well hack that and do the coding in there?

    Your idea with the screen may turn out to be the best solution! One could possibly think about putting 9 photodetectors in a row and one is the clock and the 8 are the data - then you could send out data in bytes. Maybe use a picaxe to do the decoding, or a propeller?
  • $WMc%$WMc% Posts: 1,884
    edited 2011-03-02 17:03
    Mike Green wrote: »
    The iPhone's Bluetooth stack is pretty limited. In any event, it doesn't support the serial port protocol. It supports Bluetooth keyboards and headsets including stereo audio. Some kind of WiFi interface would work. There's a free Telnet Lite program for the iPhone and iPad from MochaSoft that would work. You could wait for Parallax to release their WiFi module or use something like Lantronix's MatchPort. I think it would cost about $60 from Mouser.
    '
    Mr.Green
    '
    Have you used or tried the MatchPort?(MatchPort'b/g Pro) If so What did you plug the Chip into? (Bread Board-special socket-etc)
    '
    I can't seem to find a seller for the development board?
  • Mike GreenMike Green Posts: 23,101
    edited 2011-03-02 17:30
    I haven't actually used the MatchPort, just looked at the manual. It uses 2mm pins for plugging into. It looks like two strips of 20 pins. I would look for or make a 2mm to 0.1" adapter for it. It wouldn't be hard.
  • jmgjmg Posts: 15,185
    edited 2011-03-02 21:17
    Hello,
    So far, I have come up an idea to use a webpage and javascript that will send the data by blinking my iPhone screen on and off based on the data typed into a textbox. I have a photoresistor connected to my Propeller that can be held up against my iPhone to read the blinks using the RCTIME spin object.

    If you are holding something on a cable against the screen, what is wrong with simply plugging into the docking connector ?
    (and getting either USB or Serial port pins ? )

    Or, you could use an Infrared link :

    This one works via the Audio connector http://ryzmedia.com/buy
Sign In or Register to comment.