Saturday, December 17, 2016

Python for Microcontrollers: Getting Started with MicroPython

Program Your Own MicroPython projects with ease―no prior programming experience necessary!

Python for Microcontrollers: Getting Started with MicroPython

This DIY guide provides a practical introduction to microcontroller programming with MicroPython. Written by an experienced electronics hobbyist, Python for Microcontrollers: Getting Started with MicroPython features eight start-to-finish projects that clearly demonstrate each technique. You will learn how to use sensors, store data, control motors and other devices, and work with expansion boards. From there, you’ll discover how to design, build, and program all kinds of entertaining and practical projects of your own.

• Learn MicroPython and object-oriented programming basics
• Explore the powerful features of the Pyboard, ESP8266, and WiPy
• Interface with a PC and load files, programs, and modules
• Work with the LEDs, timers, and converters
• Control external devices using serial interfaces and PWM
• Build and program a let ball detector using the 3-axis accelerometer
• Install and program LCD and touchsensor expansion boards
• Record and play sounds using the AMP audio board

Sunday, December 11, 2016

Programming Arduino-compatible Wireless Network Systems: A Practical Guide

Programming Arduino-compatible Wireless Network Systems: A Practical Guide

The popular Arduino platform now includes many boards and kits that allow to design complex and powerful wireless measurement and control systems. The material of this book covers the use of Wi-Fi for designing wireless broadband control and measurement systems built around two popular Wi-Fi boards, NodeMCU with ESP8266 CPU and Ameba RTL8195 with RTL8195AM Cortex-M3.
This book is thought as a highly practical guide to programming simple wireless systems for remote control and measurement. The material of the book assumes that the readers are familiar, at least, with basics of designing and assembling simple electronic circuits. Each project is accompanied by a brief description which helps to make things clear. All projects described in this guide can be easily improved or modified if necessary.

All wireless projects from this guide were tested on the desktop PC running Linux (Ubuntu 16.04), Windows 10 and Raspberry Pi 3 running Raspbian OS. The source code for network applications running on Raspbian OS, Ubuntu and Windows was developed in Idle Python 3 environment. The NodeMCU and Ameba RTL8195 applications were developed in Arduino 6.1.12 IDE.

Programming Arduino: Getting Started with Sketches, Second Edition (Tab) 2nd Edition

Program Arduino with ease!

Programming Arduino: Getting Started with Sketches, Second Edition (Tab)

This thoroughly updated guide shows, step-by-step, how to quickly program all Arduino models. Programming Arduino: Getting Started with Sketches, Second Edition, features easy-to-follow explanations, fun examples, and downloadable sample programs. Discover how to write basic sketches, use Arduino’s modified C language, store data, and interface with the Web. You will also get hands-on coverage of C++, library writing, and programming Arduino for the Internet of Things. No prior programming experience is required!

• Understand Arduino hardware fundamentals
• Set up the software, power up your Arduino, and start uploading sketches
• Learn C language basics
• Add functions, arrays, and strings to your sketches
• Program Arduino’s digital and analog inputs and outputs
• Use functions from the standard Arduino library
• Write sketches that can store data
• Interface with displays, including OLEDs and LCDs
• Connect to the Internet and configure Arduino as a Web server
• Develop interesting programs for the Internet of Things
• Write your own Arduino libraries and use object-oriented programming methods

Wednesday, November 16, 2016

MicroPython for ESP8266 Development Workshop

MicroPython for ESP8266 Development Workshop

This book explores how to work with MicroPython development for ESP8266 modules and boards such as NodeMCU, SparkFun ESP8266 Thing and Adafruit Feather HUZZAH with ESP8266 WiFi. The following is highlight topics in this book

* Preparing Development Environment
* Setting Up MicroPython
* GPIO Programming
* PWM and Analog Input
* Working with I2C
* Working with UART
* Working with SPI
* Working with DHT Module

Monday, October 17, 2016

Make: Drones: Teach an Arduino to Fly

Make: Drones: Teach an Arduino to Fly

