Wednesday, November 12, 2014

Introduction to Rapid Prototyping: Internet of Things

Internet of Things, or IoT for short, is one of the new big trends in technology, in brief, it is about making everything and anything connected to the cyberspace of the internet, so you can access your home via your smartphone, or make your car talk to you or to other cars, from the smallest temperature sensor on top of your house to the biggest data centers and servers everywhere are going to be connected, though the matter of data security is still in debate but undoubtedly IoT will help to improve many services.

In this article, we will continue the discussion about different platforms for low-cost rapid prototyping, but we will be more specific and target only platforms suitable for IoT applications, compare them from price and technical perspectives. Mainly an IoT platform needs two features:
-        Internet connectivity, the platform must be equipped with some sort of a connectivity interface to the internet via a wired Ethernet, Wi-Fi, Bluetooth or at least with a USB that is connected to PC or a modem to connect it to the internet or any other sort of networks.
-         Web service: an IoT platform in most cases is required to have an onboard web server, not necessarily an advanced one; in many cases just a light weight web server is more than enough to communicate the data to other peers/terminals.

First let’s start with most common low-cost development kits that support network/internet connectivity via Ethernet and Wi-Fi, though they are quite handy for controls applications, compact form factor applications, home appliances and others but requires a lot of work on the low-level programming side, hardware wiring and packaging:  

-        Arduino YÚN: 66.36$
CPU: Atmega32U4 8-bit RISC.
Connectivity interfaces: wired Ethernet, Wi-Fi and USB
Development environment/IDE: Arduino IDE (C -like programming language).
Website:

-        Arduino Blend: 32$
CPU: Atmega32U4 8-bit RISC.
Connectivity interfaces: Bluetooth.
Development environment/IDE: Arduino IDE (C -like programing language).

-        Tiva C Connected LaunchPad: 20$
CPU: 32-bit ARM Cortex-M4/120 MHz
Connectivity interfaces: wired Ethernet, USB (host or device).
Development environment/IDE: TI Code Composer Studio (C/C++), Energia IDE (the Arduino IDE equivalent for TI Launchpad kits, C –like programming language).

-        SimpleLink Wi-Fi CC3200 LaunchPad: 30$
CPU: 32-bit ARM Cortex-M4.
Connectivity interfaces: Wi-Fi
Development environment/IDE: TI Code Composer Studio (C/C++), Energia IDE (the Arduino IDE
equivalent for TI Launchpad kits, C –like programming language).

-        Intel Edison: 50$
CPU: 32-bit Intel Quark/100 MHz.
Connectivity interfaces: Wi-Fi, Bluetooth.
Development environment/IDE: Edison Arduino IDE.
Note: Requires Arduino expansion kit for development and prototyping purposes.

-        Microchip Comm Demo Board: ~50$
CPU: Microchip 32-bit MIPS
Connectivity interfaces: Wi-Fi.
Development environment/IDE: MPLAB IDE and C32 compiler.
Website:

-        PIC32 Ethernet Starter Kit-I and -II: 75$ and 89$
CPU: Microchip 32-bit MIPS/80 MHz.
Connectivity interfaces: wired Ethernet, USB (host & device).
Development environment/IDE: MPLAB IDE and C32 compiler
Website:

Particle Core (formerly Spark Core): 39$
     CPU: ARM Cortex-M3/72 MHz.
     Connectivity interfaces: Wi-Fi.
     Development environment: Web-based IDE using REST API.
     Website: https://www.particle.io/

NodeMCU: ~7-13$
    CPU: 32-bit Xtensa LX3 Architecture (A.K.A. ESP8266).
    Connectivity interfaces: Wi-Fi.
    Development environment: Lua, ESPlorer, Arduino IDE.
    Website: www.nodemcu.com
    Arduino package for NodeMCU: https://github.com/esp8266/Arduino

HC-05 and HC-06 (Serial (UART) to Bluetooth module): ~3.5-5$
   CPU: N/A.
   Connectivity: Bluetooth and UART.
   Development environment: There is no standard development environment for the HC modules, they can be easily integrated with any system that supports standard UART interface.
   Datasheet:
   http://www.tec.reutlingen-university.de/uploads/media/DatenblattHC-05_BT-Modul.pdf

These platforms aren’t specifically designed for IoT applications but they support it through general purpose operating system (Android, QNX, Linux…etc) they operate on, the main advantage of such platforms is the high computational power they offer in comparison to other platforms mentioned previously like advanced webserver/web hosting, running complicated algorithms and multitasking, however, they aren’t suitable for low-power or battery powered applications:
                                                                              
-        Raspberry Pi Model A+: 20$
CPU: ARM11/700 MHz/256 MB.
Connectivity interfaces: USB (host), ability to connect to Wi-Fi or Bluetooth via USB Wi-Fi adapters.

-        Raspberry Pi Model B+: ~38$
CPU: ARM11/700 MHz/512 MB or 1GB.
Connectivity interfaces: wired Ethernet, USB (host), ability to connect to Wi-Fi or Bluetooth via USB Wi-Fi adapters.

-        BeagleBone Black: 55$
CPU: Texas Instruments AM335x ARM Cortex A-8/1 GHz.
Connectivity interfaces: wired Ethernet, USB (host), ability to connect to Wi-Fi or Bluetooth via USB adapters.

-        Intel Galileo: ~64$ (G1), ~75$ (G2)
CPU: 32-bit Intel Quark SoC X1000/400 MHz.
Connectivity interfaces: wired Ethernet, USB host and device.
Development environment: Arduino IDE, Linux port is available for this platform.

Other platforms designed specifically for IoT

-        Kinoma: 149$
Description: A JavaScript powered IoT construction kit
CPU: ARM/800 MHz.
Connectivity interfaces: Wi-Fi, Bluetooth, USB OTG.
Development environment: Kinoma Studio.
Website:  http://kinoma.com/

-        Wunderbar: 199$
Description: Wi-Fi enabled sensor modules (Humidity, Temperature, Light/Color, Motion…etc).
CPU: Freescale ARM Cortex-M4 MK24
Connectivity interfaces: Wi-Fi, Bluetooth.

-        1sheeld: 55$
Description: a platform that uses smartphone as an Arduino shield via a Bluetooth breakout board for connectivity purposes.
CPU: N/A; depends on the smartphone connected.
Connectivity interfaces: Bluetooth.

Update (December, 2014):

Your data to the Cloud:
Cloud platforms for IoT offer internet connectivity & communication, data visualization,  activity monitoring and remote access services for IoT devices/nodes; you can connect your device through any of these platforms to a personal/corporate emailing system, home automation, public access and many other applications, most known cloud platforms to date of the article:
- Exositehttp://exosite.com/ : For data visualization, logging and node's remote control.
- Temboohttp://www.temboo.com/ :data visualization, activity logging, node's remote control, communication via email and other social networking platforms, data storage...etc.
- Nexmohttps://www.nexmo.com/ : For communicating via Short Text Messages (SMS) with your node.
- IBM IoT Foundationhttps://internetofthings.ibmcloud.com/ : For data visualization, logging and node's remote control.
- PubNub: http://www.pubnub.com/ :data visualization, activity logging, remote control.

Last but not least, we all know technology advances rapidly, and all these kits and platforms we reviewed as the latest trend might get obsolete in the near future and something else will come up to replace them, all what I wanted is to give you the first step to get through the door of IoT electronics but my advice is keep developing yourself, update yourself with the latest and don’t wait.
   
The author would like to thank Hesham Omran, a multimedia researcher, for his input and contribution to the article.

--
Karim El-Rayes
Nov. 12, 2014
Vancouver, Canada

An example of a wireless controlled robotic arm over home Wi-Fi network using Texas Instruments Tiva C Connected LaunchPad development kit:

Wednesday, September 24, 2014

Introduction to Rapid Prototyping

Most of the time when a hardware engineer, hobbyists or technical instructor/tutor come up with an idea it takes him/her ages to realize it and build a proof of concept, in this article we are going to list as many of hardware platforms, CAD and software development tools required to accelerate prototyping and realize your idea in a shorter period of time.  
Basically, almost all hardware designs and products include one microcontroller unit (MCU) or more depending on complexity of the design, and usually MCU circuit might get complicated especially if you don’t have a full, clear image of the project, so a development kit would be the best solution, it takes away the burden of building MCU hardware and provide you with generic features to use for testing and prototyping like GPIO headers and easy wiring, LEDs, connectors (USB, DB-9…etc), so, here is a list of most popular low-cost MCU platforms:   

- Arduino platforms: a series of MCU platforms based on Atmel 8-bit and 32-bit microcontrollers, the cheapest one is Arduino Uno for 25$, development environment required: Arduino IDE (free). Website: http://arduino.cc/

- Texas Intsruments LaunchPad (LP) series: another low cost MCU kits based on Texas Instruments 16-bit and 32-bit microcontrollers, LP kits prices range from 10$ to 30$, development environment required: Energia (free) or Code Composer Studio (lite version is available for free).
Energia IDE: http://energia.nu/

- STM32VL Discovery kit: a low cost MCU kit based on STMicroelectronics ARM Cortex-M0 32-bit microcontroller, kit’s price: 15$, development environment required: IAR embedded workbench. Website: http://www.st.com/web/en/catalog/tools/FM116/SC959/SS1532/PF250863?sc=stm32-discovery#

- Cypress PSoC 4 CY8CKIT-049 4xxx: a very low cost MCU kit (for 4$ only) based on Cypress PSoC4 microcontroller platform, development environment required: PsoC Creator (available for free on Cypress semiconductor website).

If you are looking for a low cost connectivity platform for home automation, data acquisition, controls, IoT (Internet of Things), remote access/sensing and computer interfacing applications then these are my recommendations:

MCU kits with Wi-fi connectivity:
- Texas Instruments CC3200 Launchpad (30$)
- Texas Instruments CC3100 (20$) and CC3000 (35$) boosterpacks (i.e. expansion boards) for Texas Instruments Launchpad Kit.
- Arduino wi-fi shield.

MCU kits with wired Ethernet connectivity:
- Arduino Ethernet, price: 51$.
- Texas Instruments Tiva C connected Launchpad, price: 20$.
- PIC32 Ethernet Starter Kit, price: 75$

MCU kits with USB connectivity:
- Texas Instruments MSP430F5529 Launchpad, low cost and very powerful platform for 13$ only.
- Texas Instruments Tiva C (for 13$) and Tiva C Connected Launchpad (20$) kits.
- PIC32 USB Starter Kit II, price: 55$.

But if you have your mind set to add USB connectivity to your design directly then you can use chipsets with standalone USB peripheral controller like:
- FTDI USB chipsets and modules (USB to UART/RS232, RS485, I2C, JTAG, SPI).
- Maxim Integrated MAX3420E USB peripheral controller with SPI.

Or use an MCU with built-in USB module like Microchip PIC18F4550 and PIC18F4553 microcontrollers, but they don’t come pre-programmed with USB stack, you will have to compile the USB stack and program MCU yourself.

For motor control and lighting related applications you will need an MCU with plenty PWM pins and capable of handling real-time control, like Texas Instruments C2000 LaunchPad  for 17$, but usually low cost kits don’t come with power drivers on-board, you will have to build additional circuit for this purpose or buy an expansion board for the kit that provides power drivers.
Note: power drivers are H-bridge circuits, power switches, power transistors.

If you are willing to build your own power driver circuit and control it from an MCU kit then these are my recommendations for chipsets (easy to use, their circuitry aren't complicated):
- L298: Full bridge IC (maximum current: 2A).
- L293B: quad push-pull driver for motor and actuators control (maximum current: 0.5A per channel).
- ULN2803: darlington pair array (8 pairs, each 500mA).
- ULN2069: darlington pair array (4 pairs, each 1.5A).
- L297: Stepper motor controller.

If you want to go more advanced to develop mobile applications and embedded operating systems for entertainment, display (with displays, touch screens or projectors via HDMI), gaming, standalone web-services and connectivity applications using any of the popular embedded operating systems (Android, embedded Linux, Windows mobile/CE, QNX OS) but you don’t want to spend a lot then I would recommend you these kits:
- BeagleBone Black (55$).
- Raspberry Pi (35$).

Second phase, if you are good at hardware and not afraid to build your own boards or willing to learn, these tools are quite useful for schematic capture and PCB layout (i.e. drawing schematics and printed circuit board layout/wiring):

- DipTrace: schematic capture and PCB layout tool, demo version is available for free.
- PCB Artist: PCB layout tool, free.
- Eagle PCB: schematic capture and PCB layout tool, free.

Now your design is ready and you want to build it, you have two options, to build your PCB yourself YouTube is full of videos and tutorials on how to do it OR you can send your design to a professional PCB fabrication/manufacturing services like:

Important note: depending on local preferences and availability choose your PCB fabrication/manufacturing, these aren't the best or the cheapest but the most convenient to me, might be different for you or where you are.
Hardware and software go hand-in-hand in most of modern designs, you can’t develop an MCU based design with writing a firmware for it, and these are my recommendations for software development tools you might need to speed up prototyping for your project:

C/C++ compiler and IDE (all free):

Other useful software libraries:
- DISLIN: C/C++/Fortran library for 2D/3D plotting and GUI design (free for academic and non-commercial use): https://www.mps.mpg.de/dislin/
- Basic4Android: for Android mobile apps development, free trial for 30 days is available: http://www.basic4ppc.com/
- Processing: A programming language and IDE used for rapid prototyping, supports development for both PC and Android OS (free): https://processing.org/
- MoSync: C/C++ Software Development Kit (SDK) and IDE for Android development, useful for rapid prototyping Android apps (free): http://www.mosync.com/
- VISA IVI: C/C++ library for communication with external devices over USB, TCP/IP, serial and PXI/VXI (free): http://www.keysight.com/en/pd-1985909/io-libraries-suite-162?nid=-33330.977662.00&cc=CA&lc=eng&cmpid=zzfindiosuite
OR from: http://ivifoundation.org/shared_components/Default.aspx
- SDL: C++ library for gaming and graphics (free): http://www.libsdl.org/
- GNU Scientific Library: C/C++ numerical library (free): http://www.gnu.org/software/gsl/
- HIDAPI: C/C++ library for communication with USB-HID devices (free): http://www.signal11.us/oss/hidapi/


--
Karim El-Rayes
Vancouver, Canada
September 24, 2014