洋天科技洋天科技
公司簡介訂購方式匯款確認檔案下載 聯絡我們保固說明訂單查詢討論區
電子郵件:

密碼:

忘記密碼
加入會員
  首頁 | 原廠 Arduino® | 特殊服務設計 | 轉接座及轉接板/麵包板 | 開發板/燒錄器/模擬器 | 相容 For Arudino® 週邊及配件 | OKdo系列 | Saleae 系列 | Adafruit 系列 | ArduCam 系列 | Camera 攝像頭 | ROCK 系列 | Debix系列開發板 | Raspberry Pi 樹莓派 | Banana Pi 香蕉派 | BeagleBone 狗骨頭 | M5Stack系列 | Micro:bit (BBC)系列 | NVIDIA Jetson Nano系列 | Pololu 系列 | Pycom 系列 | Seeed 系列 | Sparkfun 系列 | WeMos 系列 | 傳感器 | Cubieboard/CubieTruck系列 | Firefly 系列 | Microduino系列 | Orange Pi 香橙派 | PCB板 | PLC 系列 | Robot 機器人 | UDOO 系列 | RedBearLab 系列 | LattePanda系列 | LittleBits 系列 | Libelium 系列 | Luxonis 相機系列 | PCduino | RobotElectronics 系列 | MageDok 顯示屏 | LCD/LCM/TFT/LVDC | Dimension Engineer 系列 | 通訊模組 | 影音器材(含轉換器) | 線材/連結器/轉換器 | 測量儀器 | 馬達/馬逹控制器/電源模組 | 其他 | 焊接/維修工具 | IC零件 | LED燈-裝飾燈 | 工作站迷你電腦 mini PC | 擴大器 | 雕刻機 | 電池 | 電腦周邊 | 檢定考套件 | 停售商品
  首頁 » 商品目錄 » 相容 For Arudino® 週邊及配件 » 50817409
商品搜尋 進階
 |  購物車內容  |  結帳   
商品分類
  For Arduino® book 書
  For Arduino® LCD 屏
  For Arduino® RGB LED模組
  For Arduino® SD卡模組
  For Arduino® 傳感器模塊
  For Arduino® 套件/套餐
  For Arduino® 學習套件
  For Arduino® 按鍵 按鈕模塊 搖桿
  For Arduino® 控制板
  For Arduino® 擴展板
  For Arduino® 繼電器
  For Arduino® 車
  For Arduino® 電機 馬達 驅動
  Makeblock mBot 系列
  MiCOKit 銀爾達
  NodeMcu Lua系列
  WRTnode系列
  電源模塊
  For Arduino® 外殼/壓克力板/麵包板/杜邦線/配件
Arduino
Pololu
Seeed
Sparkfun
robot-electronics
dimensionengineering
libelium
adafruit
udoo
redbearlab
Arducam
goembed
Saleae
okdo
服務台
公司簡介
退換貨服務
訂購方式
聯絡我們
匯款確認
[<< 前一頁]  瀏覽相同分類產品 1 / 432  [下一頁 >>]
SoftModem Audio Jack Modem for IPhone and For Arduino®
NT$350
運費NT$50
條碼50817409
產品說明

Introduction

You may have several ways to make your Arduino communicate with your Android phone or iPone, such as through bluetooth, or wifi. However, you have an much easy way to do this, through audio jack. Now we supply this Arduino Softmodem for iPhone or Android.

Phones from different company have different headset pinout, for example, Sumsung's Galaxy is different from iPhone. Here we add a switch to make it be compatible with both.

This serial modem allows you to interface an Arduino board with your iPhone or Android smartphone through the audio jack. Now you can integrate your smartphone into your next embedded project. Some software is required on the phone side, and of course there is an Arduino library.

Because the modem and supporting software exploits a connection originally intended for audio, some corruption of the serial data is to be expected from time to time. It's recommended that you keep this in mind when writing your code. See the links below for more information on the board, the Arduino library, and how to implement it.

Example

Arduino Softmodem could be utilized in many project. Here I will show you one example supplied by 9lab. Please visitiOS IR Remote with Arduinofor code if you are interested.

We all love to impress (and sometimes annoy) people with our little gadgets and electronics. I remember that I used to turn off the TV in the classroom with my Casio infrared remote control watch and fool everyone in my class(I bet some of you also did the same thing), and today 9lab wants to bring the fun back with Arduino, some infrared LEDs and your iPhone.

iOS IR Remote

How it works

Basically, how remote controllers work is, the buttons on the control panel will trigger a certain command, and the microcontroller on the board will code the command in binary format, then controls the infrared LED to blink in a certain way according to the code. On any device you want to control, the infrared receiver will catch the signal and decode command, so that the device knows what it needs to do.

The structure will be the same if we want to make it for smartphones. The smartphone needs to be able to encode a command and control the infrared LED to blink. Since there's no direct access from the phone to the LED, so we need a microcontroller to listen to input from the smartphone, and blink the LED accordingly.

