433Mhz wireless problem

My scenario is this:

I have a transmitter circuit using the 433Mhz RF module and a separate receiver circuit. With the two built on breadboards, it works well. Tested distance is over 50 feet (length of my houe) through various walls and doorways. When I built the receiver circuit on a soldered board, no problem. Works well, ie transmitter circuit on the breadboard and receiver circuit on a soldered board.

My next step was to put the transmitter circuit onto a soldered board. I am not getting any response on my receiver circuit (buzzer).

Parts on transmitter board:
1 ATMEGA328 with 16m crystall and required capacitors
1 DHT22 temperature sensor
1 433mhz RF transmitter + antenna
1 5v power regulator (L7805CV)
Program loaded on both breadbaord and soldered board exactly the same file

Trouble shooting:
1 - The first thing I noticed was the ATMega328 chip was installed backwards on the socket. I removed the chip and put it back on the breadboard circuit to check operation. System worked fine on both ends. I put the chip back in the socket on the soldered circuit.

2- The second thing I noticed was that the 16mhz crystal and associated caps were not installed (another unbelievable oversight in my haste to put this together.). I installed the missing parts.

3- I am using the AVCC pin for the 5v supply on the chip (I had read that the more recent chips worked fine with VCC or AVCC powered and it was more convenient to hookup). Just in case, I wired the 5v supply to the VCC also.

4- I checked all connections for continuity and voltage and pin connections. Everything seems in order. The TX data is connected to pin 7 via programming which is located at position 13 on the chip as per the pin mapping for the Atmega328. The measure voltage at the TX module is 4.98v.

5- I added a USB adapter to the circuit via breadboard to check via the serial monitor how the program was behaving. I saw no surprises: the DHT22 temperature was correct and the program made it to the transmit code part of the program:

vw_send((uint8_t *)&c, 1); // Transmit character

vw_wait_tx(); // Wait until transmission is complete…ie, ‘The entire message is gone’…See VirtualWire library methods

This is one thing I don’t understand: The line of code that tells the program to wait until the entire message is sent: The transmitter must be sending something since the program makes it past this point and goes thru the loop again and again with the right information on the serial monitor. Otherwise, wouldn’t the program just sit and wait indefinitely?

If anyone has any suggestions, I would really appreciate the help. The transmission works from the breadboard but not the soldered circuit. On the soldered circuit I put my spare transmitter module without an antenna and it still works fine.

Even though my 328 chip that I installed backwards on the soldered circuit still worked on the breadboard circuit when I tested it, can the problem be a bad pin 13 (pin 7 programatically) on the chip? I really don’t want to remove it again unless I have to. I put a new chip on the breadboard for now and I have a couple more spares.

My last option wold be to rebuild the soldered circuit but I don’t really want to do that unless I have some basis for knowing what is wrong.

I’ve attached a photo with the USB connected but not sure what if any help that might be.

Thanks

In my note above "...On the soldered circuit I put my spare transmitter module without an antenna and it still works fine."...I meant to say "On the breadboard circuit..."

Re Vcc/Avcc - they should be externally connected (pg 3 of datasheet) - you do have them connected, right?

I don't see the 0.1uf decoupling capacitors between Vcc and Gnd, and AVcc and Gnd right next to the chip.

Can you draw out the schematic? We can't really see how things are connected.

To determine if the problem is a damaged pin, just upload some test code (like blink, modified to blink the transmit pin - and maybe slowed down a bit?) to it and monitor the pin with a volt meter.

I wouldn't expect plugging it in backwards to trash the chip, with an ATMegax8-PU - I mean, look at what ground and Vcc would be connected to if it was backwards...

Have you checked that you have the pinout of the transmitter correct? There are several pinouts used in available transmitters (some have data in the middle, others have data on the end, with Vcc in the middle)

Thanks for the reply. So far I can say this:

1- I have AVCC and VCC connected to the 5v rail.

2- The only caps I have connected to the mega328 chip are two 22pf caps...one connected to GND and Pin9 and the other to GND and Pin 10. The crystal is connected to Pins 9 and 10 on the chip (labels are XTL1 and XTL2)

3- I checked if AVCC and VCC were connected to anything when the chip went in backward. Luckily, the wouldn't have been connected to anything. I guess that's why the chip survived.

4- This transmit module is DATA, VCC and GND. Connections are good. Wired same way on the breadboard.

