PDA

View Full Version : RF - PC Controlled Rover.



anonymoussomeone
03-01-2010, 11:27 PM
I am building a project on RF Remote Controlling a ATMEGA16 micro controller car via a Computer.

This is my first independent project and am clueless on where to begin. Brief design outline is like:
1) Interfacing 2 DC motors to uC using H Bridge L293D
2) Interfacing a ISM band FSK Transceiver to the uC.
3) Interfacing another Transceiver to the Computer for Control Signals.
4) Develop GUI for control.Right now I would put only 4 controls, forward, backwards, right, left.

Now I can do the DC motor interfacing part, but am hesitant about the Transceiver part. Firstly because I am not getting a suitable Transceiver IC/Module for at least 100 meters range. Secondly, I wish to Interface the second transceiver to the computer without a intervening micro controller.

Could somebody help me out of this dilemma?
Its really urgent!

Thanks in advance

achuwilson
03-02-2010, 12:59 AM
It will be better if you are using a standard MHz rf transceiver. You can connect the transceiver to the serial port through a MAX232 driver. At the other side the (ie on the robot ) you can directly connect a similar transceiver to the UART port of the micro-controller. They are available at Indian websites likehttp://www.sunrom.com,http://www.rhydolabz.com etc
It will be a lot easier if you are using linux to control your robot. You can write a c code to send bytes to the serial port accepting data from the keyboard.

Hope this helps
BEST WISHES

anonymoussomeone
03-02-2010, 01:09 AM
It will be better if you are using a standard MHz rf transceiver. You can connect the transceiver to the serial port through a MAX232 driver. At the other side the (ie on the robot ) you can directly connect a similar transceiver to the UART port of the micro-controller. They are available at Indian websites likehttp://www.sunrom.com,http://www.rhydolabz.com etc
It will be a lot easier if you are using linux to control your robot. You can write a c code to send bytes to the serial port accepting data from the keyboard.

Hope this helps
BEST WISHES

Thanks for the valuable suggestion. I am familiar with GCC based WinAVR and am stepping into AVRSTUDIO these days for the microcontroller part.
As for the transceiver part, I am looking for large range with least errors, what band would you suggest for that. Most robotic projects employ ASK, but then range is limited and are error prone.

shashak
03-02-2010, 10:17 AM
dude, i always insist people to use zigbee modules. Digi xbee are excellent choice though bit expensive but there performace beats its price tag.
they are available in india though online stores like,
http://www.nex-robotics.com/products/wireless-devices/zigbee-wireless-serial-communication-module.html
http://robokits.co.in/shop/index.php?main_page=product_info&cPath=7&products_id=278

Ulhas
03-03-2010, 12:20 PM
ZIGBEE Wireless Serial Communication Modules are too costly
check this, this fellow also gives source code for it

http://www.sunrom.com/index.php?main_page=product_info&cPath=130_89&products_id=498

and

http://www.nex-robotics.com/products/wireless-devices/usb-wireless-module.html

anonymoussomeone
04-08-2010, 10:48 PM
OK friends, I have bought the transceiver module from sunrom.com and now am trying to interface it with the computer.
This is what I have done till yet and the problems I am encountering:

Firstly, the pins are too small to have any polarized header mounted on them. Anyways, for the time being, I am using databus wires for that.

In a loopback test without using any transceiver in between, I receive "Hello" when I send "Hello"
However, when I send "Hello" using transceiver, I receive it sometimes, and most of the time, it is some garbage value.

How do I correct it. They say it has a range of 100 meters (LOS I Suspect). But still, I am not able to send data effectively. I am connecting the two modules to the receiver and transmitter of the same serial port through a MAX232 IC.

I have written the code in VB6 and am using a serial to USB cable. And please help fast, submission dates are arriving.

allbits
04-09-2010, 08:49 AM
In a loopback test without using any transceiver in between,
can you elaborate the connection?? "transceiver'in between what? the PC and the bot?
Did you connect it with wire or did you loop back at the PC side itself?

hope you have not given 5V to the chip. The chip is a 3.3 one.
Serial - USB converters mess up normally. Especially with vista. Trust me on this. If you are using a desktop, use the serial port. Check if any other virtual comports are active in your laptop. Sometimes, vista messes up while assigning comm port number. You can change the port number(use device manager)

