PS3 and Wiimote on Arduino !

News and announcements related to Humanoids/walkers, robo-one/other conferences, intelligent servos, advanced robot controllers/sensors, and interesting new humanoid related developments.
20 postsPage 1 of 21, 2
20 postsPage 1 of 21, 2

PS3 and Wiimote on Arduino !

Post by i-Bot » Mon Dec 21, 2009 4:34 pm

Post by i-Bot
Mon Dec 21, 2009 4:34 pm

We don't see much mention of Arduino here, but Robosavvy do sell them.

Over the summer I have done a few embedded implementations of PS3 and Wiimote game controller interfaces using USB and Bluetooth. When I got hold of an Arduino USB Host shield from Circuits@Home, I decide to try to do a version for the Arduino. Quite a challenge to get the USB protocol stack and a Bluetooth stack to support Bluetooth HID, in 1K bytes of Data RAM.

Here is a video of the results, hopefully some of the Arduino community will find something more interesting to do with it !:
http://www.youtube.com/watch?v=cYcp4gfRY_A

The documentation and library code will be on Circuits@Home as I write it over Xmas.
We don't see much mention of Arduino here, but Robosavvy do sell them.

Over the summer I have done a few embedded implementations of PS3 and Wiimote game controller interfaces using USB and Bluetooth. When I got hold of an Arduino USB Host shield from Circuits@Home, I decide to try to do a version for the Arduino. Quite a challenge to get the USB protocol stack and a Bluetooth stack to support Bluetooth HID, in 1K bytes of Data RAM.

Here is a video of the results, hopefully some of the Arduino community will find something more interesting to do with it !:
http://www.youtube.com/watch?v=cYcp4gfRY_A

The documentation and library code will be on Circuits@Home as I write it over Xmas.
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by PedroR » Tue Dec 22, 2009 4:01 pm

Post by PedroR
Tue Dec 22, 2009 4:01 pm

hi

I was watching your video and this is really amazing! I also took some time to investigate some more about code for the USB shield and it seems like the code base for the shield is actively growing.

I was particularly impressed with the use of the Accelerometer to move the servos!
We no longer have the TellyMate shields in stock for now but this got me wondering how easily you could build a classic PONG, pacman or tetris game using the cool BT wireless devices ;)


A few questions:
1) Is the USB host code implemented in Arduino? I am assuming not.
If not, do you program two processors: the Arduino and the USB host?
How do they communicate?

2) The second question is if it is possible to place, for example, two shields, to add two joysticks or a joystick and some other USB device.


As a final note, for the convenience of viewers, I have embedded your video bellow: (I hope it is ok with you)

phpBB [media]

I was delighted with the nice detail of the Robosavvy Logo :) :) :)

Regards
Pedro
hi

I was watching your video and this is really amazing! I also took some time to investigate some more about code for the USB shield and it seems like the code base for the shield is actively growing.

I was particularly impressed with the use of the Accelerometer to move the servos!
We no longer have the TellyMate shields in stock for now but this got me wondering how easily you could build a classic PONG, pacman or tetris game using the cool BT wireless devices ;)


A few questions:
1) Is the USB host code implemented in Arduino? I am assuming not.
If not, do you program two processors: the Arduino and the USB host?
How do they communicate?

2) The second question is if it is possible to place, for example, two shields, to add two joysticks or a joystick and some other USB device.


As a final note, for the convenience of viewers, I have embedded your video bellow: (I hope it is ok with you)

phpBB [media]

I was delighted with the nice detail of the Robosavvy Logo :) :) :)

Regards
Pedro
PedroR offline
Savvy Roboteer
Savvy Roboteer
Posts: 1199
Joined: Mon Jun 16, 2008 11:07 pm

Post by i-Bot » Tue Dec 22, 2009 5:53 pm

Post by i-Bot
Tue Dec 22, 2009 5:53 pm

Hi,

It would be fairly easy to put the games you mention onto the Arduino. There is still plenty on processing power left on the Atmega, The demand on the flash and data RAM would probably require an ATMega328 chip.

The USB Host shield has an MAX3421e "semi intelligent" device for the USB interface and communicates over SPI. The actual USB host code is on the Arduino.

The shield can be built with double ended headers to stack with other shields. It uses Digital pins 7 through 13 for the SPI and control, so only one USB host shield can be added.

Multiple game controllers could be handled as multiple bluetooth devices on the same USB dongle, but again would need a 328 or better.

