Thursday, May 24, 2012

One PIC Microcontroller Platform Development Board



One PIC Microcontroller Platform Development Board
 
Develop firmware using Microchip's 8/16/32-bit PIC® Microcontrollers all on one board!
Each device comes preprogrammed with firmware to operate the LCD, LED and capacitive touch pads. In addition to three PIC® Microcontrollers, this board also has a dedicated Real-Time Calendar Clock circuit and is able to run from a single AAA Ultimate Lithium battery.

Feature
PIC Microcontrollers
PIC16LF1939-I/PT
PIC24FJ256GA106-I/PT
PIC32MX795F512L-80I/PT
Capacitive Touch Pads
Segmented LCD

Colored LEDs
Single Cell Battery Supply
MCP1640T-I/CH
Real-Time Calendar Clock
1 MCP79410-I/S
PICkit™ 3 Connector
PICtail™ Board Connector

System Requirements:

Software:

·        MPLABX  V1.00
·        .NET Framework v2.0 or later (required for 8bit IR Demo GUI)
·        MCP2200 & SimpleIO-M.dll (required for 8bit IR Demo GUI)

Drivers:

·        MCP2200  (Downloaded)
·        ZENA Wireless Adapter (Provided)

Compilers ( use latest available versions):

·        PIC16 HI-TECH: (developed with v9.83)
·        PIC24 C30: (developed with v3.31)
·        PIC32 C32: (developed with v2.01)

Overview:

This demo board is populated with 8bit, 16bit, and 32bit PIC microcontrollers. Refer to the schematic of the board for more details.
8 bit MCU : PIC16LF1939
16 bit MCU: PIC24FJ256GA106
32 bit MCU: PIC32MX795F512L

OnePIC Demo Board

The demo code consists of:
1.     A “base” code which demonstrates the
a.      LCD
b.     LEDS
c.      mTouch
d.     Potentiometer
e.      Switch
2.     Three Wireless Demonstrations, one for each PIC
a.      8bit – Infrared
b.     16bit – RF4CE (Radio Frequency for Consumer Electronics)
c.      32bit – WiFi

The following document is intended as a walk-through guide to using the provided software.  Items will be presented in the order they might be presented during a demonstration of the OnePIC board.


Download Schematic

Thursday, February 16, 2012

Arduino control 8 devices via Android Bluetooth





Arduino control 8 devices via Android Bluetooth

























Hardware สำหรับ การสร้างอุปกรณ์ภาครับ
  จะใช้ Bluetooth Module และ Arduino Microcontroller Board และ Relay Output Board
Hardware อุปกรณ์ที่ใช้

  •           Serial Port Bluetooth Module( TTL )
  •           Arduino Microcontroller Board (ET-BASEAVR EASY328 ) Arduino Compatible Board
  •           8 channel Output Relay Board


Wiring Diagram การต่อสายใช้งาน

Output 1 to Pin 4 ( Arduino Board )
Output 2 to Pin 5
Output 3 to Pin 6
Output 4 to Pin 7
Output 5 to Pin 8
Output 6 to Pin 9
Output 7 to Pin 10
Output 8 to Pin 11

Bluetooth Module Tx to  Pin 0

Bluetooth Module Rx to  Pin 1

For Arduino Board



For ET-BASEAVR EASY328





Download Micro controller firmware


For Arduino Microcontroller Board Source code

#define LED_PIN1  4
#define LED_PIN2  5
#define LED_PIN3  6
#define LED_PIN4  7

#define LED_PIN5  8
#define LED_PIN6  9
#define LED_PIN7  10
#define LED_PIN8  11

int firstSensor = 0;         // first analog sensor
int secondSensor = 0;    // second analog sensor
int thirdSensor = 0;        // digital sensor
int inByte = 0;               // incoming serial byte
boolean status_unlock;
boolean status_bluetooth;

long interval = 1000;           // interval at which to blink (milliseconds)
long previousMillis = 0;        // will store last time LED was update
int minite,sec;