Make: Drones will help the widest possible audience understand how drones work by providing several DIY drone projects based on the world's most popular robot controller--the Arduino. The information imparted in this book will show Makers how to build better drones and be better drone pilots, and incidentally it will have applications in almost any robotics project. Why Arduino? Makers know Arduinos and their accessories, they are widely available and inexpensive, and there is strong community support. Open source flight-control code is available for Arduino, and flying is the hook that makes it exciting, even magical, for so many people. Arduino is not only a powerful board in its own right, but it's used as the controller of most inexpensive 3d printers, many desktop CNCs, and the majority of open source drone platforms.

Monday, October 10, 2016

Internet of Things with Arduino Cookbook

Internet of Things with Arduino Cookbook

Key Features
  • This book offers key solutions and advice to address the hiccups faced when working on Arduino-based IoT projects in the real world
  • Take your existing skills and capabilities to the next level by building challenging IoT applications with ease.
  • Be the tech disruptor you always wanted to be with key recipes that help you solve Arduino IoT related problems smarter and faster.
  • Put IoT to work through recipes on building Arduino-based devices that take control of your home, health, and life!
Book Description
Arduino is a powerful and very versatile platform used by millions of people around the world to create DIY electronics projects. It can be connected to a wide variety of sensors and other components, making it the ideal platform to build amazing Internet of Things (IoT) projects on―the next wave in the era of computing.

This book takes a recipe-based approach, giving you precise examples on how to build IoT projects of all types using the Arduino platform. You will come across projects from several fields, including the popular robotics and home automation domains. Along with being introduced to several forms of interactions within IoT, including projects that directly interact with well-known web services such as Twitter, Facebook, and Dropbox we will also focus on Machine-to-Machine (M2M) interactions, where Arduino projects interact without any human intervention. You will learn to build a few quick and easy-to-make fun projects that will really expand your horizons in the world of IoT and Arduino. Each chapter ends with a troubleshooting recipe that will help you overcome any problems faced while building these projects.

By the end of this book, you will not only know how to build these projects, but also have the skills necessary to build your own IoT projects in the future.

What you will learn
  • Monitor several Arduino boards simultaneously
  • Tweet sensor data directly from your Arduino board
  • Post updates on your Facebook wall directly from your Arduino board
  • Create an automated access control with a fingerprint sensor
  • Control your entire home from a single dashboard
  • Make a GPS tracker that you can track in Google Maps
  • Build a live camera that streams directly from your robot

About the Author
Marco Schwartz is an electrical engineer, entrepreneur, and blogger. He has a master's degree in electrical engineering and computer science from Supelec, France, and a master's degree in micro engineering from the Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland.

He has more than five years of experience working in the domain of electrical engineering. Marco's interests gravitate around electronics, home automation, the Arduino and Raspberry Pi platforms, open source hardware projects, and 3D printing.

He has several websites about Arduino, including the Open Home Automation website, which is dedicated to building home automation systems using open source hardware.

Marco has written another book on home automation and Arduino, called Home Automation With Arduino: Automate Your Home Using Open-source Hardware. He has also written a book on how to build Internet of Things projects with Arduino, called Internet of Things with the Arduino Yun, by Packt Publishing.

Table of Contents
  1. Connecting an Arduino to the Web
  2. Cloud Data Monitoring
  3. Interacting with Web Services
  4. Machine-to-Machine Interactions
  5. Home Automation Projects
  6. Fun Internet of Things Projects
  7. Mobile Robot Applications

Monday, September 5, 2016

MySQL for the Internet of Things

MySQL for the Internet of Things

This book introduces the problems facing Internet of Things developers and explores current technologies and techniques to help you manage, mine, and make sense of the data being collected through the use of the world’s most popular database on the Internet - MySQL.

The IoT is poised to change how we interact with and perceive the world around us, and the possibilities are nearly boundless. As more and more connected devices generate data, we will need to solve the problem of how to collect, store, and make sense of IoT data by leveraging the power of database systems.

The book begins with an introduction of the MySQL database system and storage of sensor data. Detailed instructions and examples are provided to show how to add database nodes to IoT solutions including how to leverage MySQL high availability, including examples of how to protect data from node outages using advanced features of MySQL.

The book closes with a comparison of raw and transformed data showing how transformed data can improve understandability and help you cut through a clutter of superfluous data toward the goal of mining nuggets of useful knowledge.

