Play videos on iPod

This is my second project that I think and Arduino would work for. It is a game that will last 1 minute while they try and put as many pieces as they can on the game board. At the end of a minute I would like to be able to show them how many they got on and have the pieces fall off.

Here is how I think I can get it to work and don't know if Arduino is possible of doing it. When the player pushes the start button the Arduino will turn on a bunch of electromagnets and send a command to an iPod touch to play a video on a screen that shows the countdown. Each piece will have a spot that it goes in to that has an electromagnet in the center. The piece will also have a magnet on it that will hopefully pull it tight enough to the board (the board is standing up vertical) that it will close a switch. At the end of the minute depending on how many switches are closed will play a video with that number on it for 5-10 seconds. At the end of 5-10 seconds the elector magnets will reverse polarity pushing all the pieces off the board.

What do you think possible?

Things I don't know,

Can the Arduino run a program that is timed?
Can it play individual video files on an iPod?
Is there a better device to play the video files from?
Any other ideas?

Can the Arduino run a program that is timed?

Yes

Can it play individual video files on an iPod?

I am not sure but probably not without writing some sort of app on the iPod and that is a whole other matter.

Is there a better device to play the video files from?

I would say a laptop running Processing would be best.

At the end of 5-10 seconds the elector magnets will reverse polarity pushing all the pieces off the board.

I think getting that right will be the hard bit.

I could be wrong but I don't think you need to play a video. Why not just use a countdown display that will easily interface with an Arduino?

If you do need to play a video why not use a small screen for the Arduino?

Best of Luck!

After some research I found that I can control the magnets like a motor using a motor shield and I can swap the polarities.

lefthockey:
Can it play individual video files on an iPod?

Yes, and it's not too difficult, thanks to this lovely cable:

Essentially it gives you an RS232 connection to the Apple device, remember you need a RS232 <-> TTL converter.

Then on your Mac, download XCode, and you can create an app containing some code like:

...
-(void) readBytesAvailable:(UInt32)length
{
  [rscMgr read:rxBuffer length:1];
  if(rxBuffer[0] == 1)
  {
    videoPlayer.contentURL = [NSURL fileURLWithPath:@"video1.mov"];
  } 
  else if(rxBuffer[0] == 2)
  {
    videoPlayer.contentURL = [NSURL fileURLWithPath:@"video2.mov"];
  }
  ...
  [videoPlayer play];
}

Then I got this adapter to keep the device charged:

Let me know if you need any other help on the Objective-C or the Arduino side.

sonnyyu:
Step 1. Iphone/ Ipod via serial port you need root access right - jailbreak
check here to make sure if it is legal or not at your country.

iOS jailbreaking - Wikipedia

Step 2. Tech detail

http://devdot.wikispaces.com/Iphone+Serial+Port+Tutorial

Step 3. Cable

iPod Connector Male Style 1

iPod Connector Male Style 1 - DEV-00633 - SparkFun Electronics

or

PodBreakout

https://www.sparkfun.com/products/8295

Step 4.

Logic Level Converter

https://www.sparkfun.com/products/8745

The iphone/ipod/ipad is 3.3v TTL for connecting 5.0v TTL Arduino you must need Logic Level Converter, otherwise idevice got fried!

The show is back to drewmutt. :stuck_out_tongue:

FWIW, with the Redpark cable, you don't need to jailbreak. And in looking at the Redpark site, they have a cable that has the Logic Level Converter built in!

Also, it should be noted that the Redpark cables need to connected to an iPhone 4S, an iPod 4, or a 3rd gen iPad or any earlier version. The newer devices use the new Apple lightning connector as opposed to the older 30-pin connector. Given that Apple put an authentication chip in the new cable, it seems unlikely that a lightning connector version of the Redpark cable will be coming out anytime soon.

More info:

It's possible that the lightning->30-pin adapter from apple could be used, but I haven't played with it.

Also, the quoted forum has a good point that you can also do this wirelessly over wifi.

Apple killed kernel debugging as we currently know it, as the lightning connector lacks UART pins.

https://twitter.com/badeip/status/294738444813467649

A: Our existing cables work with the Lightning to 30-pin adapters that Apple provides. We will also release a serial cables with Lightning connector -- probably in mid-June 2013. Moving new products through Apple's approval processes takes some time.

http://www.redpark.com/c2db9_FAQs.html

Apple' s own Lightning to 30-pin adapter recover UART pins? Some Apple Lightning Adapter has a SoC CPU, the member here who has X-ray machine might be able to help confirm if it is the case.

In 30-pin connector era, the iOS device recognize the type of peripheral by measuring electric resistance between two of the 30 pins. This limited the total amount of peripheral types, and Apple will need to maintain a registration table and run certification program for each peripheral, both software and hardware wise. It’s not a easy procedure for both ends.

And now, it’s pure software issue. The Lightning is pure high-speed digital serial interface; all the controls regarding to the port configuration are encapsulated in API calls, and the functions of the ports can be electrically wired to different logic blocks of the main board with software controlled multiplexer, in semi-conductor level. And that means the serial interface is not even necessarily running USB protocol: it can be UART, I2C, or DMA. This concept is nothing new. In microcontroller-based application design we called it “USCI”, the Universal Serial Communication Interface. It’s a common approach to provide flexibility in circuit design when the package and pin-outs are limited.

In short, the pins in 30-pin connector are fixed function, and Apple have to control both hardware and software of a peripheral. But the pins in Lightning are flexible. The I/O ports are be configured to be dominated by user application, or physically wired to different logic blocks within the system, and Apple can achieve the same level of control with software only. I won’t call it “innovation” of other BS, but it’s a compromise design in favor of engineering.

I knew Redpark cable exist for age, but I thought they mark the price wrong, the correct one should be for $59 buy 1 for additional 100 pieces free, this will be to match Hong Kong - Shenzhen "standard" price. $)

Well, I'll be. Just announced today, lightning Redpark serial cable.

http://www.redpark.com/L2db9v.html