void setup()
{
  // start serial port at 9600 bps:
  Serial.begin(9600);
  //pinMode(2, INPUT);   // digital sensor is on digital pin 2
  //establishContact();    // send a byte to establish contact until receiver responds
 
  pinMode(LED_PIN1, OUTPUT);
  pinMode(LED_PIN2, OUTPUT);
  pinMode(LED_PIN3, OUTPUT);
  pinMode(LED_PIN4, OUTPUT);

  pinMode(LED_PIN5, OUTPUT);
  pinMode(LED_PIN6, OUTPUT);
  pinMode(LED_PIN7, OUTPUT);
  pinMode(LED_PIN8, OUTPUT);
 
  digitalWrite(LED_PIN1, LOW);  // switch off LED
  digitalWrite(LED_PIN2, LOW);  // switch off LED
  digitalWrite(LED_PIN3, LOW);  // switch off LED
  digitalWrite(LED_PIN4, LOW);  // switch off LED
   
  digitalWrite(LED_PIN5, LOW);  // switch off LED
  digitalWrite(LED_PIN6, LOW);  // switch off LED
  digitalWrite(LED_PIN7, LOW);  // switch off LED
  digitalWrite(LED_PIN8, LOW);  // switch off LED
 
  status_bluetooth = true;
  status_unlock = false;
  sec = 0;
}

void loop()
{
  if (Serial.available() > 0) {  
      
    inByte = Serial.read();                      // get incoming byte: 

    if(inByte == 'A'){   
      digitalWrite(LED_PIN1, HIGH);        // switch on LED
      Serial.print('A', BYTE);                    // send a char
      //delay(800);
      digitalWrite(LED_PIN1, LOW);        // switch off LED
      status_unlock = false;
      inByte = 0;    
    }
   
    if(inByte == 'a'){   
      digitalWrite(LED_PIN2, HIGH);        // switch on LED
      Serial.print('a', BYTE);                    // send a char
      //delay(800);
      digitalWrite(LED_PIN2, LOW);        // switch off LED
     
      status_unlock = true;
      sec = 0;
      inByte = 0;    
    }
   
    if(inByte == 'B'){   
      digitalWrite(LED_PIN3, HIGH);        // switch on LED
      Serial.print('B', BYTE);                    // send a char
      inByte = 0;    
    }
   
    if(inByte == 'b'){   
      digitalWrite(LED_PIN3, LOW);        // switch off LED
      Serial.print('b', BYTE);                   // send a char
      inByte = 0;    
    }
   
    if(inByte == 'C'){   
      digitalWrite(LED_PIN4, HIGH);        // switch on LED
      Serial.print('C', BYTE);                    // send a char
      inByte = 0;    
    }
   
    if(inByte == 'c'){   
      digitalWrite(LED_PIN4, LOW);        // switch off LED
      Serial.print('c', BYTE);                    // send a char
      inByte = 0;    
    }
   
    if(inByte == 'D'){   
      digitalWrite(LED_PIN5, HIGH);        // switch on LED
      Serial.print('D', BYTE);                    // send a char
      inByte = 0;    
    }
   
    if(inByte == 'd'){   
      digitalWrite(LED_PIN5, LOW);        // switch off LED
      Serial.print('d', BYTE);                   // send a char
      inByte = 0;    
    }
   
    if(inByte == 'E'){   
      digitalWrite(LED_PIN6, HIGH);        // switch on LED
      Serial.print('E', BYTE);                    // send a char
      inByte = 0;    
    }
   
    if(inByte == 'e'){   
      digitalWrite(LED_PIN6, LOW);        // switch off LED
      Serial.print('e', BYTE);                   // send a char
      inByte = 0;    
    }
   
    if(inByte == 'F'){   
      digitalWrite(LED_PIN7, HIGH);        // switch on LED
      Serial.print('F', BYTE);                    // send a char
      inByte = 0;    
    }
   
    if(inByte == 'f'){   
      digitalWrite(LED_PIN7, LOW);        // switch off LED
      Serial.print('f', BYTE);                    // send a char
      inByte = 0;    
    }
   
    if(inByte == 'G'){   
      digitalWrite(LED_PIN8, HIGH);        // switch on LED
      Serial.print('G', BYTE);                    // send a char
      inByte = 0;    
    }
   
    if(inByte == 'g'){   
      digitalWrite(LED_PIN8, LOW);        // switch off LED
      Serial.print('g', BYTE);                   // send a char
      inByte = 0;    
    }   
   
    if(inByte == 'S'){   
     
      Serial.print('S', BYTE);                  // send a char
      status_bluetooth = true;
      sec = 0;
         
    }   
  } // if(Serial
 
  /*
  unsigned long currentMillis = millis();
     
              if(currentMillis - previousMillis > interval) {           
                previousMillis = currentMillis;         // save the last time you blinked the LED
               
                sec++;
               
                if(status_unlock==true){
               
                  if(sec== 11){
               
                      digitalWrite(LED_PIN1, HIGH);        // switch on LED
               
                      delay(800);
                      digitalWrite(LED_PIN1, LOW);        // switch off LED
               
                      status_unlock = false;                 
                      sec = 0;
                  }
                }
                else sec = 0;               
               
              }
 
 */
   
} //Loop