In this book, you'll learn to:
  • Understand the crisis of vast volumes of data from connected devices
  • Transform data to improve reporting and reduce storage volume
  • Store and aggregate your IoT data across multiple database servers
  • Build localized, low-cost MySQL database servers using small and inexpensive computers
  • Connect Arduino boards and other devices directly to MySQL database servers
  • Build high availability MySQL solutions among low-power computing devices

Tuesday, July 12, 2016

Junk Box Arduino: Ten Projects in Upcycled Electronics

Junk Box Arduino: Ten Projects in Upcycled Electronics

We all hate to throw electronics away. Use your 5 volt Arduino and have fun with them instead! Raid your electronics junk box to build the Cestino (Arduino compatible) board and nine other electronics projects, from a logic probe to a microprocessor explorer, and learn some advanced, old-school techniques along the way. Don’t have a well-stocked junk box? No problem. Nearly all the components used in these projects are still available (and cheap) at major electronic parts houses worldwide.

Junk Box Arduino is the ultimate have-fun-while-challenging-your-skills guide for Arduino hackers who’ve gone beyond the basic tutorials and are ready for adventures in electronics. Bonus materials include all the example sketches, the Cestino core and bootloader source code, and links to suppliers for parts and tools.

Bonus materials include extensions to the Cestino, Sourceforge links for updated code, and all the source-code for the projects.

Wednesday, June 29, 2016

Test nRF8001 Bluetooth LE module with nRF Master Control Panel (BLE) App on Android phone



This post show how to test Adafruit nRF8001 Bluetooth LE module with nRF Master Control Panel (BLE) App on Android phone.

- First of all, we have to install Adafruit nRF8001 library to Arduino IDE and connect Arduino Uno with nRF8001 module. Refer last post "Adafruit nRF8001 Bluetooth LE".




- Install "nRF Master Control Panel (BLE)" app on Android phone.

- Open echoDemo example provided in Adafruit nRF8001 library:
Examples > Adafruit nRF8001 echoDemo

Run on Uno and test with nRF Master Control Panel (BLE) App on Android phone, refer to the video:


Monday, June 27, 2016

Adafruit nRF8001 Bluetooth LE




Adafruit nRF8001 library for Arduino


adafruit/Adafruit_nRF8001 is driver and example code for Adafruit's nRF8001 Bluetooth Low Energy Breakout.


PINOUT

(The Fritzing part of Adafruit nRF8001 can be download HERE)

The pin locations are defined in ble_system.h, the supported systems are defined in hal_aci_tl.cpp. The following pinout is used by default for the Arduino Uno:

SCK -> Pin 13
MISO -> Pin 12
MOSI -> Pin 11
REQ -> Pin 10
RDY -> Pin 2 (HW interrupt)
ACT -> Not connected
RST -> Pin 9
3V0 - > Not connected
GND -> GND
VIN -> 5V
RDY must be on pin 2 since this pin requires a HW interrupt.

3V0 is an optional pin that exposes the output of the on-board 3.3V regulator. You can use this to supply 3.3V to other peripherals, but normally it will be left unconnected.

ACT is not currently used in any of the existing examples, and can be left unconnected if necessary.


Related:
Test nRF8001 Bluetooth LE module with nRF Master Control Panel (BLE) App on Android phone

Monday, June 20, 2016

NodeMCU/ESP8266 + OLED 1.3" 128x64 SPI SH1106, using esp8266-oled-sh1106 library


It's a 1.3" 128x64 OLED of SPI interface, with SH1106 controller. The SH1106 is in general similar to the SSD1306. Main difference is a memory of 132x64 instead of 128x64.

This post show how to connect with NodeMCU and install the library of esp8266-oled-sh1106.

Connection between NodeMCU and the 1.3" 128x64 OLED SPI module with SH1106:
 D5 GPIO14   CLK         - D0 pin OLED display
 D6 GPIO12   MISO (DIN)  - not connected
 D7 GPIO13   MOSI (DOUT) - D1 pin OLED display
 D1 GPIO5    RST         - RST pin OLED display
 D2 GPIO4    DC          - DC pin OLED
 D8 GPIO15   CS / SS     - CS pin OLED display


Download and install the library as shown, and run the example:



