Induino Blog Overview - List of Contents (For Easy Navigation!!!)


  1. InduinoX - An Overview   
  2. Simple Labs' InduinoX and Arduino Uno Comparison
  3. InduinoX - Getting Started Guide
  4. InduinoX User Guide - Building a 3-Bit Binary Counter
  5. InduinoX User Guide - Programming the Push Buttons
  6. InduinoX User Guide - Programming the RGB LED
  7. InduinoX User Guide - Programming the LDR
  8. InduinoX User Guide - Working with RTC DS1307
  9. InduinoX User Guide - Working with TSOP IR Receiver - Part 1
  10. InduinoX User Guide - Working with TSOP IR Receiver - Part 2
  11. InduinoX User Guide - Working with the IR LED
  12. InduinoX User Guide - Programming the Arduino Booloader
  13. InduinoX User Guide - Interfacing with the InduinoX LCD Shield
  14. InduinoX User Guide - Interfacing with the Wireless Shield / BTBee
  15. InduinoX User Guide - Interfacing with the Motomama Motor Driver Shield
  16. InduinoX User Guide - Interfacing with the ENC28J60 Ethernet Shield

InduinoX User Guide - Interfacing with the Wireless Shield / BTBee

Bluetooth control seems to be the In-Thing! hook up your InduinoX with your Android phone over Bluetooth and zap you go... With a little bit of Android Expertise, you can double the potential of your Arduino Projects.



So How does one hook up the InduinoX over Bluetooth?

For this, we are going to use and Xbee shield and a Bluetooth Module - BTBee

The Xbee shield is a low cost arduino shield for plugging in any device with the XBee foot print. The shield offers the flexibility of using any of the digital pins for Rx/Tx through a jumper setting mechanism. In our case, we will stick to use the default Rx/Tx pins of the InduinoX. For those of you willing to explore further, check out Software Serial using arduino.

The BTBee is a low cost serial bluetooth module with the same footprint as an Xbee. The BTBee has 2 LEDS a Red led for Power and a Green led for status indication. The Green led will be constantly blinking till the device is paired. Beware! the BTBee has a lot of dummy pins just to match the XBee footprint. In effect, it uses only 5 pins


Pin  Description
1 VCC  Power supply
2 TX  Data output
3 RX  Data input
5 Reset reset
10 GND  Ground

Place the BTBee on the Xbee shield as shown in the video. Upload the following test program onto the InduinoX and then place the shield on top of the InduinoX board. Remember place the Xbee shield only after uploading the program as otherwise you might face an error. (Since we use serial communication for programming, if there are other devices attached to the default serial port, programming the microcontroller will throw up an error.)

The test program expects a serial character 'A' to turn ON the led on the 13th pin and another character 'B' to turn it OFF.

Next Download the following App for your android phone BlueTerm

The BlueTerm App is a terminal app for Android that can simulate a Serial Terminal over Bluetooth.

Power your InduinoX (you can use USB power), turn on Bluetooth on your phone and scan for devices. If this is the first time you are pairing with the BTBee module you will see a set of numbers (the device id) try to pair with this using the code '1234' once it is paired, it will show up as 'linvor'. Now open the app and connect to linvor. Once connected, the app will show a message as connected and the Green led on the BTBee will stop blinking and remain stable (ON) Now type in the characters and get control of the LED on the InduinoX!

Here's the sample code. Make fun with Bluetooth!

 void setup()  
 {  
  Serial.begin(9600);  
  pinMode(13,OUTPUT);  
 }  
 void loop()  
 {  
  if(Serial.available())  
  {  
   int val = Serial.read();  
   if(val == 65)  
   digitalWrite(13,HIGH);  
   if(val==66)  
   digitalWrite(13,LOW);  
   Serial.println(val);  
  }  
 }  

InduinoX User Guide - Interfacing with the LCD Shield

The LCD Shield eases the process of interfacing a LCD display with the Arduino. The shield fits on top of any Arduino and takes power from the Arduino. 


How to place the Shield on top of an Arduino?
The shield has one of set 8 pins and 1 set of 6 Pins. The trimpot on the shield is on the top left side. Now place the shield onto your arduino such that the eight pins are placed on top of pins 8,9,10,11,12,13,gnd & aref and the six pins are placed on top of pins Vin, gnd, gnd, +5V, +3.3V & reset


