Society of Robots - Robot Forum

Software => Software => Topic started by: superchiku on February 17, 2008, 09:38:52 PM

Title: displaying sensor data
Post by: superchiku on February 17, 2008, 09:38:52 PM
ok i have understood the admin's tutorial of how ur going to selelct the threshold values of the sensors and then use fuzzy logic to program it according to different enviroments

but my problem is that even if i get an analog to digital conversion and store it in a variable but still i dont know how to see it on my computer screen inorder to graph the data so i needed to know how i display the sensor data on my screen when iam testing it will the simple printf statement work likee

unsigned int i;
i=digital data of the sensors(converted);
printf("%u   ",i);

will this kind of simple code work and will i get the digital value of the sensors on my screenwhile debugging??????
Title: Re: displaying sensor data
Post by: benji on February 18, 2008, 05:27:13 AM
connect your micro to the pc using UART , open up your hyperterminal
,send the data from micro to pc using the putchar(i) function
, (this is for AVR micros, not sure about others)

Title: Re: displaying sensor data
Post by: superchiku on February 18, 2008, 08:34:10 AM
well uart is good but the admin's tutorial for building the uart is not given so can u help me by telling what equipments i shall buy to build the uart??
Title: Re: displaying sensor data
Post by: neo01124 on February 18, 2008, 10:32:43 AM
UART is Universal Asynchronous Reciever Transmitter and u dont have to build a uart chip (dont know if that can be done easily :P)
The uart chip resides in almost all uC available today, only thing u'll have to do is intreface a max232 for voltage conversion in between ur uC and PC (its for conversion from rs232 to ttl logic) and u can use anything from C++ to Matlab to access data from ur serial pins.
This interfacing part has been answered many times on this forum and i gess i have given u enuff keywords already so use ur search engine and cheers ;D
Title: Re: displaying sensor data
Post by: DomoArigato on February 18, 2008, 11:08:33 AM
I highly sudgest using a bluetooth serial connection.  It's a little more expensive, but it has a much greater potential for future applications and your robot can send the data unattached to your computer.  This one worked great for me: http://www.sparkfun.com/commerce/product_info.php?products_id=582  If it's too pricey check out the usb and regular serial ports at sparkfun.com and acroname.com (that is if you don't want to build it yourself).
Title: Re: displaying sensor data
Post by: superchiku on February 19, 2008, 06:29:00 AM
yes ur right but u see i live in india and buying anything from radio shack can take many days so if i build the uart by using max232 will it be enough for communication
Title: Re: displaying sensor data
Post by: benji on February 19, 2008, 10:52:19 AM
you dont need to build anything, the micro-controller has a built in UART and you use max232 to interface to the pc
(converting rs-232 into ttl voltage levels)
Title: Re: displaying sensor data
Post by: javafiend on February 19, 2008, 11:28:54 AM
Straight from the Microcontroller UART Tutorial (http://www.societyofrobots.com/microcontroller_uart.shtml):

Quote
EIA232F
Today signal transmission systems are much more robust, meaning a +/-12V signal is unnecessary. The EIA232F standard (introduced in 1997) is basically the same as the RS232 standard, but now it can accept a much more reasonable 0V to 5V signal. Almost all current computers (after 2002) utilize a serial port based on this EIA-232 standard. This is great, because now you no longer need the annoying MAX232 circuit!

Instead what you can use is something called the RS232 shifter - a circuit that takes signals from the computer/microcontroller (TTL) and correctly inverts and amplifies the serial signals to the EIA232F standard.

If you'd like to learn more about these standards, check out this RS232 and EIA232 tutorial (external site).

The cheapest RS232 shifter I've found is the $7 RS232 Shifter Board Kit from SparkFun. They have schematics of their board posted if you'd rather make your own.

So, the way I read this, you do not need a MAX232 if you have a fairly current computer ( < 6 years old).  You would only need a shifter board if you wanted to use a serial cable interface.  The tutorial has other examples of UART devices towards the end.  I would go with DomoArigato's suggestion about using bluetooth.  You'll probably be happier with it in the end even if you have to wait a week or two.
Title: Re: displaying sensor data
Post by: airman00 on February 19, 2008, 06:28:22 PM
with the bluesmirf serial module , would you need any specific bluetooth dongle , or would all of them work?