Dont worry about the range, you wont get much. In fact, i will be surprised if you get more that 50m line of sight. Just get it working. be it at 20 m.

And the mst confusing part is -


I am connecting the two modules to the receiver and transmitter of the same serial port through a MAX232 IC.
It will save a lot of time, if you draw a schematic and post it. The statement is vague. you need to explain better if you have to get help fast.


and please stop using words like 'urgent', 'help fast' etc, that sometimes irritates a lot.

Ulhas
04-09-2010, 08:52 AM
Which one you purchased. You can use ribbon connector female PCB mountable header for connection if you are using my suggested module

By the way can you post the code so that it can be checked

By the way this chip can be configured for output power thru coding
Ensure that you have set that to max power mode

anonymoussomeone
04-09-2010, 08:34 PM
http://picasaweb.google.com/anshulthakurjourneyendless/BloggerPictures?authkey=Gv1sRgCNiLmdTr6erdsAE#5458 152690662292402

http://i39.tinypic.com/34q4thj.jpg
here is the schematic
http://www.sunrom.com/index.php?main_page=product_info&products_id=498&currency=INR
here is the Module
and Sorry If I annoyed you by saying words like hurry. :)

Ulhas
04-09-2010, 09:10 PM
Ufffffffffffff

are you kiding ?
This module works on SPI bus. I still wonder how you are testing it even without going thru datasheet of CC1100.
This device has to be initialised first before transmit or receive operation, Refer to source code provided and reformat it for your compiler

Apart from that just check module once again because module line is now getting around 4 to 5V thru Max232, You might have damaged the modules.

anonymoussomeone
04-09-2010, 09:26 PM
Sorry for my ignorance, but I told you its my first project in robotics. And I did not connect it to MAX 232 for Vcc, used a Multiadaptor giving around 3.8 volts and added a series Resistor before it to ensure Drops below 3.6 Volts every time, but above 1.8 Volts.

As for the datasheet, I had no idea about SPI and am currently reading on it.
So does that mean that a microcontroller is necessary in between the module and PC? I have Atmega 8 bought from Sunrom (I guess its preprogrammed for this interfacing)


http://www.sunrom.com/index.php?main_page=product_info&products_id=802

Iit is the same as you suggested to buy. But a conventional female header cannot be mounted on the pins as the separation between the pins is too less.

The main part of the program is as follows, it is just meant for testing so pretty trivial:

Private Sub Command1_Click()
If MSComm1.PortOpen = False Then
MSComm1.PortOpen = True
End If
Label2.Caption = ""
MSComm1.Output = "Hello"
If (MSComm1.InBufferCount > 0) Then
Label2.Caption = MSComm1.Input
End If
End Sub

I don't have a serial or parallel port on my PC so I am compelled to use a Serial to USB cable, but I guess its working fine. Have set the port numbers and the Bauds.

anonymoussomeone
04-09-2010, 09:33 PM
One more problem, yesterday when I was using it, it sometimes sent 'Hello' and received it. But now its totally garbage. Now that you have pointed out that it is an SPI I'll have to consider that as Luck.

However, I have noticed that If I Connect the Pins 11 and 12 together thereby connecting the receiver port to the transmitter port directly, I still do not receive "Hello" when I send it. What could be the problem in that?

allbits
04-10-2010, 07:27 AM
> you have connected both modules on the Max232 side. I think one of them must be on the robot side.
> I am not sure if you know what you are doing. Get the basics right.
> You will need two micros. One to take in serial data from Max232, and transmit the data to the transmitter via the spi bus.
> The other micro will be on the robot side. This will take in the data from the module, again via spi, and do whatever you want to.
> You have not drawn the top level block diagram for your project. if that fails, a lot of time goes like that.
> There is no need to hurry. You cannot configure and make a cc1100 chip work like that unless you have read the datasheet and you have good working knowledge with SPI. Or may be you should have someone who knows things really well, NEAR you.
> If you really dont have time, and if you dont need two way communication, use the cheap OOK modules. you can directly connect it to the MAX232. you will have to use a timer at the VB part to keep sending some data at some rate.

