remote sensing of transmitter and reciever using 2 arduino unos

here the transmitter input analog signal comes from a signal generator and generates pwm output...

reciever senses a pwm input and should convert the latter into analog output hence the output of the reciever should be analog for signal processing applications....

now my requirements are that when analog input(transmitter) is applied, output of (receiver) should also be analog instead of a pwm output.The analog output has to be visible on either the computer screen or the cathode ray oscilloscope(cro).(any one)

**For this ill require a dac at pwm output and i have no clue on how to code the above as i am a beginner.. i have the data sheets for arduino uno and 2 transceivers namely RF ASK module Wireless Transmitter + Receiver Pair 433 / 434 MHz**

any suggestions on how i could go about this in coding... and could you provide me a code for the constraints i have given ? or changes of the components also would be entertained given that it is easy to understand that too ...

i hope i am clear in the message i wanted to convey.. and sorry for any inconvenience caused

Why do you want to use PWM for the transmission of analog values? Better transmit the values as binary data, then convert at the receiver end to whatever applicable kind of output.

For analog voltage output you either need a DAC, or a low pass filter that sufficiently flattens a PWM signal-

To be clear, you basically want wireless probes for your oscilloscope?

I would use FFT (fast Fourier transform) on the input end Uno, transmitting a binary signal containing

two variables for each frequency detected, one for the value of the frequency in Hertz and one for the

level of it. On the receiver end I would have the other Uno simply feed this data into Processing on a

computer, where another script can reconstruct the original waveform to give you the wanted display.

Now keep in mind, the above is a very in-depth project for a beginner. I've been using Arduino and the

like for years and still haven't figured out RF communication, so I can only give you a very basic idea

of what all my method entails. I have little doubt there is a better way of doing this, the only question

is where to find it.

Another idea that just popped into my head is to simply hack a cheap set of walkie-talkies as your

radio relay, because they already do all of the fancy conversions for you. Just attach your scope to the

output on one handset and the signal generator to the input on the other, and viola! Problem solved.

-D.E.

Is this a real project or a homework exercise ?

This bit sounds as if it a very old course objective;

"The analog output has to be visible on either the computer screen or the cathode ray oscilloscope(cro).(any one)"

library for arduino to achieve wireess rf cmmunication is virtual wire…
and ill have to check that dac part after the wireless communication output(pwm) is obtained… right now my main focus is to connect the two arduinos using the rf modules …

so what i tried was sending the values from transmitter to receiver using the virtual wire inbuilt code… it is attached below…
the code transmits hello - hexadecimal output at the reciever also shown below…

i believe that using the below code… with some tweaking,transmission of an analog signal and recieving an analog output would be accomplished.

code.txt (1.78 KB)

VirtualWire.pdf (122 KB)

vw_recieveroutput.png

shadriak: library for arduino to achieve wireess rf cmmunication is virtual wire.. and ill have to check that dac part after the wireless communication output(pwm) is obtained.... right now my main focus is to connect the two arduinos using the rf modules ...

so what i tried was sending the values from transmitter to receiver using the virtual wire inbuilt code... it is attached below... the code transmits hello - hexadecimal output at the reciever also shown below....

using the below code... with some tweakings that is transmit and recieve analog output

shadriak: library for arduino to achieve wireess rf cmmunication is virtual wire.. and ill have to check that dac part after the wireless communication output(pwm) is obtained.... right now my main focus is to connect the two arduinos using the rf modules ...

so what i tried was sending the values from transmitter to receiver using the virtual wire inbuilt code... it is attached below... the code transmits hello - hexadecimal output at the reciever also shown below....

using the below code... with some tweakings that is transmit and recieve analog output

DrDiettrich: Why do you want to use PWM for the transmission of analog values? Better transmit the values as binary data, then convert at the receiver end to whatever applicable kind of output.

For analog voltage output you either need a DAC, or a low pass filter that sufficiently flattens a PWM signal-

DrDiettrich: Why do you want to use PWM for the transmission of analog values? Better transmit the values as binary data, then convert at the receiver end to whatever applicable kind of output

from a function generator.. say we send a sine wave... isnt the output of arduino a pwm wave?? how can we transmit binary

Well, that's about 1% of the job done... 0% of reading how to use the forum thread at the top of the forum.