The code also works on the AVR32 board from randommatt, which has a built in USB host port ( and 60 mips and oodles of memory) . The code would also be easy to port to something like the low cost AVRKey using LUFA, which also has a built in USB Host port.

The PS3 controller has 3 axis accelerometers and one Z Gyro. The Wiimote has 3 axis accelerometers as standard, the nunchuck adds 3 more accelerometers in your other hand, and the wiimotion+ adds 3 Gyros. Response is really good, much better than using a PC between the controllers and the Arduino.

Thanks,
Richard
Hi,

It would be fairly easy to put the games you mention onto the Arduino. There is still plenty on processing power left on the Atmega, The demand on the flash and data RAM would probably require an ATMega328 chip.

The USB Host shield has an MAX3421e "semi intelligent" device for the USB interface and communicates over SPI. The actual USB host code is on the Arduino.

The shield can be built with double ended headers to stack with other shields. It uses Digital pins 7 through 13 for the SPI and control, so only one USB host shield can be added.

Multiple game controllers could be handled as multiple bluetooth devices on the same USB dongle, but again would need a 328 or better.

The code also works on the AVR32 board from randommatt, which has a built in USB host port ( and 60 mips and oodles of memory) . The code would also be easy to port to something like the low cost AVRKey using LUFA, which also has a built in USB Host port.

The PS3 controller has 3 axis accelerometers and one Z Gyro. The Wiimote has 3 axis accelerometers as standard, the nunchuck adds 3 more accelerometers in your other hand, and the wiimotion+ adds 3 Gyros. Response is really good, much better than using a PC between the controllers and the Arduino.

Thanks,
Richard
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by Gort » Wed Dec 30, 2009 5:28 pm

Post by Gort
Wed Dec 30, 2009 5:28 pm

How about connecting the PS3 controller to the Arduino through a BlueSmirf bluetooth modem? I will start looking into that!
How about connecting the PS3 controller to the Arduino through a BlueSmirf bluetooth modem? I will start looking into that!
Gort offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 555
Joined: Wed May 31, 2006 1:00 am
Location: KC, MO, USA

Post by i-Bot » Wed Dec 30, 2009 10:09 pm

Post by i-Bot
Wed Dec 30, 2009 10:09 pm

The PS3 controller and the Wiimote use Bluetooth HID profile, which is not available on the Bluesmirf and most other common bluetooth modules which only support the serial port profile. There are a few Bluetooth modules which are HCI interface, but you will need to use a Bluetooth HCI and L2CAP stack over a special UART interface.
The PS3 controller and the Wiimote use Bluetooth HID profile, which is not available on the Bluesmirf and most other common bluetooth modules which only support the serial port profile. There are a few Bluetooth modules which are HCI interface, but you will need to use a Bluetooth HCI and L2CAP stack over a special UART interface.
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by PedroR » Thu Dec 31, 2009 12:36 pm

Post by PedroR
Thu Dec 31, 2009 12:36 pm

To answer Gort's Question, I think the really cool thing would be to find a PS2 controller that was connected to a reprogrammable Processor that used bluetooth over SPP and/or Xbee.

A combination of, for example, a PS2 controller + PCB with an ATMEGA and a socket for a PARANI ESD200 and/or an Xbee module would be great.
If the ATMEGA had an Arduino bootloader it would even be better.

I think this would be quite a general purpose approach for many robots: you could program it for Robobuilder, for Robonova, for Bioloid and an endless number of other options.


There are many similar things around (including the solution from Robobuilder) but unfortunately they are not reprogrammable which locks you to a proprietary solution.

Although this is not the High End approach iBot has been showing us above (which is VERY nice) it would be something accessible to wide range of users and hobbyists.
To answer Gort's Question, I think the really cool thing would be to find a PS2 controller that was connected to a reprogrammable Processor that used bluetooth over SPP and/or Xbee.

A combination of, for example, a PS2 controller + PCB with an ATMEGA and a socket for a PARANI ESD200 and/or an Xbee module would be great.
If the ATMEGA had an Arduino bootloader it would even be better.

I think this would be quite a general purpose approach for many robots: you could program it for Robobuilder, for Robonova, for Bioloid and an endless number of other options.


There are many similar things around (including the solution from Robobuilder) but unfortunately they are not reprogrammable which locks you to a proprietary solution.

Although this is not the High End approach iBot has been showing us above (which is VERY nice) it would be something accessible to wide range of users and hobbyists.
PedroR offline
Savvy Roboteer
Savvy Roboteer
Posts: 1199
Joined: Mon Jun 16, 2008 11:07 pm

