go away spammer

Author Topic: A2D Conversion of RSSI Pin  (Read 2684 times)

0 Members and 1 Guest are viewing this topic.

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
A2D Conversion of RSSI Pin
« on: February 08, 2009, 05:39:51 PM »
Hello All,
I am trying to read the analog value of the RSSI pin of an RF receiver. Specifically this one  - http://www.rentron.com/remote_control/RXLC-434LR.htm . The RSSI pin outputs an analog voltage in relationship to the distance to the transmitter. The usual RSSI voltage output that I get is around 2V.
I connected the RSSI pin of the RF receiver to my Axon and I am able to read the RSSI analog values correctly. With the Axon the RSSI works perfectly.
I made my own custom board , with the ATmega168 as its processor, and I am trying to read the Analog value of the RSSI with the ATmega168. I used Admin's Photovore code and had it read the value of the RSSI and output it via HyperTerminal.
Code: [Select]
while(1) {
RSSI = a2dConvert8bit(1);
SendByte(RSSI);
}

Port Initializations: All of PORTC ( the analog ports) are set to be inputs and pullups are turned off ( admin already did this for me in his Photovore code). Analog pins are initialized by Admins code here:
Code: [Select]
a2dInit(); // initialize analog to digital converter (ADC)
a2dSetPrescaler(ADC_PRESCALE_DIV32); // configure ADC scaling
a2dSetReference(ADC_REFERENCE_AVCC); // configure ADC reference voltage

Details about my custom board - I attached a basic schematic of the board. Its just RSSI straight to the analog pin. The GND,PWR, and Data pins of the Receiver are not shown in the schematic but they are connected in real life. The receiver and the ATmega168 share a common GND. I can verify the operation of the Receiver because I am able to transmit data over the UART perfectly.

The ATmega168 is running at internal oscillator setting of 8mhz.

One thing I found peculiar was that if I connect my voltmeter to the RSSI pin when the RSSI pin is NOT connected to the circuit I get like 2 volts.  But when I take the voltage of the RSSI when it IS connected to the circuit, I get a voltage reading in the millivolts.

Very important fact: When my transmitter is off, the RSSI pin of my receiver is 0. So what I did was as follows. I turned off my transmitter and turned on the custom board with the receiver. The custom board outputted only zeroes via HyperTerminal.
Then I turned on the transmitter and all of the sudden I started seeing that the custom board was outputting 1s and 0s, and not only 0. Here is a segment of the data I received: ( NOTE: data shown are bytes sent over HyperTerminal in Hex format, so for example "01" is one hex byte, and "00" is another single hex byte)
Quote
01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 00 00 01 00 01 00 01 00 00 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 00 00 01 00 01 00 01 00 01 00 01 00 00 00 01 00 01 00 01 00 01 00 01 00 01 00 00 00 01 00 00 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 00 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 00 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 00 00 01 00 01 00 01 00 00 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 00 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 00 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 00 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 00 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00
Looking at the numbers I began to see a pattern. A lot of 01, 00 ,01 ,00 .

Can someone help me out to get this A2D conversion working?

Thanks in advance,
Eric

EDIT: I connected a potentiometer to a different analog port on my ATmega168. One outer pin to +5V , other outer pin to GND, and middle pin to ADC0. I looked in HyperTerminal and the highest hex byte I got was 3. But the potentiometer was in fact working. At 0 degrees it was giving out a hex byte of 0 , at 30 degrees it was 1 , at 60 degrees it was 2, and at 90 degrees it was 3.
Whats going on here????

« Last Edit: February 08, 2009, 06:04:17 PM by airman00 »
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,431
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
    • Nerdcore - Programming, Electronics, Mechanics
Re: A2D Conversion of RSSI Pin
« Reply #1 on: February 08, 2009, 06:59:25 PM »



This line will supply an analog voltage that is proportional
to the strength of the received signal.


Can you answer these questions for us:


Step 1: Connect a digital voltmeter to the RSSI PIN of the receiver.
(Make sure the multimeter is set to DC volt and that you measure from the RSSI PIN to GND).
Power on the receiver and make sure the transmitter is powered off.
Q1: What voltage do you get on the RSSI PIN of the receiver?


Step 2: Power on the transmitter.
Q2: What voltage do you get on the RSSI PIN of the receiver?
(The transmitter and the Receiver are powered on).

Step 3: Connect +5V via a 1k ohm series resistor to the DATA pin of the transmitter.
(The transmitter and the receiver are powered on).
Q3: What voltage do you get on the RSSI PIN of the receiver?

Step 4: Connect GND via a 1k ohm series resistor to the DATA pin of the transmitter.
(The transmitter and the receiver are powered on).
Q4: What voltage do you get on the RSSI PIN of the receiver?


Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,431
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
    • Nerdcore - Programming, Electronics, Mechanics
Re: A2D Conversion of RSSI Pin
« Reply #2 on: February 08, 2009, 07:04:41 PM »
Parallax is using a similar RF module, the RXM-433-LR-S.

Maybe you can see what they're doing:
http://www.parallax.com/Portals/0/Downloads/docs/prod/rf/27981-ParallaxRFReceive-v1.1.pdf

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: A2D Conversion of RSSI Pin
« Reply #3 on: February 08, 2009, 09:45:51 PM »
I solved the problem
It seems like my modified UART file ( the same one I used in my RF module tutorial) was causing the problems.
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

 


Get Your Ad Here