The LCD shield is designed to work with 16 pin LCDs with the following pin configuration.





LCD Pin Mappings for the Shield
The LCD shields provides a 4-bit mode interface to the Arduino. The Pins are connected as follows.
RS => 8
E => 9
D4 =>10
D5 =>11
D6 =>12
D7 =>13

You can run the Hello World Example under File->Examples->LiquidCrystal->Hello World, with the following changes
replace this line
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
with
LiquidCrystal lcd(8,9,10,11,12,13);



Character LCD - A Quick Overview
Here's an interesting Write up to get you understanding the working of the LCD
http://joshuagalloway.com/lcd.html

InduinoX - Getting Started Guide


InduinoX Getting Started – For Windows XP / Windows 7


  1. Download the latest version of Arduino for Windows from here => http://arduino.cc/en/Main/Software
  2. Unzip the downloaded file and remember its location
  3. Connect the InduinoX board to your PC using the usb cable provided. You should see the power (red) led go on on the InduinoX board.
  4. Windows will detect a new usb device. Ignore any options to install drivers and Do not let windows install any drivers automatically.
  5. Open windows device manager
You can open windows device manager by right clicking on 'My Computer' and choosing Properties. In the new Window, Click on Device Manager [In Windows XP, this can be found under 'Hardware Tab' of the Properties Window]
  1. Now Scroll Down the List of Devices in the Device Manager till you come to a Device 'FT232R USB UART'. You should see a warning icon next to it as the drives have not been installed. Right Click on this Device and Choose 'Update Driver Software...' option.
  1. Now, Windows will provide you two options, Choose the one that says “Locate and install drivers manually from a specific Location.”
  1. In the next screen, you will see a browse button, click on the button and browse to the location of the drivers folder[You will find the drivers folder inside the unzipped arduino folder] and then click 'OK'. Then Click 'Next'
  1. Now, Windows might throw a Security  warning, ignore it and click on next.
  1. The Device will be installed as a USB Serial Converter
  1. Now Windows will detect a USB Serial Port and ask you for drivers. Follow the exact same process as we did earlier, choosing the same driver location as earlier.
In case Windows doesn't ask you, scroll through the Device manager and find the listing called 'USB Serial Port' and follow the above steps.
  1. Once everything is finished, You should be able to see a new device 'USB Serial Port (COMXX)'. Make a note of this Number.

  2. Now go the unzipped Arduino folder and run the arduino.exe file
  3. The Arduino IDE will open up
  4. In the Arduino IDE open the blink example program by clicking on it from under File -> Examples -> Basics
  5. Now select the board by going to Tools -> Boards -> and selecting 'Arduino Diecimila or Arduino Duemilanove w/ Atmega168'
    If you have one our recent board InduinoX with ATmega328, Select Arduino UNO as the board

  6. Now select the Serial Port by going to Tools -> Serial Port -> and selecting the 'COM port that was earlier shown in the device manager'

  7. Now Click on the Upload button. In a moment, you should see 2 LEDs Rx & Tx blink on your InduinoX indicating the program being uploaded. Once the program is uploaded, you will see the White LED[13th Pin] on the InduinoX Blink
Thats it! We are Done!

InduinoX User Guide - Working with the IR LED

The IR Led is a unique idea we had when designing the InduinoX board. We thought if we can put bot the IR LED and TSOP side by side and make 2 boards face each other, we can build a simple basic IR based 2 way wireless communication system. In this edition, we will see how to generate sony signals on the IR led

The IR led is connected to PIN 14 (analog 0) of the InduinoX.

Understanding Frequency
The Sony SIRC protocol works at 40Khz...most remote controls work at their specific frequencies. TV remotes in India are generally between 32- 40Khz frequecny.

So whats this frequency all about?
40KHz means 40,000 Cycles in 1 second. Each Cycle represents a ON signal followed by a OFF signal. The signals could be of equal duration.

Heres another image of the Sony signals









If you look at the image, you can see the the 1.2ms high of the Logical '1' has further black lines with spaces in between. These correspond to the ON/OFF cycles. The space between these is what is called the frequency. The frequency of occurrence of a ON/OFF cycle is what it means.