Post by i-Bot » Thu Dec 31, 2009 9:19 pm

Post by i-Bot
Thu Dec 31, 2009 9:19 pm

The PS2 Game Controller is readily avaliable in wireless form from Madcatz and Logitech. Interfaces are available for Kondo, Robonova, Bioloid, and Robobuilder. These each use the easiest interface ( serial, IR port, Dynamixel bus), and keep the PC connection avaliable for other use ( download). For the Robonova and Robobuilder, they are open source, same board, reprogrammable, and low cost.

The aim for the PS3 and Wiimote was to make available the new features such as accelerometer, gyro, and IR camera. Since both of these controllers again are wireless(bluetooth) by design, it seems sensible to exploit this. Previous solutions using PC proxy are OK, but high overhead, and I find them rather unresponsive by comparison. Boards like Gumstix or Roboard are great, but fairly expensive.

The AVR32 and the AT90USB processors with integrated USB host are under $10 and the USB dongles are now around £3. They have bullt in USB bootloaders and free development and library software.

I choose to support the Arduino platform because the value of the new PS3 and Wiimote features appeared higher to that community ( and the challenge of 1K RAM !), but physically smaller versions are possible, and easily compatible with existing robot controllers. Using the AVR32 controller from RandomMatt, if have the PS3 game controller as a dynamixel bus device, using free libraries and RTOS.

Welcome to the new decade, this is the new "low end" !
The PS2 Game Controller is readily avaliable in wireless form from Madcatz and Logitech. Interfaces are available for Kondo, Robonova, Bioloid, and Robobuilder. These each use the easiest interface ( serial, IR port, Dynamixel bus), and keep the PC connection avaliable for other use ( download). For the Robonova and Robobuilder, they are open source, same board, reprogrammable, and low cost.

The aim for the PS3 and Wiimote was to make available the new features such as accelerometer, gyro, and IR camera. Since both of these controllers again are wireless(bluetooth) by design, it seems sensible to exploit this. Previous solutions using PC proxy are OK, but high overhead, and I find them rather unresponsive by comparison. Boards like Gumstix or Roboard are great, but fairly expensive.

The AVR32 and the AT90USB processors with integrated USB host are under $10 and the USB dongles are now around £3. They have bullt in USB bootloaders and free development and library software.

I choose to support the Arduino platform because the value of the new PS3 and Wiimote features appeared higher to that community ( and the challenge of 1K RAM !), but physically smaller versions are possible, and easily compatible with existing robot controllers. Using the AVR32 controller from RandomMatt, if have the PS3 game controller as a dynamixel bus device, using free libraries and RTOS.

Welcome to the new decade, this is the new "low end" !
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by NovaOne » Fri Jan 01, 2010 5:55 pm

Post by NovaOne
Fri Jan 01, 2010 5:55 pm

:shock: Wow :!:

Thank you i-Bot, you are a star :!: :!: :!:
:shock: Wow :!:

Thank you i-Bot, you are a star :!: :!: :!:
NovaOne offline
Savvy Roboteer
Savvy Roboteer
Posts: 405
Joined: Thu Jul 05, 2007 7:30 am

Post by Gort » Sat Jan 02, 2010 2:23 am

Post by Gort
Sat Jan 02, 2010 2:23 am

I am liking this idea more and more! Do you have to use the USB Host shield or can you use the USB port that already exists on the Arduino?
I am liking this idea more and more! Do you have to use the USB Host shield or can you use the USB port that already exists on the Arduino?
Gort offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 555
Joined: Wed May 31, 2006 1:00 am
Location: KC, MO, USA

Post by NovaOne » Sat Jan 02, 2010 9:03 am

Post by NovaOne
Sat Jan 02, 2010 9:03 am

Hi Gort,
can you use the USB port that already exists on the Arduino?


The port on the Arduino is an FTDI USB to TTL serial converter; a Client device, designed to be "managed" by a Host..usually a PC, which will see the device as an additional comm. port.

The USB host sheild uses the MAX3421E USB peripheral/host controller., which is designed to "manage" USB Client devices.

Because of the speed and complexity of the USB protocol, hosting a USB device carries with it a processing burden, which is best handled by the dedicated device eg MAX3421 working with another processor in this case the Aduino Atmega chip, to perform the necessay enumeration and control transfers.
Hi Gort,
can you use the USB port that already exists on the Arduino?


The port on the Arduino is an FTDI USB to TTL serial converter; a Client device, designed to be "managed" by a Host..usually a PC, which will see the device as an additional comm. port.

