skaako Posted June 8, 2010 Posted June 8, 2010 Hi all, After getting my first RCX 2.0 kit for a bargain due to the fact it was missing the IR tower and a few miscellaneous pieces, i went about building a serial port tower. This was due to the fact after looking locally online after a month i gave up, and my friend needed the USB Tower that i was borrowing back. After looking for some plans online i didn't have much luck and nothing that i could build with the parts i had on hand. I realized with the help of some very informative sites that the IR tower is just basically a serial port at 2400 baud 8 data bits and odd parity. Also i found it uses a standard 38kHz as the carrier frequency. So for the IR receiver is a simple circuit fed into an RX line of the RS233A IC. For the transmitter was a bit more tricky, so a small program on the PIC generates a 38kHz carrier frequency, then a TX line from the RS233A is fed into an input of the PIC, the program uses this to modulate the 38kHz carrier. The IR LED is driven directly from the PIC at about 15mA. Only 4 pins of this IC are used so a smaller chip would do the job. Now.. many sites state that the RTS, CTS pins of the Tower are joined so that the program recognizes that the tower is present. I did join these pins at first and it worked perfectly, so i disconnected them and it still worked, even carrying out a firmware update in Robolab 2.5.4. So maybe only the earlier versions of the software checked for this. So now i had made my IR Tower the next step which i had planned earlier was to make it wireless. I like using the remote in Bricx to control my robot but if i turned it around.... no more communications. So with a header added to the board a and a few extra wires i added an RF transceiver module. With one attached to the com port of the computer now i will be able to drive the robot all round the house without worry. I have only bench tested it as yet, but the next fine weekend we get i'll take it to the park for a trial. I'm expecting around a 300m LOS range, these modules i have managed to get 350m max at 9600 baud so 300m at 2400 shouldn't be too much to ask. I can post a schematic/HEX file if anyone is interested. Now the only thing is... my friend wants one too : ) Mike Quote
Mortymore Posted June 8, 2010 Posted June 8, 2010 Great work For someone keen on electronics, and just looking for an RCX module, your work is very handy. I'm also looking forward to know how the wireless module behaved, and please let us know the reference of it, or were can it be found. Just bring on that SCH/HEX files. Thanks Quote
skaako Posted June 8, 2010 Author Posted June 8, 2010 Great work For someone keen on electronics, and just looking for an RCX module, your work is very handy. I'm also looking forward to know how the wireless module behaved, and please let us know the reference of it, or were can it be found. Just bring on that SCH/HEX files. Thanks Thanks for the interest, i'll let you know how i get on. My robot is nothing fancy though, it is just the crawler track one from the book. The wireless modules i use are the Hope HM-TR, they are very robust and i use them even in commercial projects. Another reason is that they are easy to get hold of here and are not very expensive, around 15USD. I laughed with my friend about using a high power unit, should get over 3km, only as i joke, i dont need that much range. These modules are produced by a number of manufacturers, they are just known as RS232 Transceivers, but the one in the picture does not have an onboard RS232 IC. I'll have to draw up a schematic sometime soon and post it as i made it up as i was going along, first on a breadboard then onto the prototype board in the picture. Mike Quote
roamingstop Posted June 8, 2010 Posted June 8, 2010 FTDI Chip make a nifty 5V or 3v3 USB Serial converter cable / module - which provides a virtual com port in windows (or Linux or Mac). This can then drives the RX / TX lines without the need for the Max 232R to do level shifting. The other advantage is that the FTDI drivers also have 4 DIO lines which could be programmed to improve PIC / system control. Quote
DLuders Posted June 8, 2010 Posted June 8, 2010 @ skaako: Are you familiar with the RCX "Updated USB Tower Windows Drivers" available from the website of "Philo" (Phillippe Hurbain)? Maybe it's possible to alter the CODE behind the USB Tower, and make your wireless setup even better. Check it out his webpage http://philohome.com/sdk25/sdk25.htm . Quote
skaako Posted June 8, 2010 Author Posted June 8, 2010 (edited) Hi again, FTDI Chip make a nifty 5V or 3v3 USB Serial converter cable / module - which provides a virtual com port in windows (or Linux or Mac). This can then drives the RX / TX lines without the need for the Max 232R to do level shifting. The other advantage is that the FTDI drivers also have 4 DIO lines which could be programmed to improve PIC / system control. I had planned on using the PIC18F2550 board shown in my last post on the Dacta CLI topic http://www.eurobricks.com/forum/index.php?showtopic=32749 as a USB to serial adapter for the RF module, i have used it in this way for other projects and it works quite well. It has a windows driver that detects it as a com port so its nice and simple to interface with. I will either do it this way or just use a standard USB to serial adapter as my laptop does not have a serial port. Mike Edited June 8, 2010 by skaako Quote
Mortymore Posted June 8, 2010 Posted June 8, 2010 The problem with FTDI chips is that they are too tiny to be easily soldered by an amateur. Certainly that a solution with FTDI as proposed would be equally interesting, but I still appreciate those that could be achieved by a larger number of people, that have only available the basic tool/skills for the job. Cumps Quote
skaako Posted June 8, 2010 Author Posted June 8, 2010 The problem with FTDI chips is that they are too tiny to be easily soldered by an amateur.Certainly that a solution with FTDI as proposed would be equally interesting, but I still appreciate those that could be achieved by a larger number of people, that have only available the basic tool/skills for the job. Cumps Yep, i totally agree. Thats why i stick with good ole PDIP : ) Quote
Brickthus Posted June 8, 2010 Posted June 8, 2010 Hi all, After getting my first RCX 2.0 kit for a bargain due to the fact it was missing the IR tower and a few miscellaneous pieces, i went about building a serial port tower. This was due to the fact after looking locally online after a month i gave up, and my friend needed the USB Tower that i was borrowing back. After looking for some plans online i didn't have much luck and nothing that i could build with the parts i had on hand. ... Mike I reverse-engineered the serial port tower from my RCX 1.0 kit ages ago. Here's the circuit. I had intended to the same for the RCX 2.0 USB tower at some stage but didn't get round to it. Mark Quote
roamingstop Posted June 8, 2010 Posted June 8, 2010 Yep, i totally agree. Thats why i stick with good ole PDIP : ) The UM232R is a dual in line package with most pins brought out and auto-voltage sensing... and still small. But agreed most of their SMD parts are too small for the average user. I used the DILP in some small PCB projects with circuit board piggy backing off the connecting board... Quote
skaako Posted June 9, 2010 Author Posted June 9, 2010 (edited) I reverse-engineered the serial port tower from my RCX 1.0 kit ages ago. Here's the circuit.I had intended to the same for the RCX 2.0 USB tower at some stage but didn't get round to it. Mark Hi Mark, Thanks for making that schematic. I did use it during making my IR tower to give me an understanding of how the actual Lego IR tower worked. I was contemplating whether or not to build the carrier signal generator with a NAND IC like the original Lego tower or with a 555 timer, then went with a microcontroller as i could then tweak the frequency easier, required less external components, and i could easily invert the output if required. Also i had a few of these chips lying around handy. From having a quick look inside the USB Tower i had use of, it looked very similar to your schematic for the serial version, it made me think if the USB to Serial converter was built into the USB plug, as the plug seems large enough to house it. Mike Edited June 9, 2010 by skaako Quote
Burf2000 Posted June 9, 2010 Posted June 9, 2010 I want one, can you make me one (lol) Be great to have a wireless RCX tower. Wonder how much it would cost Quote
DLuders Posted June 9, 2010 Posted June 9, 2010 Be great to have a wireless RCX tower. Wonder how much it would cost On the website http://www.hitechnic.com/ , it says: "HiTechnic Infrared Receiver Sensor Released -- Control your NXT robot with the HiTechnic IRReceiver Sensor and a LEGO Power Functions IR Remote Control. The IRReceiver decodes commands from a Power Functions Remote Control and your NXT program can use the commands to directly control NXT motors or to control other functions in your program. More information is available on the Products page." Cost is US$55. Quote
skaako Posted June 9, 2010 Author Posted June 9, 2010 (edited) I want one, can you make me one (lol)Be great to have a wireless RCX tower. Wonder how much it would cost If you are handy with a soldering iron, it doesn't take too much to build. As for the cost its hard for me to tell, the IC's were leftovers from an order, usually only a few dollars i think. The IR receiver and IR LED were from an old VCR or something, they have been sitting in my box for a long time. All the discreet components are cheap, the connector was from the box, the only thing i had to buy was the board, which was $2NZD. I guess if anyone was really interested i could send a pre-programmed PIC at cost. Or email me for the HEX file. Here is the schematic also. As you can see, the 16F628A is a bit of an overkill. Mike Edited June 9, 2010 by skaako Quote
Burf2000 Posted June 9, 2010 Posted June 9, 2010 On the website http://www.hitechnic.com/ , it says:"HiTechnic Infrared Receiver Sensor Released -- Control your NXT robot with the HiTechnic IRReceiver Sensor and a LEGO Power Functions IR Remote Control. The IRReceiver decodes commands from a Power Functions Remote Control and your NXT program can use the commands to directly control NXT motors or to control other functions in your program. More information is available on the Products page." Cost is US$55. I own one of these but no one has written a RobotC to RCX api Quote
DLuders Posted June 9, 2010 Posted June 9, 2010 I own one of these but no one has written a RobotC to RCX api Are you sure about this? HiTechnic JUST posted a new RobotC download (on June 2, 2010): http://www.hitechnic.com/downloadnew.php?category=21 . It deals with "A suite of RobotC drivers to support HiTechnic sensors and the HiTechnic Sensor Multiplexer. These drivers make it easy to use HiTechnic sensors when programming in RobotC and allow you to maintain control over when and how RobotC accesses the sensors. These drivers are for RobotC version 2.00 or later." Quote
skaako Posted June 9, 2010 Author Posted June 9, 2010 I own one of these but no one has written a RobotC to RCX api I'm getting my very first NXT set this weekend.... don't laugh : ) If i have the time i'll see what sort of interfacing i can do with it. I'm guessing its quite simple though as most of the more advanced sensors are just I2C based. I like the potential of it having a built in RS485 port, that could be fun too. I wonder if anybody has tried to interface the Nintendo Wii Remote sensors to it yet, as they are I2C based. The Wii Remote has a nice IR Tracking Sensor module in it that i have seen people play with, can track about 4 IR Emitters if i remember right. The HiTechnic sensors do look quite nice, its the price that puts me off though. Its good to see that TLG actually sell their stuff on the Lego website. Mike Quote
DLuders Posted June 9, 2010 Posted June 9, 2010 There's a Forum on http://mindsensors.com/ that can probably assist you both on your RCX and NXT projects. Check it out -- it may save you a lot of time. Quote
skaako Posted June 9, 2010 Author Posted June 9, 2010 Thanks, i'll check it out. The Lego Hardware Development Kit for the NXT was very helpful as well. I cant believe they gave all the schematics and everything. Quote
Burf2000 Posted June 9, 2010 Posted June 9, 2010 Hello there The sensor is a Hitechnic one and they said that so far no one has created a RobotC rapper for it. I might have a go or a friend of mine might. MindSensor make there own version which could be very different but again, worth a look. It could also be possible to convert the NXC code in to RobotC Yes people have used the Wii with the NXT, they tried using the NXT with all sorts of stuff. The NXT is a great bit of kit but the software is sh** Quote
skaako Posted June 9, 2010 Author Posted June 9, 2010 Hello thereThe sensor is a Hitechnic one and they said that so far no one has created a RobotC rapper for it. I might have a go or a friend of mine might. MindSensor make there own version which could be very different but again, worth a look. It could also be possible to convert the NXC code in to RobotC Yes people have used the Wii with the NXT, they tried using the NXT with all sorts of stuff. The NXT is a great bit of kit but the software is sh** Thats good to hear, now i just need a Wii remote i can rip apart : ) Whats a good language for the NXT? At the moment i'm using NQC with Bricx for the RCX and its okay. Its been a while since i have programmed in C but its coming back to me slowly. Quote
Burf2000 Posted June 9, 2010 Posted June 9, 2010 Well in my honest opinion, I don't know I went with RobotC as its nice to use and has some good samples including lots of 3rd party ones. It has a brill debugger and some support for commands that NXC does not (according to them when I asked the same question) However the only reasons I don't tell you to get RobotC is A) It cost money however a trail is available and is pretty cheap to buy B) The main sensor I want to use is the IRLink with an RCX and no one has done this with RobotC (it does however support PF), Hitechnic do provide an NXC example. It seems hardware companies do NXC examples before RobotC. I have not used NXC yet Quote
skaako Posted June 9, 2010 Author Posted June 9, 2010 Thanks for the info, i might use NXC for now as i have never used RobotC before. Is RobotC similar to NXC, i guessed it was another C variant, with its own firmware. Quote
Burf2000 Posted June 9, 2010 Posted June 9, 2010 It just looks like C to me, download the demo mate at http://www.robotc.net It feels fairly clean to me and also supports coding to the rcx Quote
dondigital Posted August 6, 2010 Posted August 6, 2010 Hi all, After getting my first RCX 2.0 kit for a bargain due to the fact it was missing the IR tower and a few miscellaneous pieces, i went about building a serial port tower. This was due to the fact after looking locally online after a month i gave up, and my friend needed the USB Tower that i was borrowing back. After looking for some plans online i didn't have much luck and nothing that i could build with the parts i had on hand. I realized with the help of some very informative sites that the IR tower is just basically a serial port at 2400 baud 8 data bits and odd parity. Also i found it uses a standard 38kHz as the carrier frequency. So for the IR receiver is a simple circuit fed into an RX line of the RS233A IC. For the transmitter was a bit more tricky, so a small program on the PIC generates a 38kHz carrier frequency, then a TX line from the RS233A is fed into an input of the PIC, the program uses this to modulate the 38kHz carrier. The IR LED is driven directly from the PIC at about 15mA. Only 4 pins of this IC are used so a smaller chip would do the job. Now.. many sites state that the RTS, CTS pins of the Tower are joined so that the program recognizes that the tower is present. I did join these pins at first and it worked perfectly, so i disconnected them and it still worked, even carrying out a firmware update in Robolab 2.5.4. So maybe only the earlier versions of the software checked for this. So now i had made my IR Tower the next step which i had planned earlier was to make it wireless. I like using the remote in Bricx to control my robot but if i turned it around.... no more communications. So with a header added to the board a and a few extra wires i added an RF transceiver module. With one attached to the com port of the computer now i will be able to drive the robot all round the house without worry. I have only bench tested it as yet, but the next fine weekend we get i'll take it to the park for a trial. I'm expecting around a 300m LOS range, these modules i have managed to get 350m max at 9600 baud so 300m at 2400 shouldn't be too much to ask. I can post a schematic/HEX file if anyone is interested. Now the only thing is... my friend wants one too : ) Mike I have a mindstorm kit missing the IR tower and am interested in your design. I f you could post the schematic and hex file I that would be great. Looks like you did a nice job on it. Thanks Dondigital Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.