Related:
Hello World 1.3 inch IIC/SPI 128x64 OLED x Arduino, using u8glib library
NodeMCU/ESP8266 + OLED 0.96" 128x64 I2C SSD1306 using esp8266-oled-ssd1306 library

Sunday, June 19, 2016

NodeMCU/ESP8266 + OLED 0.96" 128x64 I2C SSD1306 using esp8266-oled-ssd1306 library


esp8266-oled-ssd1306 is  a driver for the SSD1306 based 128x64 pixel OLED display running on the Arduino/ESP8266 platform. Can be used with either the I2C or SPI version of the display

You can either download this library as a zip file and unpack it to your Arduino/libraries folder or (once it has been added) choose it from the Arduino library manager.

This video show how to install on Arduino IDE using Library Manager, and run the example.


Connection between NodeMCU and OLED 0.96" 128x64 I2C SSD1306:
NodeMCU 3V3 - OLED VCC
NodeMCU GND - OLED GND
NodeMCU D3 - OLED SDA
NodeMCU D5 - OLED SCL

(The Fritzing parts of both nodemcu-v1.0 and OLED_SSD1306_I2C_128x64 can be download here:
https://github.com/squix78/esp8266-fritzing-parts)


Related:
NodeMCU/ESP8266 display on 1.3" 128x64 OLED SPI with SH1106, using esp8266-oled-sh1106 library
Raspberry Pi display on 128x64 I2C OLED with SSD1306, using Python

Other libraries to run on NodeMCU/ESP8266 with I2C OLED SSD1306:
NodeMCU (ESP8266) to display on 128x64 I2C OLED, using Adafruit SSD1306 library
esp8266-OLED, esp8266-Arduino library for I2C-OLED displays

For ESP32 WiFi/Bluetooth Module:
Connect I2C 128X64 OLED (SSD1306) to ESP32, using esp8266-oled-ssd1306

Saturday, June 18, 2016

ESP-05(ESP8266) + Arduino Mega, act as simple web server

Last post introduced ESP-05 (a mini ESP8266 board) with simple testing. This post show a very simple web server on Arduino Mega 2560 + ESP-05.

Basically, it's same as the example of "Arduino + ESP8266 - Web Server (III) with firmware 00200.9.5(b1)", except the baud rate.


Mega_ESP05_Web.ino
/*
Arduino Mega 2560 + ESP-05(ESP8266)

ESP-05 running firmware:
AT version:0.40.0.0(Aug  8 2015 14:45:58)
SDK version:1.3.0
Ai-Thinker Technology Co.,Ltd.
Build:1.3.0.2 Sep 11 2015 11:48:04

Connection between Mega & ESP-05, 
refer "Connect with Arduino Mega 2560 via Level Converter" in:
http://goo.gl/wtG89i

Mega + ESP_05 act as station, join WiFi AP of my phone.
Once server setup, you can visit the webpage in ESP-05
by visit the IP show in Serial Monitor, under the command:
AT+CIFSR
+CIFSR:STAIP,"192.168.43.15"

If always show "Module have no response.",
check your connection, or reset ESP-05 by power OFF and ON.

 */
#define ASCII_0 48
#define ESP8266 Serial3

//WiFi hotspot setting on my phone
String SSID = "ssid";
String PASSWORD = "password";

int LED = 13;

boolean FAIL_8266 = false;

String strHTML1 = "<!doctype html>\
<html>\
<head>\
<title>arduino-er</title>\
</head>\
<body>\
<H1>arduino-er.blogspot.com</H1>";

String strHTML2 = "</body>\
</html>";

//String strHTML = "arduino-er.blogspot.com";

#define BUFFER_SIZE 128
char buffer[BUFFER_SIZE];

void setup() {
  pinMode(LED, OUTPUT);
  
  digitalWrite(LED, LOW);
  delay(300);
  digitalWrite(LED, HIGH);
  delay(200);
  digitalWrite(LED, LOW);
  delay(300);
  digitalWrite(LED, HIGH);
  delay(200);
  digitalWrite(LED, LOW);

  do{
    Serial.begin(115200);
    ESP8266.begin(115200);
  
    //Wait Serial Monitor to start
    while(!Serial);
    Serial.println("--- Start ---");

    ESP8266.println("AT+RST");
    delay(1000);
    if(ESP8266.find("ready"))
    {
      Serial.println("Module is ready");
      
      ESP8266.println("AT+GMR");
      delay(1000);
      clearESP8266SerialBuffer();
      
      ESP8266.println("AT+CWMODE=1");
      delay(2000);
      
      //Quit existing AP, for demo
      Serial.println("Quit AP");
      ESP8266.println("AT+CWQAP");
      delay(1000);
      
      clearESP8266SerialBuffer();
      if(cwJoinAP())
      {
        Serial.println("CWJAP Success");
        FAIL_8266 = false;
        
        delay(3000);
        clearESP8266SerialBuffer();
        //Get and display my IP
        sendESP8266Cmdln("AT+CIFSR", 1000);  
        //Set multi connections
        sendESP8266Cmdln("AT+CIPMUX=1", 1000);
        //Setup web server on port 80
        sendESP8266Cmdln("AT+CIPSERVER=1,80",1000);
        
        Serial.println("Server setup finish");
      }else{
        Serial.println("CWJAP Fail");
        delay(500);
        FAIL_8266 = true;
      }
    }else{
      Serial.println("Module have no response.");
      delay(500);
      FAIL_8266 = true;
    }
  }while(FAIL_8266);
  
  digitalWrite(LED, HIGH);
  
  //set timeout duration ESP8266.readBytesUntil
  ESP8266.setTimeout(1000);
}

void loop(){
  int connectionId;
  
  if(ESP8266.readBytesUntil('\n', buffer, BUFFER_SIZE)>0)
  {
    Serial.println("Something received");
    Serial.println(buffer);
    if(strncmp(buffer, "+IPD,", 5)==0){
      Serial.println("+IPD, found");
      sscanf(buffer+5, "%d", &connectionId);
      Serial.println("connectionId: " + String(connectionId));
      delay(1000);
      clearESP8266SerialBuffer();
      
      sendHTTPResponse(connectionId, strHTML1);
      sendHTTPResponse(connectionId, "<hr/>-END-<br/>");
      sendHTTPResponse(connectionId, strHTML2);

      //Close TCP/UDP
      String cmdCIPCLOSE = "AT+CIPCLOSE="; 
      cmdCIPCLOSE += connectionId;
      sendESP8266Cmdln(cmdCIPCLOSE, 1000);
    }
  }
}

void sendHTTPResponse(int id, String response)
{
  String cmd = "AT+CIPSEND=";
  cmd += id;
  cmd += ",";
  cmd += response.length();
  
  Serial.println("--- AT+CIPSEND ---");
  sendESP8266Cmdln(cmd, 1000);
  
  Serial.println("--- data ---");
  sendESP8266Data(response, 1000);
}

boolean waitOKfromESP8266(int timeout)
{
  do{
    Serial.println("wait OK...");
    delay(1000);
    if(ESP8266.find("OK"))
    {
      return true;
    }

  }while((timeout--)>0);
  return false;
}

boolean cwJoinAP()
{
  String cmd="AT+CWJAP=\"" + SSID + "\",\"" + PASSWORD + "\"";
  ESP8266.println(cmd);
  return waitOKfromESP8266(10);
}

//Send command to ESP8266, assume OK, no error check
//wait some time and display respond
void sendESP8266Cmdln(String cmd, int waitTime)
{
  ESP8266.println(cmd);
  delay(waitTime);
  clearESP8266SerialBuffer();
}

//Basically same as sendESP8266Cmdln()
//But call ESP8266.print() instead of call ESP8266.println()
void sendESP8266Data(String data, int waitTime)
{
  //ESP8266.print(data);
  ESP8266.print(data);
  delay(waitTime);
  clearESP8266SerialBuffer();
}

//Clear and display Serial Buffer for ESP8266
void clearESP8266SerialBuffer()
{
  Serial.println("= clearESP8266SerialBuffer() =");
  while (ESP8266.available() > 0) {
    char a = ESP8266.read();
    Serial.write(a);
  }
  Serial.println("==============================");
}





download filesDownload the file .

Friday, June 17, 2016

ESP-05, mini ESP8266 WiFi module

ESP-05 is a mini size WiFi module of ESP8266 family. Almost half size of ESP-01, no on-board antenna, with five-pin in SIL, more breadboard friendly.





It's 5 pins on the board:
- RST
- GND
- URXD
- UTXD
- VCC3V3




First test AT Command and check firmware:

To test ESP-05 with AT Command, we connect ESP-05 to PC via FTDI USB-to-Serial adapter, as shown:

(The Fritzing part of ESP8266-05 can be found HERE)

- Run Arduino IDE
- Select connected port
- Open Tools > Serial Monitor
- Select Booth NL & CR, 115200 baud
- Power on ESP-05
- Then you can enter AT command as show in this video:


To check the firmware, enter the command AT+GMR:
AT+GMR

AT version:0.40.0.0(Aug  8 2015 14:45:58)
SDK version:1.3.0
Ai-Thinker Technology Co.,Ltd.
Build:1.3.0.2 Sep 11 2015 11:48:04
OK


Connect with Arduino Mega 2560 via Level Converter:


In this step, we are going to connect ESP-05 to Arduino Mega 2560, such that we can send command to ESP-05 by Mega. Because Mega is work on 5V, and ESP-05 work on 3.3V, so we need a Level Converter.

Connect as shown:


(Alternatively, you can simple use a voltage divider of 2 resistors to convert 5V Mega TX to 3.3V ESP-05 RX, ESP-05 TX can direct connect to Mega RX, to achieve the same job.)

Enter the code run on Mega. This program simple accept command from PC forward to ESP-05, receive response from ESP-05, forward to PC.

Mega_ESP05_test.ino
int LED = 13;
boolean LEDst = false;

void setup() {
  Serial.begin(115200);
  Serial3.begin(115200);
  pinMode(LED, OUTPUT);
  digitalWrite(LED, LEDst);
}

void loop() {
  while (Serial.available() > 0) {
    char a = Serial.read();
    Serial3.write(a);
  }
  
}

void serialEvent3() {
  while (Serial3.available() > 0) {
    char a = Serial3.read();
    Serial.write(a);
    ToggleLED();
  }
}

void ToggleLED(){
  digitalWrite(LED, LEDst = !LEDst);
}

Such that we can enter command as in "First test AT Command and check firmware" above. This step aim to make sure the connection between Mega and ESP-05 is correct.

Example:
ESP-05(ESP8266) + Arduino Mega, act as simple web server

Arduino Mega read string from Serial, display on 3.2" 480 x 320 TFT LCD Shield


Arduino example run on Mega 2560, read string from Serial port, and display on 3.2" 480 x 320 TFT LCD Shield usin UTFT library. The sting is limited to 30 characters on each line.


Mega_UTFT_SerialRead.ino
/*
 * Example run on Arduino Mega 2560 to read string from Serial,
 * then display on 3.2" 480 x 320 TFT LCD Shield
 * 
 * http://arduino-er.blogspot.com/search/label/3.2%22%20480%20x%20320%20TFT%20LCD%20Shield
*/

#include <UTFT.h>

extern uint8_t BigFont[];

UTFT myGLCD(CTE32HR,38,39,40,41);

const int NumOfRow = 20;
const int HeightOfRow = 16;
const int CharPerRow = 30;

String buffer[NumOfRow];

void setup()
{
  Serial.begin(57600);
  myGLCD.InitLCD();
  myGLCD.clrScr();

  myGLCD.setColor(255, 255, 255);
  myGLCD.setBackColor(0, 0, 0);

  myGLCD.setFont(BigFont);

  myGLCD.print("Open Serial Monitor,", LEFT, 0);
  myGLCD.print("to enter something.", LEFT, HeightOfRow);
  
  initBuffer();
}

void loop()
{
  String stringIn = Serial.readStringUntil('\n');
  Serial.print(".");
  if(!stringIn.equals("")){
    Serial.print("*");
    String stringToIns = stringIn.substring(0, CharPerRow);
    insert(stringToIns);
    Serial.println(stringToIns);
    printBuffer();
  }
  
}

void initBuffer(){
  for(int i=0; i<NumOfRow; i++){
    buffer[i] = "";
  }
}

void insert(String ins){
  for(int i=0; i<NumOfRow-1; i++){
    buffer[i] = buffer[i+1];
  }
  buffer[NumOfRow-1] = ins;
}

void printBuffer(){
  myGLCD.clrScr();
  for(int i=0; i<NumOfRow; i++){
    myGLCD.print(buffer[i], LEFT, i*HeightOfRow);
  }
}



Thursday, June 16, 2016

Arduino Mega Draw bitmap on 3.2" 480 x 320 TFT LCD Shield using UTFT

This post show how to draw bitmap on 3.2" 480 x 320 TFT LCD Shield using UTFT, run on Arduino Mega 2560.



Before start, you have to install UTFT library on your Arduino IDE.

Once installed, it's a program ImageConverter565.exe in the Tools directory under the library, used to convert image files to array in .c (.raw) format, can be loaded in our sketch.

This video show how:


Example code, MegaUTFTBitmap.ino
#include <UTFT.h>

UTFT myGLCD(CTE32HR,38,39,40,41);

extern unsigned int Arduinoer[];

void setup() {
  // put your setup code here, to run once:
  myGLCD.InitLCD();
  myGLCD.clrScr();
  myGLCD.drawBitmap(0, 0, 100, 100, Arduinoer);

}

void loop() {
  // put your main code here, to run repeatedly:

}

3.2" 480 x 320 TFT LCD Shield, install UTFT library and test with Arduino Mega 2560

It's 3.2" 480 x 320 TFT color screen support Arduino Mega 2560, named QDM320B.








According to the seller:

Overview
QD320DB16NT8357RA module is 3.2" TFT LCD with 262K color 480x320 resolutions.
The controller of this LCD module is HX8357B, it supports 16-wires DataBus interface. Moreover, this module includes the 5V -3.3V power conversion circuit and Level Level conversion circuit, This Module can Directly inserted into the Arduino Mega2560 Board, it also includes the SD card socket and SPI FLASH circuit.

Features

  • Support Arduino Mega2560 Directly inserted
  • With Full-angle IPS TFT panel
  • OnBorad level conversion chip for 5V/3.3V MCU
  • Compatible with 3.3/5V operation voltage level
  • Compatible with Arduino-Series development Board.
  • Compatible with UTFT / UTFT_Buttons /Utouch Library for arduino.
  • provided 12-examples with Arduino ,3-examples with STM32 
  • With SD Card Socket
  • With SPI FLASH circuit



This video show how to install UTFT library (from http://www.rinkydinkelectronics.com/) and test example on Arduino Mega 2560.


More examples:
Draw bitmap on 3.2" 480 x 320 TFT LCD Shield using UTFT
Arduino Mega read string from Serial, display on 3.2" 480 x 320 TFT LCD Shield

Wednesday, June 15, 2016

Building Arduino Projects for the Internet of Things

Building Arduino Projects for the Internet of Things: Experiments with Real-World Applications

This is a book about building Arduino-powered devices for everyday use, and then connecting those devices to the Internet. If you're one of the many who have decided to build your own Arduino-powered devices for IoT applications, you've probably wished you could find a single resource--a guidebook for the eager-to-learn Arduino enthusiast--that teaches logically, methodically, and practically how the Arduino works and what you can build with it.
Building Arduino Projects for the Internet of Things: Experiments with Real-World Applications is exactly what you need. Written by a software developer and solution architect who got tired of hunting and gathering various lessons for Arduino development as he taught himself all about the topic, this book gives you an incredibly strong foundation of Arduino-based device development, from which you can go in any direction according to your specific development needs and desires.


Readers are introduced to the building blocks of IoT, and then deploy those principles to by building a variety of useful projects. Projects in the books gradually introduce the reader to key topics such as internet connectivity with Arduino, common IoT protocols, custom web visualization, and Android apps that receive sensor data on-demand and in realtime. IoT device enthusiasts of all ages will want this book by their side when developing Android-based devices.


What You'll Learn:
  • Connect an Arduino device to the Internet
  • Creating an Arduino circuit that senses temperature
  • Publishing data collected from an Arduino to a server and to an MQTT broker
  • Setting up channels in Xively
  • Setting up an app in IBM Bluematrix
  • Using Node-RED to define complex flows
  • Publishing data visualization in a web app
  • Reporting motion-sensor data through a mobile app
  • Creating a remote control for house lights
  • Creating a machine-to-machine communication requiring no human intervention
  • Creating a location-aware device