433Mhz Link-Kit + VirtualWire runs only on battery

Hello,

I’m trying to send messages between two Arduino Unos. Therefore I use the 433Mhz Link-Kit and the VirtualWire library.

When running transceiver und receiver from battery, power adapter or USB-cable+powerbank all is fine. But when the receiver is running on USB (plugged into computer) then nearly no messages will be received. This drives me nuts. This way I’m not able to debug and see messages by Serial terminal on PC.

Does anybody have an idea, why the receiver (+Arduino) only works if it’s not powered by computer? (Info: The sender isn’t hit by this problem.)

Do you have anything connected on the pins 0 and 1 (rx, tx), that could be a problem because you need them to connect with computer.

No, the pins 0 and 1 are unused. Serial is working when connected by USB with PC. That's not the problem. But the VirtualWire lirary most times doesn't trigger/receive when connected per USB.

So the

if (vw_get_message(buf, &buflen)) // Non-blocking
    {
...
}

(nearly) never get's true when the receiving Arduino is running on USB. If I run it by alternative power source (and connect pins 0 and 1 with Serialadapter to PC) I can see, that it's working fine.

So there must be a problem when driving Arduino from PC/USB as power source. But I don't know what exactly is going wrong... Maybe on USB/PC the ATMEGA runs with a slightly different MHz so that the 433Mhz receiver gets out of tune? Any idea?

Do you have antenna wires? Just any piece of about 17cm of wire will do.

The receiver of the cheapest modules are tuned with the coil. I don't use those anymore, I use only the receivers with a crystal now.

Is something else connected to the Uno ? The VirtualWire sets all three pins (rx, tx, ptt), even if you don't use them.

Antenna wires were attached (17,3 cm). On battery it ran fine so it must be a problem with the power given by my computers USB port.

But I "fixed" it. I replaced VirtualWire with its successor (RadioHead). No it's working fine, regardless of the power source which is used.

I would like to know the cause... makes me sleep better :wink: Well, I'm glad you have it working :slight_smile:

Hey Peter,

I would like to know the cause... makes me sleep better

that same goes for me, but I can't tell you.

Both, RadioHead as also VirtualWire come with a simple "receiver"-sketch. The one from RadioHead runs without problems regardsless of the power source. The one from VirtualWire doesn't. I really don't get it. Sorry.