void establishContact() {
  while (Serial.available() <= 0) {
    Serial.print('.', BYTE);                   // send a capital A
    delay(500);
  }
}










Android Bluetooth Control Device

 
Android Bluetooth Control Device Application is to allow you to control various electrical devices up to eight devices and independently controlled.
Use Android Bluetooth mobile device to  remote control your device with Bluetooth Receiver hardware Device.
เป็น Application ที่ทำให้คุณสามารถควบคุมอุปกรณ์ไฟฟ้าต่างๆได้ ถึง 8 อุปกรณ์โดย แยกควบคุมกันได้อย่างอิสระ
ผ่านระบบ Bluetooth ของเครื่องโทรศัพท์มือถือ Android เป็นตัว Remote Control ไปยังอุปกรณ์ภาครับ ( Bluetooth Receiver Hardware Device )

The program features.
- control up to  8 devices.
- Can be set Timer to ON / OFF the device and show the time.(the timer can be set to 1 minute, 15 minutes, 30 minutes, 1 hour, 2 hours, 4 hours).
- Use with Receiving device (Bluetooth Receiver Hardware Device see below).
Design for the Android version 4 and a screen resolution of 480 x 800 (WVGA).
Freeware with AD (free software)


คุณสมบัติโปรแกรม
-          ควบคุมอุปกรณ์ได้ 8 อุปกรณ์
-          สามารถตั้งเวลา ปิด/เปิด แต่ละอุปกรณ์ได้ และแสดงเวลาการทำงาน และเวลาคงเหลือการตั้งเวลา 
(  (  เวลาที่สามารถตั้งได้ 1 นาที,15 นาที, 30 นาที, 1 ชั่วโมง ,2 ชั่วโมง , 4 ชั่วโมง ) 
-          ต้องใช้งานร่วมกับ อุปกรณ์ภาครับ ( Bluetooth Receiver Box )
ออกแบบ ค่าเริ่มต้น สำหรับ Android version 4 และ หน้าจอความละเอียด 480 x 800 ( WVGA )

A data transmission via Bluetooth. รูปแบบการส่งข้อมูลผ่าน Bluetooth
Device1 ON sent “A” , Device1 OFF sent “a”
Device2 ON sent “B” , Device2 OFF sent “b”
Device3 ON sent “C” , Device3 OFF sent “c”
Device4 ON sent “D” , Device4 OFF sent “d”
Device5 ON sent “E” , Device5 OFF sent “e”
Device6 ON sent “F” , Device6 OFF sent “f”
Device7 ON sent “G” , Device7 OFF sent “g”
Device8 ON sent “H” , Device8 OFF sent “h”


Wednesday, January 18, 2012

Arduino Microcontroller control Electromagnetic Door Lock





Arduino Microcontroller control Electromagnetic Door Lock with VB6

Microcontroller Board


















Technical Data
  • Microcontroller: ATMega328
  • Main Crystal: 19.66MHz
  • Speed: up to 16 MIPS
  • Processor Language: AVR
  • High Level Language: Arduino (C++) (Bootloader Installed)
 By ETT      Model ET-BASE AVR Easy328


Relay Control Board. 









Electromagnetic Door Lock ( Electric Bolt )














RS-232 9 Pin Cable ( Come from with Microcontroller Board )

USB to RS-232 Convertor ( if your PC or Notebook not have RS-232 Port )













Diagram




























VB code

Micro controller code

Thursday, November 24, 2011

Arduino Microcontroller control TCP/IP LAN Internet.



Arduino Microcontroller Board control device( LED ) via TCP/IP LAN Internet.
Now,we can make to control in 8 ch.







 Add Login to WebServer 






Arduino Microcontroller Board control device( LED ) via TCP/IP LAN Internet.

This project for test Arduino Microcontroller (ET-Base AVR Easy328 ) with TCP/IP Interface Board ( ET-MINI ENC28J60 ) to control device via TCP/IP, LAN and Internet.


In this VDO, present in Thai language.


Source code in C form http://www.nuelectronics.com


Friday, October 28, 2011

GLCD 128x64 with PIC18F4620





GLCD 128x64 with PIC18F4620 Testing 
This project is testing GLCD 128x64 with PIC18F4620 micro controller use CCS compiler.

Hardware
Microchip PIC18F4620 Microcontroller
LCD Graphic Displays/Modules
GRAPHIC LCD 128*64 DOT STN NEGATIVE BLUE WHITE LED BLACK LIGHT

Software
#include    <18F4620.h>

#define     TxD   PIN_C6
#define     RxD   PIN_C7
#device     ADC=10

#fuses      HS,NOWDT,NOPROTECT,NOLVP
#use        delay (clock = 20000000)
#use        rs232(baud = 9600, xmit = TxD, rcv = RxD, bits = 8)   // Port C
#define     Vbe      0.00488758        // Constant Parameter

#include    <include\font.c>
#include    <include\k0108.c>

//-----------------------------------------------------------------------------//
void init_io (void)
{

      setup_comparator(NC_NC_NC_NC);

      set_tris_a (0b00000011);   // ADC CH0, CH1
      set_tris_b (0b00000000);   //Port B = output
      set_tris_c (0b10000000);   //Port C = output
                                 /*
                                       RC6 = TxD
                                       RC7 = RxD
                                 */
}
//-----------------------------------------------------------------------------//
void main() {

      int16 value_adc1,value_adc2;

      float volt1, volt2;
      unsigned int bar1,bar2;
      char buf[24];
     
      init_io ();

      setup_adc_ports(ALL_ANALOG);
      setup_adc      (ADC_CLOCK_INTERNAL);

      printf ("\f\n\rSoftware Compile Date : ");
      printf (__DATE__); printf (" / ");
      printf (__TIME__);
      printf ("\n\rBy microcontrollerkits.blogspot.com/\n\n");

      while (1)
      {

         lcd ();
        
         while (1)
         {
              set_adc_channel(0); 
              value_adc1 = Read_ADC();
              volt1 = (Vbe * (float)value_adc1);
              delay_ms (100);
             
              set_adc_channel(1); 
              value_adc2 = Read_ADC();
              volt2 = (Vbe * (float)value_adc2);
              delay_ms (100);

           
              bar1 = (int8)(volt1*10);
              bar2 = (int8)(volt2*10);
              //send to RS232
              printf ("\rA/D(1) -> %1.2f Volt and A/D(2) -> %1.2f Volt",volt1,volt2);

              // Display on LCD
              lcd_gotoxy (0,6);
              lcd_progress_high (bar1,87);
              lcd_progress_high (bar2,104);
              lcd_gotoxy (0,5);
              sprintf (buf,"A/D(0) = %1.2f",volt1);
              lcd_putstring (buf);
             
              lcd_gotoxy (0,6);
              sprintf (buf,"A/D(1) = %1.2f",volt2);
              lcd_putstring (buf);
              delay_ms (100);
         };

      };

}

Saturday, October 8, 2011

IOIO Board for Android Control





IOIO Board for Android Control

Microcontroller can control device.Now Android Mobilephone can control also with IOIO Board.
The IOIO (yo-yo") is a board specially designed to work with your Android device (OS versions 1.5 and greater). The board provides robust connectivity to an Android device via a USB connection and is fully controllable from within an Android application using a simple and intuitive Java API - no embedded programming or external programmer will ever be needed!
So far, the devices proven to work are: G1, Nexus One, Nexus S, Motorola Droid X. If you get the IOIO working on your Android device, please let us know in the comments below, thanks!
The IOIO board contains a single MCU that acts as a USB host and interprets commands from an Android app. In addition, the IOIO can interact with peripheral devices in the same way as most MCUs. Digital Input/Output, PWM, Analog Input, I2C, SPI, and UART control can all be used with the IOIO. Code to control these interfaces is written in the same way as you write an Android app with the help of a simple to use app-level library. In other words, you can combine the awesome computing power, Internet/Bluetooth connectivity, touch screen, and a variety of sensors from your Android device with the ability to easily add peripheral devices to interact with the outside world. Also, using the IOIO does not require any hardware or software modifications to your Android device, thus preserving the warranty as well as making the functionality available to non-hackers.
If you are new to the IOIO or developing apps with Android, please use these resources to help get started:
For firmware upgrades, you can download the IOIO Manager app (see the QR code in the images to the right). See the IOIO Manager wiki for more information.
Also featured is a Programmer function, which lets you upgrade the bootloader of your IOIO using another IOIO as a programmer! See the IOIO Manager wiki for more information.

Specification Summary
  • Microcontroller PIC24FJ128DA106-I/PT (with USB OTG , USB Host Support)
  • 48 total I/O pins - all of which can function as digital inputs and outputs.
  • Up to 16 analog inputs (10-bit).
  • Up to 9 PWM outputs.
  • Up to 4 UART channels.
  • Up to 3 SPI channels.
  • Up to 3 TWI (I²C-compatible) channels.
  • On-board switch-mode regulator providing up to 1.5A of 5V supply. Can charge the Android device as well as power a couple of small motors. (Power Supply via USB cable from PC or Device)
  • Bootloader on the board pulls firmware off phone, enabling OTA firmware upgrades and application-specific firmware.
  • Pulse-width measurement, capacitance sensing and more (will be pushed with first OTA firmware upgrade).

Update: The IOIO now has beta firmware available which supports Google's Open Accessory (ADK) protocol. The code base can be found here.
Documents:

Introduction

This is the beginners guide for the IOIO for Android board and is intended for users that have never written an Android app. The goal of this tutorial is to show how to write a simple app that communicates with the IOIO board.






The programming language used to write an Android app is Java. If you are not familiar with Java, this tutorial will only go over writing a simple Java app using the IOIO library. This tutorial will not cover how to write Java code nor will it cover how to use the rich features within your Android device, like GPS, accelerometer, touch screen, etc. Once you get to the point where you want to use the vast array of features on your Android, we suggest first looking at the technical resource section on developer.android.com. If you still can't find the examples you are looking for, simply browsing the web will result in a ton of information and examples that show you how to communicate with all of the great pieces of hardware within your Andriod device.
In general, the holy grail for developing Android apps is developer.android.com. There, you will find most of the information on Android development. For documentation/downloads specific to the IOIO and for more advanced discussions about the IOIO, see these links:

Gathering Your Hardware

Here are the pieces of hardware you will need to complete this tutorial:
  • Android enabled device using OS 1.5 or greater.
  • IOIO for Android board
  • USB cable that is compatible with your Android device
  • 5-15V power supply with at least 1A of current. You will need to power the IOIO through the VIN and GND pins or there is an optional JST connector on the back of the board. It will need to be soldered into place and can be used with this adapter and wall wart power supply. More information at the end of the tutorial found here.

Installing the Development Environment

The Eclipse IDE (integrated development environment), the Android SDK (software development kit), and the JDK (Java development kit) are the primary pieces of software that you will need to install. The page developer.android.com has written thorough instructions on what exactly you will need to download. Please read the instructions carefully, they are found in the link below:
ATTENTION: You must use JDK v6 (not v5 or v7) for Android development.
If you have any problems, see the Troubleshooting section from developer.android.com.
When you reach Step 4 in the Android SDK tutorial, you will at least need to install the SDK components relevant to the Android device you will be working with. For example, if you have an Android phone, goto Settings > About Phone and scroll down to Android Version. You must install the SDK platform corresponding to the Android version of your device.



For Android Development
http://androidcontrol.blogspot.com/2011/10/android-development.html

Beginning Android Application Development Ebook

http://androidcontrol.blogspot.com/2011/10/beginning-android-application.html


Wednesday, September 21, 2011

Arduino UNO board


                      






Arduino UNO board

Product Description


The Arduino Uno Board is an open source electronics prototyping platform based on the ATmega328 microcontroller. It is equipped with 14 digital I/O pins, six of which can be used as PWM outputs, 6 analog inputs, 16MHz oscillator, USB interface, DC power jack and an ICSP header. Only the board is included and a USB cable is required to program.

This is the new Arduino Uno Board. In addition to all the features of the previous board, the Uno now uses an ATmega8U2 instead of the FTDI chip. This allows for faster transfer rates, no drivers needed for Linux or Mac (inf file for Windows is needed), and the ability to have the Uno show up as a keyboard, mouse, joystick, etc.

Technical Details

  • ATmega 328 Microcontroller
  • 16Mhz Clock Speed
  • Input voltage - 7-12V
  • 14 Digital I/O Pins (6 PWM outputs)
  •  6 Analog Inputs
  • 32k Flash Memory
  • Official board made in Italy