5-I'll try the suggestion for pin7 and the voltmeter tomorrow for sure.

One other thing. This morning I found the reset button was wired the wrong way, ie it made a closed connection to the reset pin and ground instead of an open connection. Another careless mistake. Anyhow, I just cut it out of the circuit (little frustration got to me!). Ordered some new buttons as that was my last one.

Made a rough sketch of circuit attached..

Thanks again.

Attachment too large. Made smaller jpg…should pass thru now.

You need at least one 100nF decoupling capacitor at VCC and GND.

Apply GND to both GND pins and 5V to VCC and AVCC.
Don't use a GND pin as some kind of pass-through ground. It might work, be you will be the only one in the world that does that. Just apply GND to both GND pins.

An ATmega chip can be partly damaged. A single pin might be damaged, or the clock circuit might be damaged, or the analog section might be damaged. Everything is possible.

You could make pin 7 high and low with one or two seconds delay and measure it with a multimeter. I assume that the transmitter module is working.
The receiver can be checked by reading the receiver output with a computer. Use a voltage divider with 100k resistor (to receiver output) and 10k resistor (to GND). The middle to the line-in of a computer and also connect GND. Record it with Audacity.

It is possible that the problem is in your sketch, even if it did work on the breadboard. Stranger things have happened.

Thanks for the suggestions. Ill try to check pin 7 first. Then apply GND to both sides. I’ve never seen the cap put between VCC and GND in any of the Arduino on a breadboard setup I’ve looked at including Name do.com but Ill give it a try.

Do I need same between AVCC and GND?

Not sure what AUDACITY is but I’ll look it up.

Thanks so much for your help. A little hope goes a long way.

Audacity : http://web.audacityteam.org/

You can connect AVCC to 5V and you don't need an extra 100nF decoupling capacitor. If you want less noise in your analog samples, then use a coil and a capacitor. It's in the datasheet.

Do you have a normal 7805 (or L7805) without capacitors ? That is not a voltage regulator, that is an oscillator. Use 100nF decoupling capacitor at input (to input and GND) and at the output (to output and GND) of the 7805 and maybe add some larger capacitors as well.

Thanks for the comments and suggestions. I've got it working but still scratching my head. As you suggested I checked pin 7 with a blinking LED and it worked.

Since I had a spare TX module, I decided to plug that in via breadboard and change the pin from 7 to 4. It worked!

Not sure why but must have screwed up something related to pin 7.

Still not out of the woods...I'm gonna desolder the pin 7 connection and connect the TX data to pin 4. I'm hoping that works. If not, then maybe it is the TX module.

re 7805, yes I have the caps installed and get a good 5v coming out of it.

Thanks again so much. Keeping my fingers crossed!

There are a disturbing number of breadboard arduino tutorials that omit the necessary decoupling caps. I'm not sure how they can work; I've had chips refuse to program simply because the decoupling cap was too far away...

It's really disappointing how widespread that misinformation is (same with the "you don't need to connect Vcc and AVcc" claim, which is of course also untrue), particularly in light of how hard it is to explain why you need decoupling caps to newbies. You need them on just about any digital IC, one per vcc pin (unless specified otherwise in the datasheet).

Without the capacitor, I would consider any correct functionality to be unexpected.

As for pin 7, yeah, it sounds like either something bad happened to pin 7 (that's strange though), or there's a wiring mistake. Is that transmitter unit soldered in, or are you swapping them out? maybe that's bad? The boards are so cheap, I can't imagine non-working boards are rare... They're being made for like 25-cents a pop tops (based on ebay price for set of 20 boards, incl shipping - $14 - adjusted for the fact that the rx board has got to be a little more expensive and the price includes shipping)

The VirtualWire sets all three pins to default pins, ptt to pin 10, rx to pin 11, tx to pin 12.
If you only use the TX, the others are still set to the default pins.

I prefer to set every pin with vw_set_ptt_pin(), vw_set_rx_pin(), vw_set_tx_pin(). I set the things that I don't use to unused Arduino pins.

If you set the TX pin to 7 or 4, that's okay. The DHT22 can be happy at pin 12 and you don't use pin 10 and 11.

You might want to think about using a new ATmega chip. Is that one reliable ? Who knows.

(While I was typing this, DrAzzy wrote about the necessity of decoupling caps. That is so very true.)