So How do we generate it?
Lets do some calculation,
40,000 Cycles in 1 Sec or 1000 millisec or 1000 x 1000 microseconds
so each cycle if for a duration of 25microseconds.

We can produce this frequency if we can make a pin go high for 13 microseconds followed by low for 12 microseconds.

If we can do this for 2.4 milliseconds then we can generate a Startbit, if we can do this for 1.2 milliseconds then we can generate a Logical '1', and for 0.6 milliseconds, we can generate a Logical '0'.

Now that we know that each cycle will take 25 microseconds lets calcualte the number of cycles required for generating the 2.4 milliseconds start bit
2.4 milliseconds / 25microseconds => 2400 microseconds / 25microseconds => 96 cycles
1.2 milliseconds / 25microseconds => 1200 microseconds / 25microseconds => 48 cycles
0.6 milliseconds / 25microseconds => 600 microseconds / 25microseconds => 24 cycles

the delayMicroseconds() function of arduino can help us required delay in microseconds. So lets first create a pulse function.
 void pulseData(int no_of_cycles)  
 {  
  for(int i=0;i<no_of_cycles;i++)      
  {  
   digitalWrite(14,HIGH);  
   delayMicroseconds(13);  
   digitalWrite(14,LOW);  
   delayMicroseconds(12);  
  }  
  digitalWrite(14,LOW);  
  delayMicroseconds(600);// This delay is for the space between the signals 0.6 millseconds  
 }  
Now we have a function that can generate 40Khz signal cycles for a specified number of cycles.

Next we need a function that will convert a decimal value to binary, evaluate each bit and then call signal generation function accordingly.

Heres a function that takes any decimal value (upto 12 bits), converts it to binary and transmits the same.
 void dec_to_bin_transmit(int val)  
 {  
  int cnt = 0;  
  pulseData(96); // Sending the Startbit  
  while(cnt<12) // Execute this 12 times to send 12 bits of data  
  {  
  if(val>0) // Checking if the decimal value is non-zero  
  {  
   if(val%2 == 0) // Binary reminder check, if reminder is 1 then we need to send a logical '1'  
   {  
    pulseData(24);  
   }  
   else// Binary reminder check, if reminder is not 1 then we need to send a logical '0'  
   {  
    pulseData(48);  
   }  
   val = val / 2;  
  }  
  else // when the decimal value becomes zero, start sending zeroes for the remaining bits  
  {  
   pulseData(24);  
  }  
  cnt++;  
  }  
 }  
Note: This function is not optimal ;) there might be data loss. We will leave it to you to figure out how to optimise it.

Here's a simple program where the IR led transmits values from 0 to 1023. It transmits each value thrice.

 void setup()  
 {  
  pinMode(14,OUTPUT);  
 }  
 void loop()  
 {  
  for(int count=0; count<1023; count++)  
  {  
   for( int j=0;j<3;j++)  
   {  
   dec_to_bin_transmit(count);  
   delay(50);  
   }  
   delay(500);  
  }  
 }  
 void dec_to_bin_transmit(int val)  
 {  
  int cnt = 0;  
  pulseData(96); // Sending the Startbit  
  while(cnt<12) // Execute this 12 times to send 12 bits of data  
  {  
  if(val>0) // Checking if the decimal value is non-zero  
  {  
   if(val%2 == 0) // Binary reminder check, if reminder is 1 then we need to send a logical '1'  
   {  
    pulseData(24);  
   }  
   else// Binary reminder check, if reminder is not 1 then we need to send a logical '0'  
   {  
    pulseData(48);  
   }  
   val = val / 2;  
  }  
  else // when the decimal value becomes zero, start sending zeroes for the remaining bits  
  {  
   pulseData(24);  
  }  
  cnt++;  
  }  
 }  
 void pulseData(int no_of_cycles)  
 {  
  for(int i=0;i<no_of_cycles;i++)      
  {  
   digitalWrite(14,HIGH);  
   delayMicroseconds(13);  
   digitalWrite(14,LOW);  
   delayMicroseconds(12);  
  }  
  digitalWrite(14,LOW);  
  delayMicroseconds(600);// This delay is for the space between the signals 0.6 millseconds  
 }