In order to be compatible with almost all smartphones, including iPhone and Android, we choose headphone jack as the interface between the phone and the microcontroller. This means we will use audio signal to represent the command, which the microcontroller will not be able to read directly. In this case, we need a soft modem to do the translation.

So here are the hardwares that we used:

  1. Arduino Uno x 1 (as the microcontroller)
  2. Soft modem x 1
  3. IR LED x 1
  4. Arduino breadboard shield x 1(just for cleaner prototyping)
  5. Headphone wire x 1



Hardware setup

The hardware setup is not very complicated. Connect soft modem to Uno(pins), and connect the breadboard shield on top of them, then connect the IR LED to Uno’s PWM pin 3 via breadboard. Finally, connect the soft modem and the iPhone with the headphone wire. Done.

Hardware setup. The deep gray part is the soft modem.

Arduino coding

The Arduino Uno has to take care of the LED blinking, and also listen to soft modem input. When dealing with the soft modem input, the coded command can be several byte in size, so we need to buffer the input data to get the complete command. We used 3 libraries in our codes to do IR control(IRremote), soft modem listening(SoftModem) and buffering(ByteBuffer).

In the steup function, we need to initialize the buffer and soft modem.

void setup()
{
Serial.begin(9600);

// Initialize the buffer with a capacity for 4 bytes
buffer.init(4);

delay(1000);
modem.begin();
}

In the loop() function, Arduino will keep listening to the soft modem. While soft modem is available, we read 2 bytes from the soft modem. Then check if we need to clear the buffer. If not, we put the 2 bytes into the buffer. This is how we get the command from soft modem. When we get the command, we simply use a IRsend to send the command to the IR LED under NEC Protocol.

void loop() {

while(modem.available()){
int c = modem.read();
if((buffer.getSize() == 4 || buffer.getSize() == 0) && c == 0xFF) {
buffer.clear();
} else {
buffer.put(c);
}
}

if(buffer.getSize() == 4) {
long cmd = buffer.getLong();

Serial.print("Sending cmd: ");
Serial.println(cmd, HEX);

irsend.sendNEC(cmd, 32); // NEC Protocol command
delay(100);
}

There’s one issue we encountered when we ran the code. Both IRremote and SoftModem library are using timer2, so we had to uncommented line 61 in IRremoteInt.h to resolve the conflict.

iOS App

The demo app is very simple. We have 2 buttons on the main view, and each button represents a command. We also have an info view, in which you can change the command for both buttons. Once the button is pressed, we will use a serial generator to encode a audio signal representing the command, and the signal will be received by the soft modem.

- (void)buttonPressed:(UIButton*)button {

NSString* buttonKey = (button.tag == 1) ? @"first" : @"second";
NSString* hex = [[NSUserDefaults standardUserDefaults] stringForKey:buttonKey];
hex = [hex substringFromIndex:2];
NSData* hexData = [hex hexToBytes];
//NSLog(@"%@", hex);
//NSLog(@"%@", [hex hexToBytes]);

[APP_DELEGATE.generator writeByte:0xff];
[APP_DELEGATE.generator writeBytes:[hexData bytes] length:hexData.length];
}

Here’s our project onGithub, and you are welcome to contact us for discussion.

Product List

  1. Arduino Softmodem Shield x1
  2. Headset line x1
問與答

目前沒有任何商品問答!
本商品上架日期:2013-07-08.
評價
建議購買的商品清單!可以參考看看喔
(餐3B-42)Raspberry Pi 3 B 樹莓派 主板 + 英國原廠ABS外殼 + 散熱片
(餐3B-42)Raspberry Pi 3 B 樹莓派 主板 + 英國原廠ABS外殼 + 散熱片
●樹莓派 Raspberry Pi Camera 連接線 FFC/FPC扁平電纜插座軟排線(間距1mm 反向15p)2米長
●樹莓派 Raspberry Pi Camera 連接線 FFC/FPC扁平電纜插座軟排線(間距1mm 反向15p)2米長
>(停產)國外進口 原廠 CC2650 SensorTag
>(停產)國外進口 原廠 CC2650 SensorTag
>(售完*)6P 杜邦線 長21cm 母對母 純銅鍍錫連接線 間距2.54mm 轉接線
>(售完*)6P 杜邦線 長21cm 母對母 純銅鍍錫連接線 間距2.54mm 轉接線
VS1053 Codec+MicroSD Breakout MP3/WAV/MIDI/OGG Play+Record
VS1053 Codec+MicroSD Breakout MP3/WAV/MIDI/OGG Play+Record
●Standard LCD 16x2+extras white on blue(ada181)
●Standard LCD 16x2+extras white on blue(ada181)
購物車 更多
空的...
查詢訂單狀態
 
請輸入您的訂單編號
商品通知狀態 更多
通知SoftModem Audio Jack Modem for IPhone and For Arduino®
更新時通知我
推薦給朋友
 
推薦這個商品給朋友

聯絡方式:手機:0933807110 或 0968222607
E-mail:i0104@ms13.hinet.net(主要信箱) & i03070309@yahoo.com.tw(次要) & a_te0307@hotmail.com & A9215017@mail.ntust.edu.tw & r94922042@ntu.edu.tw