Thursday, December 31, 2015

Standalone ESP8266/ESP-12, read GPIO with pull-up resistor.


This example set GPIO12 as input with pull-up resistor. Turn ON/OFF on-board LED according to GPIO12 input.

/*
 ESP8266 Read input from GPIO12, write to on-board LED
*/

int pin_Button = 12;  //GPIO12 

void setup() {

  pinMode(BUILTIN_LED, OUTPUT);
  pinMode(pin_Button, INPUT_PULLUP);
}

void loop() {

  if(digitalRead(pin_Button)){
    digitalWrite(BUILTIN_LED, LOW);   //LED ON
  }else{
    digitalWrite(BUILTIN_LED, HIGH);  //LED OFF
  }

}


Friday, December 18, 2015

Arduino Uno: A Hands-On Guide for Beginner

Arduino Uno: A Hands-On Guide for Beginner

Arduino board is a popular board for embedded development. This book helps you to get started with Arduino Uno development. Several scenario samples are provided to accelerate your learning process. The following is highlight topics: 
* Preparing Development Environment 
* Setting Up Arduino Uno 
* Writing and Reading Digital Data 
* Serial Communication (UART) 
* PWM and Analog Input 
* Working with I2C 
* Working with SPI 
* Accessing EEPROM 
* Arduino Networking

Wednesday, December 9, 2015

Test HM-10 Bluetooth 4.0 BLE module with FTDI adapter


We can connect HM-10 Bluetooth 4.0 BLE module to PC using FTDI USB-Serial adapter, via USB serial. Such that we can test it by sending AT command using terminal, such as Serial Monitor in Arduino IDE.

Connection:
HM-10 VCC - separated 3.3V
HM-10 GND - FTDI GND
HM-10 Tx - FTDI Rx
HM-10 Rx - FTDI Tx
(both HM-10 and FTDI adapter operate on 3.3V).

- Connect FTDI adapter to PC, via USB adapter.
- Run Arduino IDE, select correct port to FTDI adapter.
- Start Serial Monitor, set baud rate of 9600, and No line ending.
- Supply power (3.3V) to HM-10. Its on-board LED will blink.
- Then you can enter AT command in Arduino Serial Monitor.

(To download document of HM-10 AT command, refer last post "HM-10 and AT-09 Bluetooth 4.0 BLE module")

This video show how to:


By default, the service UUID and Characteristic of HM-10 are:
- Service UUID: 0xFFE0
- Characteristic: 0xFFE1

It can be referenced in HM-10 document. Or obtain from devices using AT command:
(you can set both service UUID and Characteristic using AT command also)
- Query service UUID: AT+UUID?
- Query Characteristic: AT+CHAR?

This video show how to:



My another blogspot Android-er show how to "Connect HM-10 (BLE Module) to Android device, with BluetoothLeGatt sample project".



HM-10 and AT-09 Bluetooth 4.0 BLE module




HM-10 BLE Bluetooth 4.0 Serial Wireless Module


- document of HM-10 can be downloaded from http://www.jnhuamao.cn, it provide Chinese and English version,
*please notice that the site maybe reported containing malware, so I download it in VirtualBox.



Test HM-10 Bluetooth 4.0 BLE module with FTDI adapter


AT-09 BLE Bluetooth 4.0 Uart Transceiver Module CC2541 Central Switching compatible HM-10





Thursday, December 3, 2015

AltSoftSerial Library for Arduino Boards

AltSoftSerial is a software emulated serial library for Arduino boards, using hardware timers for improved compatibility.


AltSoftSerial is particularly useful when simultaneous data flows are needed. It is capable of running up to 57600 baud on 16 MHz AVR with up to 9 µs interrupt latency from other libraries. Slower baud rates are recommended when other code may delay AltSoftSerial's interrupt response by more than 9 µs.

AltSoftSerial Library can be installed to Arduino IDE using Library Manager.

Saturday, November 21, 2015

Beginning Arduino ov7670 Camera Development

Beginning Arduino ov7670 Camera Development

