StarBoard Orange : "Application example No.3 : Drive a CHORO Q with wii nunchuck!"

Languages

日本語版はこちら : ☆ボードオレンジ:「活用事例3:wiiヌンチャクを使ってチョロQを運転しよう!」

Ovewview

I implemented IR receiver at StarBoardOrangeExample2

It's really good solution for control devices.

I can control devices with IR remote controller if the library can tranmit signals.

There are many IR remote devices in our house. TV, Audio, Room light ...

In this document I'll show you control a IR device using IR tranmitter library.

Setup

Necessary parts

  1. StarBoard Orange
  2. mbed NXP LPC1768
  3. IR LED (OSI5FU5111C-40)
  4. Transistor (2SC2883 or 2SC2120)
  5. wiiChuck adaptor (SparkFun)

Environments

  1. Wii Nunchuk Controller
  2. CHORO Q HYBRID

Programs

Import following program to your compiler.

StarBoardOrangeExample3

Equipments

IR transmitter circuits

Check a data sheets for your IR LED.

I used OSI5FU5111C-40.

The absolute maximum rating of the DC forward current is 100[mA] (DC).

The pulse forward current is 1000[mA] (Pulse, width<=100us, duty<=1/100).

I should check a specification of a transistor.

The collector maximum current of 2SC2883 is 1.5[A].

This is the transmitter circuits.

PWMOUT use p21 on mbed.

I mounted the circuit on a universal board.

The transistor is SMD.

The implementation is Quick and dirty. It's OK. Not a product.

Wii Nunchuk Controller

wiiChunk adapter is good for Wii nunchuk controller.

I bought the adapter from SWITCH SCIENCE in Japan.

The connection map is here.

mbed Adapter
GND -
+3.3V +
I2C SDA (p9) d
I2C SCL (p10) c

Please check the connection by following picture.

The circuits overview

This is the circuits overview.

Start the program

Compile the program and copy it to your mbed.

Operations

It's really easy to drive.

Example movie

How to use the library

TransmitterIR class

Create TransmitterIR instance in your program. The instance need a pin name for IR transmitter.

#include "TransmitterIR.h"

TransmitterIR ir_tx(p21);

And check the state with getState(), if the state indicate TransmitterIR::Idle than you can write a data for transmit.

RemoteIR::Format format = RemoteIR::SONY;
uint8_t buf[] = { 0x80, 0x00 };
int bitcount = 12;
if (ir_tx.getState() == TransmitterIR::Idle) {
    bitcount = ir_tx.setData(format, buf, bitcount);
}

'format' is for a transmit protocol type. The last argument of setData is bit length of the data.

This is very simple way to transmit IR signal.

Summary

  • You can control IR devices with a IR LED.
  • This solution provides CHORO Q HYBRID driving from a distance.
  • The classes for IR remote transmitter can re-use in your applications.

References

Basic information

Application examples

Related documents

Update history

Version Date Description
1.0.0 2010/08/23 First version.
1.0.1 2010/08/27 Bug fixed in IR transmitter circuits.
1.0.2
2010/09/10
Update a application example.
1.0.3 2010/09/25 Translated.
- - -
- - -
- - -
- - -
- - -


1 comment

29 Apr 2011

Can you just read the values from the mbed and use them for a robot that is controlrd by the mbed?

I can't seem to read the nunchuck values , is this becaus I use a wireless nunchuck?

plz help

You need to log in to post a comment