Ulhas
04-10-2010, 08:26 AM
One good thing that you did is you have purchased this
http://www.sunrom.com/index.php?main_page=product_info&products_id=802

ie ST1197 - Serial Interface IC for RF Transreceivers

Interfacing CC1100 module with this ic is much more simple.
You can use PC also no need of uC
But you can't send binary or hex data thru vb serial port you have to use predefined method that is use varint and byte array to send you data as hex thru serial port

Go thru ST1197 datasheet no need to go for SPI as you have this chip

But if you are planning to purche this why you have not purchased this module

http://www.sunrom.com/index.php?main_page=product_info&cPath=130_131&products_id=875

http://www.sunrom.com/index.php?main_page=product_info&cPath=130_131&products_id=560

http://www.sunrom.com/index.php?main_page=product_info&cPath=130_131&products_id=646

anonymoussomeone
04-10-2010, 06:00 PM
I connected both transmitter and receiver on the same MAX232 because I was trying to see what is received when I transmit data.
The receiver would later go on to the robot for reception. Its only that I am learning it right now.
I have tried the OOK transmitters and receivers and I am able to transmit and receive data over a simple OOK link, I am yet to implement it on Microcontrollers.


"But you can't send binary or hex data thru vb serial port you have to use predefined method that is use varint and byte array to send you data as hex thru serial port"
I didn't get you, please elaborate.
and ST1197 is an ATMEL ATMEGA8L IC in this case.

Ulhas
04-11-2010, 11:50 AM
I connected both transmitter and receiver on the same MAX232 because I was trying to see what is received when I transmit data.
The receiver would later go on to the robot for reception. Its only that I am learning it right now.
I have tried the OOK transmitters and receivers and I am able to transmit and receive data over a simple OOK link, I am yet to implement it on Microcontrollers.


"But you can't send binary or hex data thru vb serial port you have to use predefined method that is use varint and byte array to send you data as hex thru serial port"
I didn't get you, please elaborate.
and ST1197 is an ATMEL ATMEGA8L IC in this case.

Its ok they might have programmed it and renamed ST1197.
Just try to read it and see is it preprogramed or not?

Post your schematic with this ic, its too simple with this ST1197.
Refer visual basic black book for understanding vb serial port, it is available on net

anonymoussomeone
04-14-2010, 08:21 PM
Hey everyone, I spent the last few days making a piece of code to work on the microcontroller and now am done with it.
This is what I have achieved till now:

1) I can wirelessly transfer data from one computer to another using simple OOK Tx and Rx, to which I had to shift because o the unavailability of the 3.6 Volts regulator IC TM55 3601. Though it came along with some noise, but the data was intact and received as it should be.
2) Assuming that the first data bit might be lost in transmission, I have decided the following protocol after reading a post on it on Net;
Databyte 1: Synchro byte (* in my case)
Databyte 2: Synchro byte(*)
Databyte 3: Address of Device(for example 1)
Databyte 4: Command byte(to turn pin x ON on Port B, if data matches)
Databyte 5: Checksum byte = Databyte+Address(1+A=r)

I coded the microcontroller using this logic and was able to successfully receive the data and turn on the ports
If synchro byte 1 gets corrupted, code ignores it and watches for the second synchrobit, which should be uncorrupted as per the assumption. If whole data is corrupted, checksum fails and nothing happens, data is discarded.

Now I am trying to send data from computer to Microcontroller through Wireless Rx and Tx.
But the microcontroller works on a different logic level.

Transfering data from computer to another computer involved use of MAX232 in between which accepted data above .8V as input. So it could detect my data. The voltage across data terminals of Rx is around 1.5 - 2 Volts, which is not enough to be detected as positive logic by the microcontroller. So it receives nothing. Tried using BC548 to amplify the signal using 4.7K resistors, but then the ever persistent noise also gets amplified and data is never received as it should be.
So what could be the possible solution for this?

anonymoussomeone
04-14-2010, 08:27 PM
http://i44.tinypic.com/33atqgz.jpg
Receiver(rough)

http://i41.tinypic.com/2ebtrac.jpg
Tranmitter(rough)