This book is a great investment for those interested in developing camera related projects for the Arduino. These camera applications can involve security, surveillance, photography, toys, robots, and drones. Specifically, this book covers the Omnivision ov7670 digital camera and its use with the Arduino microcontroller. This book takes an interactive hands on approach and shows the reader in a step by step guide how to use the ov7670 with the Arduino and an SD card reader/writer to take photos, save them to an SD card, and then to convert them to an easily viewable format. This book will save you many hours or even weeks of frustration in trying to get this camera to work correctly. This book also gives you the basic background on the Arduino and digital cameras in general so that you will be able to develop camera projects for cameras other than the ov7670.

Who this book is for:
1. Beginners to the Arduino interested in developing custom Arduino camera related projects that are suitable for photography, surveillance, security applications or for use with drones and robots.
2. High school and university students needing a quick start guide to using a low cost digital camera in their school projects.

Key Selling Points:
1. Provides an interactive "hands on example" based beginner's quick start guide to using the extremely popular Omnivision ov7670 camera with the Arduino including using the undocumented features and incorrectly documented features that are necessary to get the camera to operate correctly.
2. Provides a good starting point for Arduino based camera applications as diverse as image processing, photography, surveillance, and home security with professional quality reusable code for the reader to use in his or her own projects.
3. Covers the FIFO version of the ov7670 which is the preferred camera version for most camera projects.

Table of Contents:
Chapter 1: Introducing the Omnivision OV7670 Camera
A. What is the OV7670 Camera?
B. Key Camera Terminology
C. OV7670 Camera with AL422B FIFO Memory Overview
D. Summary of Steps Needed for Taking a Photo
Chapter 2: Introducing the Arduino
A. What is an Arduino?
B. The Arduino Mega 2560
C. Arduino Development System Requirements
D. Arduino Software IDE
E. Hands on Example: A simple Arduino "Hello World" program with an LED
Chapter 3: Arduino Programming Language Basics
A. C/C++ Language for Arduino Overview
Chapter 4: Digital Design Review
A. How Data is Stored in the ov7670 Camera
B. Decimal Numbers (Base 10 Representation)
C. Binary Numbers (Base 2 Representation)
D. Hexadecimal Numbers (Base 16 Representation)
E. Converting a Binary Number (Base 2) to a Hex Number (Base 16)
F. Converting a Hexadecimal Number (Base 16) to a Binary Number (Base 2)
G. Hands On Example: Setting Registers on the OV7670 Camera
H. Boolean Variables, Logic and Truth Tables
I. The Clock Pulse
J. Reading Schematics
K. Design Overview for the OV7670 Camera with FIFO Memory
Chapter 5: Taking Photos with the Omnivision ov7670 Camera - Part 1
A. Overview of SD Card Storage for the Arduino
B. Overview of Arduino's I2C Interface
C. Hands on Example: Testing the I2C Interface with the OV7670 Camera
D. Overview of the Omnivision ov7670 FIFO Camera Image Capture Software
E. Overview of FFMPEG
Chapter 6: Taking Photos with the Omnivision ov7670 Camera - Part 2
A. Hands on Example: Taking a picture with the camera, saving the picture to the SD card storage, and viewing the image on your computer.
Appendix A: Camera Register Defines
Appendix B: Image Capture Program Variables

Sunday, November 15, 2015

Arduino Oscilloscope Projects

How to Design and Build Your Own Arduino Based Oscilloscope

Arduino Oscilloscope Projects

In essence this is a continuation of Robert J Davis's previous book “Arduino LCD Projects”. This book showing some of the most popular analog to digital converters and some of the most popular LCD screen’s together in Oscilloscope, and logic analyzer, types of applications. Some chapters of this book repeat some of the designs that were found in the “Arduino LCD Projects” book.

Table of Contents

1. Overview of Arduino Uno Oscilloscopes
Internal analog to digital converter
External analog to digital converter
FIFO and External analog to digital converter

2. Analog Input Section Design
TL082 or LF353
AD744 and NE5532

3. Fast Analog to Digital Converter
CA3306
CA3318
AD775
AD8703
TLC5510
Synchronizing the Clocks

4. Monochrome LCD - QC12864B
Internal Analog to Digital Converter
Six Channel Logic Analyzer
External Analog to Digital Converter

5. Serial Color LCD - 1.8 TFT SPI
Internal Analog to Digital Converter
External Analog to Digital Converter

6. Parallel Color LCD - TFT240_262K
Internal Analog to Digital Converter
Six Channel Logic Analyzer
External Analog to Digital Converter

7. Serial Color LCD - 2.2 to 2.8 SPI
Internal Analog to Digital Converter
External Analog to Digital Converter

8. Putting the Oscilloscope into a Case

Bibliography

Arduino LCD Projects

Arduino LCD Projects

Several Arduino LCD projects using both text based LCD's as well as graphics LCD's. Learn how to interface the Arduino UNO to several different LCD's. Includes projects like a 100,000 samples per second oscilloscope, and a two million samples per second logic analyzer.



Robert J Davis's another book “Arduino Oscilloscope Projects”.

Standalone ESP8266/ESP-12: web control on-board LED

It's a example of Standalone ESP8266/ESP-12 web server, to control on-board LED.


Prepare:
Install ESP8266 Board to Arduino IDE
Program standalone ESP8266/ESP-12 WiFi module with Arduino IDE
Simple Web Server example of standalone ESP8266/ESP-12 WiFi Module

This example modify from the last example Simple Web Server example of standalone ESP8266/ESP-12 WiFi Module, to control on-board LED. You need a Terminal program (ex. Arduino IDE's Serial Monitor) to display the ESP8266's IP.

ESP12-WebControlLed.ino
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
 
const char* ssid = "testAP";
const char* password = "12345678";
MDNSResponder mdns;

ESP8266WebServer server(80);

const int led = 13;

void handleRoot() {
  server.send(200, "text/plain", 
    "hello from esp8266!) \n/on: to tuen LED ON \n/off: to tuen LED OFF \n");

}

void handleNotFound(){
  digitalWrite(led, 1);
  String message = "File Not Found\n\n";
  message += "URI: ";
  message += server.uri();
  message += "\nMethod: ";
  message += (server.method() == HTTP_GET)?"GET":"POST";
  message += "\nArguments: ";
  message += server.args();
  message += "\n";
  for (uint8_t i=0; i<server.args(); i++){
    message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
  }
  server.send(404, "text/plain", message);
  digitalWrite(led, 0);
}
 
void setup(void){
  pinMode(led, OUTPUT);
  digitalWrite(led, 0);
  Serial.begin(115200);
  WiFi.begin(ssid, password);
  Serial.println("");

  // Wait for connection
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.print("Connected to ");
  Serial.println(ssid);
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
  
  if (mdns.begin("esp8266", WiFi.localIP())) {
    Serial.println("MDNS responder started");
  }
  
  server.on("/", handleRoot);

  server.on("/on", [](){
    digitalWrite(BUILTIN_LED, LOW);
    server.send(200, "text/plain", "LED ON");
  });
  
  server.on("/off", [](){
    digitalWrite(BUILTIN_LED, HIGH);
    server.send(200, "text/plain", "LED OFF");
  });

  server.onNotFound(handleNotFound);
  
  server.begin();
  Serial.println("HTTP server started");

  //delay a moment, 
  //for terminal to receive inf, such as IP address
  delay(1000);
  Serial.end();
  pinMode(BUILTIN_LED, OUTPUT);
}
 
void loop(void){
  server.handleClient();
} 


Android App to test:
- Android App to control Standalone ESP8266/ESP-12 on-board LED, using HttpClient, with Android example code.


Android App to control Standalone ESP8266/ESP-12 on-board LED, using HttpURLConnection, with Android example code and APK for test without coding.


Saturday, November 14, 2015

Getting Started with Intel Edison: Sensors, Actuators, Bluetooth, and Wi-Fi on the Tiny Atom-Powered Linux Module

Getting Started with Intel Edison: Sensors, Actuators, Bluetooth, and Wi-Fi on the Tiny Atom-Powered Linux Module (Make : Technology on Your Time)

The Intel Edison is a crowning achievement of Intel's adaptation of its technology into maker-friendly products. They've packed the dual-core power of the Atom CPU, combined it with a sideboard microcontroller brain, and added in Wi-Fi, Bluetooth Low Energy, and a generous amount of RAM (1GB) and flash storage (4GB). This book, written by Stephanie Moyerman, a research scientist with Intel's Smart Device Innovation Team, teaches you everything you need to know to get started making things with Edison, the compact and powerful Internet of Things platform.

Projects and tutorials include:
  • Controlling devices over Bluetooth
  • Using Python and Arduino programming environments on Edison
  • Tracking objects with a webcam and OpenCV
  • Responding to voice commands and talking back
  • Using and configuring Linux on Edison

Thursday, November 12, 2015

Building a Wireless Security Camera with Arduino

Easily Build Your Own DIY Wireless Security Camera Using the Arduino Platform

Building a Wireless Security Camera with Arduino

Imagine being able to watch what's going on in your home while you are away. What if you could build your own wireless security camera using the Arduino platform and some basic components?

In Building a Wireless Security Camera with Arduino, Marco Schwartz from the Open Home Automation website presents a straight to the point method to build your own security camera device with Arduino.

In this book, you will learn:
  • How to configure an Arduino Yun & connect a USB camera to the board
  • How to assemble the hardware of your camera
  • How to make the camera stream local & cloud live video
  • How to automatically save pictures of intruders on Dropbox
Buy this book now to start building your own wireless security camera with Arduino!

Wednesday, November 11, 2015

Simple Web Server example of standalone ESP8266/ESP-12 WiFi Module


Former posts show how to "Install ESP8266 Board to Arduino IDE" and "Program standalone ESP8266/ESP-12 WiFi module with Arduino IDE". ESP8266 Board Library come with a HelloServer example, it's easy to implement a simple web server.


Load ESP8266WebServer example of HelloServer, change ssid and password for your WiFi network, Save another file.



Next:
Standalone ESP8266/ESP-12: web control on-board LED

Sunday, November 8, 2015

What Does Open Source Mean to You? From OSCON 2015

From OSCON 2015 in Amsterdam, a number of voices from the open source community try to define its meaning and value.


Watch more from OSCON Amsterdam 2015: https://goo.gl/VeF8tq
Visit the OSCON website: http://oscon.com
Don't miss an upload! Subscribe! http://goo.gl/szEauh
Stay Connected to O'Reilly Media by Email - http://goo.gl/YZSWbO

Friday, November 6, 2015

Program standalone ESP8266/ESP-12 WiFi module with Arduino IDE


This post show how to program and run standalone ESP8266/ESP-12 WiFi module. To program ESP8266 board with Arduino, we have to "Install ESP8266 Board to Arduino IDE".

Connect USB-to-Serial adapter to ESP8266/ESP-12 board, FT232RL module is used in this example.

Minimal Hardware Setup for Bootloading only

ESPxx Hardware
PINResistorSerial Adapter
VCCVCC (3.3V)
GNDGND
TX or GPIO2RX
RXTX
GPIO0GND
ResetRTS*
GPIO15PullDown
CH_PDPullUp
  • Note
    • if no RTS is used a manual power toggle is needed

Minimal Hardware Setup for Running only

ESPxx Hardware
PINResistorPower supply
VCCVCC (3.3V)
GNDGND
GPIO0PullUp
GPIO15PullDown
CH_PDPullUp
reference: https://github.com/esp8266/Arduino/blob/master/doc/boards.md


Load Examples > esp8266 > Blink

To program ESP8266 board, press the button to connect GPIO0 to GND. Because there are no RTS in my FT232RL module, so I have to power OFF and ON to reset ESP8266 before programming.

Once programmed, power off the board, press the button to release GPIO0, then power on again to run in standalone.



Updated@2015-11-15:
My setup have no RTS, so I add a button to reset the ESP-12 manually.


List of Standalone ESP8266 board posts:
- Install ESP8266 Board to Arduino IDE
- Program standalone ESP8266/ESP-12 WiFi module with Arduino IDE (this post)
- Simple Web Server example of standalone ESP8266/ESP-12 WiFi Module
Standalone ESP8266/ESP-12: web control on-board LED

Install ESP8266 Board to Arduino IDE


With ESP8266 Board installed on Arduino IDE, we can program ESP8266 modules as a standalone microcontroller/board, as simple as program Arduino.


Installing with Boards Manager

Starting with 1.6.4, Arduino allows installation of third-party platform packages using Boards Manager. The ESP8266 packages available for Windows, Mac OS, and Linux (32 and 64 bit).
  • Install Arduino 1.6.5 from the Arduino website.
  • Start Arduino and open Preferences window.
  • Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas.
  • Open Boards Manager from Tools > Board menu and install esp8266 platform (and don't forget to select your ESP8266 board from Tools > Board menu after installation).

With ESP8266 Board Library installed, you can build more project on Standalone ESP8266, without controller such as Arduino.


Program standalone ESP8266/ESP-12 WiFi module with Arduino IDE
Simple Web Server example of standalone ESP8266/ESP-12 WiFi Module

Wednesday, November 4, 2015

Near Field Communication (NFC) for Embedded Applications

Near Field Communication (NFC) for Embedded Applications

This book helps you to get started with Near Field Communication (NFC) programming. This book uses Arduino and Raspberry Pi boards for targeting embedded system. The following is highlight topics:
* Preparing development environment
* NFC programming for Arduino
* NFC programming for Raspberry Pi
* Building Attendance system Based NFC
* Building Payment system based NFC

Wednesday, October 28, 2015

Abusing the Internet of Things: Blackouts, Freakouts, and Stakeouts

Abusing the Internet of Things: Blackouts, Freakouts, and Stakeouts

A future with billions of connected "things" includes monumental security concerns. This practical book explores how malicious attackers can abuse popular IoT-based devices, including wireless LED lightbulbs, electronic door locks, baby monitors, smart TVs, and connected cars.

If you’re part of a team creating applications for Internet-connected devices, this guide will help you explore security solutions. You’ll not only learn how to uncover vulnerabilities in existing IoT devices, but also gain deeper insight into an attacker’s tactics.
  • Analyze the design, architecture, and security issues of wireless lighting systems
  • Understand how to breach electronic door locks and their wireless mechanisms
  • Examine security design flaws in remote-controlled baby monitors
  • Evaluate the security design of a suite of IoT-connected home products
  • Scrutinize security vulnerabilities in smart TVs
  • Explore research into security weaknesses in smart cars
  • Delve into prototyping techniques that address security in initial designs
  • Learn plausible attacks scenarios based on how people will likely use IoT devices

Friday, October 23, 2015

Bluno Beetle Development Workshop

Bluno Beetle Development Workshop

Bluno Beetle is another milestone in wearable electronics device area based Arduino platform, which makes DIY users have more options in the project design. This book helps you to get started with Bluno Beetle development. The following is highlight topics:
* Preparing Development Environment
* Sketch Programming
* Setting up BLE
* Sketch Wireless Programming via BLE
* Bluetooth iBeacon

Tuesday, October 20, 2015

Building a Home Security System with Arduino

Design, build and maintain a home security system with Arduino Uno

Building a Home Security System with Arduino

About This Book
  • Learn what a security system is, how it works and create one for yourself
  • Develop a security system by setting up security cameras and motion detector systems
  • Manage and analyze all the data collected by the sensors from the security system, using a graphical application
Who This Book Is For
This book is for novice programmers and hobbyists who want to understand how Arduino can be used to program a home security system as well as to those who want to delve deeper into the world of Arduino.

What You Will Learn
  • Run cables and electricity to support home security infrastructure
  • Connect Arduino to your programming environment
  • Learn to interact with output devices – alarms, locks, shutters
  • Understand different parts of electronics circuit (MOSFET, resistor, capacitor)
  • Integrate home monitoring and security notifications with monitoring systems
  • Use logical level shifter with Arduino to send and receive data to and from Raspberry PI
In Detail
Arduino is an open source micro-controller built on a single circuit board that is capable of receiving sensory input from the environment and controlling interactive physical objects. It is also a development environment that allows the writing of software to the board, and is programmed in the Arduino programming language. It is used for a variety of different purposes and projects, from simple projects such as building a thermostat, to more advanced ones such as robotics, web servers, seismographs, home security systems and synthesizers.

This book will demonstrate how the Arduino can be used to develop a highly connected home security system by mobilizing a network of sensors which can feed alerts back to an Arduino when alarms are triggered. You will know the current state of security systems, well supported by the designs that fit best for your environment. Also, we will see some current technologies such as NFC, Wi-Fi and Bluetooth, and will finally create a complete web interface that will allow us to remotely manage our system, and even send daily bulletins with the summary of activity.

Towards the end, we'll develop a wireless home security system by setting up security cameras and motion detectors (door and gate trips, temperature sensors). We will then set up a centralized remote access hub (powered by the Arduino) that allows sensors to connect to the wireless home network that can be viewed and interacted by the user.

Style and approach
A step-by-step guide with numerous examples focusing on providing the practical skills required to build home security applications using Arduino.