Hi, What is your overall project/

What is the application?

What are you trying to accomplish?

Thanks.. Tom... :)

Hi Tom,

the overall project is to sense vibrations produced by a cantilever beam in the form of an analog signal then transmit it over a wireless medium to observe that analog signal.

Welcome to the Forum. Please read these two posts:

How to use this forum - please read.
and
Read this before posting a programming question …
You may also find useful information that would answer your question here:
Useful links - check here for reference posts / tutorials

You have posted code without using code tags. The code tags make the code look

like this

when posting source code files. It makes it easier to read, and can be copied with a single mouse click. Also, if you don’t do it, some of the character sequences in the code can be misinterpred by the forum code as italics or funny emoticons. The “Code: [Select]” feature allows someone to select the entire sketch so it can be easily copied and pasted into the IDE for testing.
If you have already posted without using code tags, open your message and select “modify” from the pull down menu labelled, “More”, at the lower left corner of the message. Highlight your code by selecting it (it turns blue), and then click on the “</>” icon at the upper left hand corner. Click on the “Save” button. Code tags can also be inserted manually in the forum text using the code and /code metatags.

Unless the sketch is too large, it’s better if you post your code, rather than attach it. When it’s attached, we have to download it, create a folder then open your code in our IDE. And afterwards, the folder remains unless we navigate to the “Temp” folder and manually remove it. It’s much easier to just view the code in your post.

Many questions can be answered by reading the documentation which is provided with the IDE, available under the help tab, or online here.

There are many other things that programmers do to make their code understandable. Please do them, as a courtesy to the members who volunteer their time to help you here. Use a standard indentation to clearly show the code blocks. Never put more than one statement per line. Place any brackets by themselves on a separate line. Use blank lines sparingly, no more than one at a time. Before posting the code, use Ctrl-T in the IDE to reformat the code in a standard format, which makes it easier for us to read.

//transmit
#include <VirtualWire.h>

const int led_pin = 11;
const int transmit_pin = 12;
const int receive_pin = 2;
const int transmit_en_pin = 3;

void setup()
{
  // Initialise the IO and ISR
  vw_set_tx_pin(transmit_pin);
  vw_set_rx_pin(receive_pin);
  vw_set_ptt_pin(transmit_en_pin);
  vw_set_ptt_inverted(true); // Required for DR3100
  vw_setup(2000); // Bits per sec
}

byte count = 1;

void loop()
{
  char msg[7] = {'h','e','l','l','o',' ','#'};

  msg[6] = count;
  digitalWrite(led_pin, HIGH); // Flash a light to show transmitting
  vw_send((uint8_t *)msg, 7);
  vw_wait_tx(); // Wait until the whole message is gone
  digitalWrite(led_pin, LOW);
  delay(1000);
  count = count + 1;
}


//recieve

#include <VirtualWire.h>

const int led_pin = 6;
const int transmit_pin = 12;
const int receive_pin = 11;
const int transmit_en_pin = 3;

void setup()
{
    delay(1000);
    Serial.begin(9600); // Debugging only
    Serial.println("setup");

    // Initialise the IO and ISR
    vw_set_tx_pin(transmit_pin);
    vw_set_rx_pin(receive_pin);
    vw_set_ptt_pin(transmit_en_pin);
    vw_set_ptt_inverted(true); // Required for DR3100
    vw_setup(2000); // Bits per sec

    vw_rx_start();       // Start the receiver PLL running
}

void loop()
{
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;

    if (vw_get_message(buf, &buflen)) // Non-blocking
    {
 int i;

        digitalWrite(led_pin, HIGH); // Flash a light to show received good message
 // Message with a good checksum received, print it.
 Serial.print("Got: ");
 
 for (i = 0; i < buflen; i++)
 {
    Serial.print(buf[i], HEX);
    Serial.print(' ');
 }
 Serial.println();
        digitalWrite(led_pin, LOW);
    }
}
[/quote]

Okay, great. Now just add more to it. :)

shadriak: Hi Tom,

the overall project is to sense vibrations produced by a cantilever beam in the form of an analog signal then transmit it over a wireless medium to observe that analog signal.

What is the frequency range of the cantilever vibratons.

Will you be able to convert analog to PWM or digital fast enough?

What range of tx/rx are you hoping for?

Tom... :)