The USB host sheild uses the MAX3421E USB peripheral/host controller., which is designed to "manage" USB Client devices.

Because of the speed and complexity of the USB protocol, hosting a USB device carries with it a processing burden, which is best handled by the dedicated device eg MAX3421 working with another processor in this case the Aduino Atmega chip, to perform the necessay enumeration and control transfers.
NovaOne offline
Savvy Roboteer
Savvy Roboteer
Posts: 405
Joined: Thu Jul 05, 2007 7:30 am

Post by i-Bot » Sat Jan 02, 2010 11:23 am

Post by i-Bot
Sat Jan 02, 2010 11:23 am

I think the AVR32 or the AT90USBKEY are probably better for robotics. I did the Arduino version to try to get the game controllers into the hands of some of the talented folks who are more into the "arty" and imagineering aspects. I am trying to finish some articles describing this in more detail.

The AVR32 has USB host and device integrated, and a free USB stack, 32 bits, 60 MIPS, 256K Flash ...(AT32UC3B0256).

The AT90USBKEY board uses a AT90USB1287 and costs about $30. It is an ATMega128 with USB host and device, a free USB stack (LUFA) is available.
I think the AVR32 or the AT90USBKEY are probably better for robotics. I did the Arduino version to try to get the game controllers into the hands of some of the talented folks who are more into the "arty" and imagineering aspects. I am trying to finish some articles describing this in more detail.

The AVR32 has USB host and device integrated, and a free USB stack, 32 bits, 60 MIPS, 256K Flash ...(AT32UC3B0256).

The AT90USBKEY board uses a AT90USB1287 and costs about $30. It is an ATMega128 with USB host and device, a free USB stack (LUFA) is available.
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by Gort » Tue Jan 05, 2010 2:53 am

Post by Gort
Tue Jan 05, 2010 2:53 am

I like working with the Arduino so I am going to order a USB shield and buy a madcatz controller. I am also very intereted in what you are doing with the AVR32 and the AT90USBKEY. Where can I buy these boards in the US?
I like working with the Arduino so I am going to order a USB shield and buy a madcatz controller. I am also very intereted in what you are doing with the AVR32 and the AT90USBKEY. Where can I buy these boards in the US?
Gort offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 555
Joined: Wed May 31, 2006 1:00 am
Location: KC, MO, USA

Post by billyzelsnack » Tue Jan 05, 2010 5:43 am

Post by billyzelsnack
Tue Jan 05, 2010 5:43 am

http://fletchtronics.net/bumble-b is an inexpensive source for something similar to the AT90USBKEY.

Also similar.. The teensy. I've been using it lately and I really like it.
http://www.pjrc.com/teensy/
http://fletchtronics.net/bumble-b is an inexpensive source for something similar to the AT90USBKEY.

Also similar.. The teensy. I've been using it lately and I really like it.
http://www.pjrc.com/teensy/
billyzelsnack offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by i-Bot » Tue Jan 05, 2010 11:46 am

Post by i-Bot
Tue Jan 05, 2010 11:46 am

The bumble-b and the Teensy are nice, but do not have USB Host capability. The Teensy++ uses the AT90USB1286 and not the AT90USB1287 which is the host version.

The AT90USBKEY is available from Digikey($30) and others. For AVR32, I use the board from RandomMatt, though the EVK1101 is also possible, others will likely be available soon.
The bumble-b and the Teensy are nice, but do not have USB Host capability. The Teensy++ uses the AT90USB1286 and not the AT90USB1287 which is the host version.

The AT90USBKEY is available from Digikey($30) and others. For AVR32, I use the board from RandomMatt, though the EVK1101 is also possible, others will likely be available soon.
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by Chillance » Fri Apr 16, 2010 11:46 pm

Post by Chillance
Fri Apr 16, 2010 11:46 pm

Well, I just had to post about this: http://forums.adafruit.com/viewtopic.ph ... 60&start=0 because I came over this forum doing the research for my project there... And maybe anyone here have some superb input about it all?

Thanks!
Well, I just had to post about this: http://forums.adafruit.com/viewtopic.ph ... 60&start=0 because I came over this forum doing the research for my project there... And maybe anyone here have some superb input about it all?

Thanks!
Chillance offline
Newbie
Newbie
Posts: 1
Joined: Fri Apr 16, 2010 11:43 pm

Next
Next
20 postsPage 1 of 21, 2
20 postsPage 1 of 21, 2
cron