SoftModem is a wired, low-cost and platform independent solution for communication between an Arduino and mobile phones. It uses the phone's audio jack and Bell 202 modem-like FSK encoding with up to 1225 bit/s. Check out this blog post.
Projects based on SoftModem:
Open the Arduino Library Manager from the menu: Sketch → Include Library → Manage Libraries...
.
Then search for 'SoftModem' and click install.
Create a folder 'SoftModem' inside your libraries
folder and place these files there.
Board | TX pin | RX pin | AIN1 pin | Timer | Notes |
---|---|---|---|---|---|
Arduino Uno | 3 | 6 | 7 | 2 | |
This is an example sketch that forwards data to/from the serial port.
#include <SoftModem.h>
SoftModem modem = SoftModem();
void setup() {
Serial.begin(115200);
Serial.println("Booting");
delay(100);
modem.begin();
}
void loop() {
while(modem.available()){
int c = modem.read();
if(isprint(c)){
Serial.print((char)c);
}
else{
Serial.print("(");
Serial.print(c,HEX);
Serial.println(")");
}
}
if(Serial.available()){
modem.write(0xff);
while(Serial.available()){
char c = Serial.read();
modem.write(c);
}
}
}
SoftModem uses Timer2, therefore you can not make use of the analogWrite()
function for pins 3 and 11 in your sketch.
A shield is available here or here. You can also build your own. Here is the schematic: