[vc_row][vc_column width=”1/1″][vc_tour][vc_tab title=”The issues left in Part (I)” tab_id=”1394599917-1-88″][vc_column_text]We achieved the communication between Arduinos using softmodem in a previous post.
However, the communication is not reliable. Later we spent more time, and found that the root cause lies in the bad connection of the jumper wires to the Arduino female headers. Taking into account the high date rate of Softmodem, we also need filter circuits to filter out-of-band noise. So we picked a softmodem shield.
[/vc_column_text][/vc_tab][vc_tab title=”Softmodem Shield” tab_id=”1394599917-2-37″][vc_column_text]The modem is as below:
This module is designed specifically for the Arduino, use the digital pins 3,6,7 of Arduino UNO.
Circuit connection as follows:
[/vc_column_text][/vc_tab][vc_tab title=”Notice” tab_id=”1394600033239-2-5″][vc_column_text]We should notice that digital pin 3 of Arduino is the receiver pin, and digital pin 6 of Arduino is used to transmit. In order to achieve communication, we need to cross connector two modem shield. However, the audio cable I have in hand doesn’t cross.
[/vc_column_text][/vc_tab][vc_tab title=”Workaround ” tab_id=”1394600035072-3-7″][vc_column_text]The switch on the softmodem shield is used to select the audio jack type for different makes of phone, such as Samsung and iphone. But it cannot be used to cross the pair.
We cross connect the audio cable in the following way:
[/vc_column_text][/vc_tab][vc_tab title=”Test code ” tab_id=”1394600036895-4-9″][vc_column_text]Whole Setup:
Code for transmitter:
#include <SoftModem.h> SoftModem modem; int dat1; char *p="hello Linksprite!rn"; void setup() { modem.begin(); Serial.begin(115200); } void loop() { for(dat1=0;dat1<strlen(p);dat1++) { modem.write(p[dat1]); Serial.write(p[dat1]); delay(50); } delay(100); }
Code for receiver:
#include <SoftModem.h> SoftModem modem; int dat1,dat2; void setup() { modem.begin(); Serial.begin(115200); pinMode(13,OUTPUT); } void loop() { if(modem.available()) { dat2 = modem.read(); Serial.write(dat2); digitalWrite(~dat1); } }
[/vc_column_text][/vc_tab][vc_tab title=”Test results ” tab_id=”1394600037865-5-1″][vc_column_text]This experiment is to verify the reliability communication via Softmodem between the Arduinos. The experimental results are quite satisfactory. It is shown below:
After hacking for some time, this experiment comes to a close, and the next I will continue to demo that conduct the communicate via Softmodem on Android mobile and communications on pcDuino, so stay tuned![/vc_column_text][/vc_tab][/vc_tour][/vc_column][/vc_row]
Leave a Reply
You must be logged in to post a comment.