Starting Out with the Cypress PSOC Analog Co-Processor Pioneer Kit


This week I take a look at the Cypress Analog Co Processor Kit. The official website is at and in my video, I take a look at the PSOC Kit as well as the PSOC Creator Software.

Like and subscribe to support!


BBC Microbit Line Follower pt-2


The BBC microbit is a simple development board for children to learn programming with and has been distributed to schools in the UK free of cost. You can buy the BBC micro:bit individually or in kit form with basic add ons from Kitronics in the UK here[LINK}

In the first part, we studied how to detect a simple line using the BBC microbic and a simple circuit using some jellybean parts. In this part, we go through the concept of a motor driver, the basic circuit and controlling DC motors with the BBC microbit. We then move to add the motors to a chassis and then write the basic routine to make the robot follow a simple line.

Click here for the previous post.

Here is a video tutorial and demo video for the project part 2

The Motor Driver

The L293D is a dedicated motor driving chip with 4 half H-bridges or two full H-Bridges which can be employed to control the direction two connected motors. You may choose to make an H-Bridge using transistors or even MOSFETs on a strip board etc but the single chip solution is simpler and quicker. The pin diagram and connection diagram for the L293D is shown below.


The GPIOs in the BBC Micro:bit can be used to set the speed and direction of the motors however for this exercise, we will only be interested in modifying the direction of the motors. Since the GPIOs available on the breakout board also include the ones used for onboard peripherals such as the matrix display, we must select the ones that are unused. Take a look at the pinout diagram below. We need four IOs out of which two are used for direction and two are used for speed or turning the motors ON and OFF.

Forming a chassis

After connecting the motor driver and motors, we need to put everything together along with a chassis, wheels and our sensor board. I have made a simple chassis, but you can create something more elaborate and used different parts according to preference. The sky is the limit. Add batteries and we are good.

Write the program

We will continue using touch develop to make the program and i order to make the decision to turn right or left or move straight, we will add an IF-THEN-ELSE ladder within the loop we created the last time. The program can be downloaded as a file using the link provided at the bottom of this page. Compile the code and upload the hex file to the BBC Micro:bit.

Create a track and test

In order to follow a line, we need a line for which we use some black water colours and a white paper sheet. Draw a simple circle initially to test out the functionality. Make sure that the line is not too thick else the sensor will have problems detecting turns and will get stuck easily. We just need the line to thick enough that it is detected by each of the sensors individually.
Test her out.

Let me know what you think in the comments section and give a like and subscribe to the youtube channel for more.
Happy hacking.

Intel Edison based Garden Management System


A lot of people think about starting gardening as a hobby and some even imagine growing their own vegetables and fruits at home. However as a consequence of busy schedules, most of us will never get the time to maintain the garden the way we want. Plants need consistent care and look after to flourish and bear fruit and with the advent of technology, we may be able to setup an electronic system to take over the chore of garden maintenance. This is the premise of our project, Edison The Gardener.

There are two common types of growing solutions that are common these days.

a. One is the standard growing in the soil gardening where we use soil mixed with organic fertiliser to grow plants. Plants are planted in the soil and we only need to add water and light. In our setup, we use large pots to grow plants in direct sunlight and watering as well as soil measurement is done via the Intel Edison.

b. The second is called a hydroponic system where instead of soil we use a different medium to grow plants and the nutrients are supplied as a part of the liquid system. In our setup, we use perlite as a growing medium and use liquid nutrients pumped in a Flood and drain system. The nutrient liquid is pumped into the tray and kept there for a time and then drain afterwards and cycled.

Our project is designed to cater to both these needs and can be extended as per requirement.
Here is a demo video of the final system:

For more information, please visit the following reference links.

Desired Features

For this system the following features were consider desirable and were user as a system specification to design around.
1. A SMART garden watering solution for the traditional garden which is able to track the irrigation cycles and the moisture levels of the system. Since we are talking about IoT we should be able to take advantage of the facilities of the internet namely the Weather Service. The system should be SMART enough to not water the plants if the soil is already wet OR if rain is predicted in the near future.
2. A solution for indoor gardening with lighting and temperature control and monitoring. We want the ability to grow off season crops that we can plant in a small greenhouse or our own kitchen and for that we need to control additional elements of lighting and temperature inside.
3. A hydroponics system which can be monitored and controlled via a GUI. Instead of a traditional hydroponics timer, we use the advanced capabilities of the system to remotely measure and control the operation of a hydroponics system. We want the ability to set complicated rules for the control of our hydroponic growing system
4. A data logging facility to track various parameters. We need to be able to log the system data for analysis by expert should our garden begins to fail.
5. A visual data display for all measured quantities. We understand that data visualisation can help understand monitored data better hence we want the capability to see the data in a graphical way over the internet.
6. A configurable alert system for events. We want the capability to set alerts for certain events such that corrective action can be taken. If possible we would like the ability to get alerts on our Android devices.

Wow! Thats a lot of desired features but thanks to the incredible power of the Intel Edison and simplicity of Node.js and openHAB, we were able to get all that done… and more.

Designing the System

The hero of our system is the Intel Edison with the SeeedStudios sensors kit. A basic block diagram of the system is given below which shows the various elements of the project.


The diagram shows there are two sub setups which are explained as follows:
a. The outdoor setup.
The outdoor setup consists of a soil based configuration for growing plants. We have chosen large pots with soil and fertiliser and these are placed outside in the sun. A water reservoir has a pump that can be switch on and off using the intel Edison and we also have a moisture sensor to detect the condition of the soil.
b. The Indoor setup.
The indoor setup consists of a hydroponic setup with a nutrient solution tank, a flooding pump to fill the hydroponic tray, a drain pump to empty it. We also have a artificial lighting lamp with a UV light as well for indoor lighting and sensors to detect the correct operation with a light and temperature sensor. The Flood tray also as water sensors to detect incomplete filling of the tray indicating insufficient water or a defective water pump.

In addition to these, we have the Intel Edison with the SeeedStudios grove sensors which is connected to a local Intel Galileo. This Galileo hosts an existing home automation setup using OpenHAB. It is also connected to the internet via the local network and Wifi and talks directly to the Intel Analytics Cloud to log and graph data.

The software architecture is explained in the diagram given below.


The Intel Edison runs a Node.js script that initialises the peripherals, drives the sensors and actuators, converts the data into human readable form and exposes an API to remotely control everything. Essentially, the Node.js script subscribes to an MQTT broker on a particular topic and waits for commands. There are some low level tasks taken care of as well such as making sure nothing overflows etc but the API is used to get and put data from the Intel Edison. In addition to this, there are dedicated sub tasks to post sensor data periodically to the Intel IoT Analytics Cloud. Hence the cloud analytics section can function independently of any control.

The sensor data is also retrieved by OpenHAB which has a set of rules that are used to control the system. The logic part as well as the GUI is created using OpenHAB running on the Intel Galileo. A local version of the data is also captured in a MongoDB for creating graphs etc.

The GUI generated by OpenHAB is shown in the image below.

The library support by Seeed and Intel for the sensors and actuators is phenomenal and are available here:

The two setups Outdoor and Indoor are made separately and are explained in steps a-b and c-d respectively. The setup of the Intel Edison is explained in steps e-f so if you would like to skip to a particular section, feel free.

Setting up a DIY Soil Garden

The first step is to create a small soil garden and in our setup, we used a variety of pot which ranged from large enough for growing vegetables and smaller ones for herbs.

The next step is to put together some soil which is free from rocks etc and which has been heat treated to get rid of any pests etc. In our setup we added 50% soil with 50% organic manure locally available and mixed it together. The pots were drilled small holes at the bottom for the water to flow out and we placed jagged rocks around the holes so that they do not get blocked by flowing dirt. The soil was then potted as a dry mixture and all the pots were set aside.

Next we purchased some quality seeds for chillies and eggplants and germinated seedlings for tomatoes. The seeds were planted 1-2cm deep while the tomato seedlings were planted deep enough to cover the entire root system. These are cover with the soil and patted down a bit and then watered heavily because the soil will need a lot of water the first time.



We also recycled an old cabinet drawer as a herb garden where we laid out a sheet of plastic across the entire inside of the wooden construct.

Next we drilled out a hole for a place where the water should drain and then added a piece of pipe to it though the plastic sheet. We then used a sealant to make the whole connection water-proof. Next we laid out the bottom with small rocks to form a layer where the excess water can drain through. The drawer is placed such that there is a slant towards the drain hole.

IMG_0104 IMG_0105 IMG_0112

Next we positioned the pots and the herb garden next to a windows through which the pipe and cables for the sensors will come through. This is done because in our setup we also have an indoor setup which is controlled by the same Intel Edison. An irrigation pipe is brought through the entire setup and circulated. Small holes are cut in the rubber tubing such that water can flow out and into the pots etc. The pump is chosen such that it has the capability to generate the necessary pressure.


You can choose to decorate and make things pretty as per your convenience. In our setup, we used paint to make the pots and bricks the same color as well as the garden area was covered with small pebbles to improve the aesthetics. With this, the outdoor setup is complete and all we need to do is connect the pump as well as the sensor to the Intel Edison. That is explained in later steps.


Setting up a DIY Hydroponics Garden

A hydroponics system is a soil-less growing system where the potting media used does not retail water like normal soil. There are many subtypes and these can be understood by visiting [LINK TO Hydroponics] The one we used is the Ebb n flow hydroponics where the plants are placed in a tray and the water with the nutrient mixture is pumped to flood the tray for some time. Then this tray is drained and the mixture is returned to the reservoir. This saves water as well avoids the drawbacks of the typical soil garden.

In our setup, we used perlite as a medium which was purchased off ebay. This perlite is washed with water and chlorine and the granules are dried.

We used plastic cups and cut multiple slots(Smaller than the perlite granules to allow outflow and inflow of water. You may also use netted materials as well to retain the perlite if the small slots do not work right for you. Two such glasses were sandwiched together to form a barrier to retain the perlite. Pebbles were placed at the bottom to allow the containers to be weighed down and not float up as the nutrient solution is pumped.


These are then filled with perlite and a group of six such vessels were arranged in a plastic tub. We fitted the tub with water tight glands to allow connecting the water pipes. You can choose to use smaller or larger glands to suite your needs.


We use a plastic tray to act as the flood tray and we fitted it with a gland for the drain connection at the bottom and one gland near the top to act like an overflow should the sensor ever fail. Scotch tape was used to hold the planers in place because the flooding water will make them float up. Water should slowly creep up into the perlite as well as drain out easily.

b c
We were able to fit six planters in one tray. Two buckets are used as reservoirs to hold the water for the Soil Irrigation system as well as the nutrient mix for the Hydroponics system. Two submerged pumps are deployed as shown.


For the Lighting system we used a table lamp with a CFL lamp and added a UV lamp to it. For our experiment, we salvaged a UV Lamp from an old water purifier.

IMG_20151025_141900 IMG_20151025_144223
All these elements are setup on a table inside our room which will act like a greenhouse. We used a SeeedStudios Pump to drain the hydroponics system and its simply setup to pump the water back into the reservoir. For decor we employed some hand made chart and cardboard box backs. Paint and coloured tape was used to make things beautiful.

This readies our Hydroponics hardware.

Setting up the Sensors and connecting the motors and Lamp

The Sensors are all connected via the SeeedStudios Grove System. The parts include:
a. Seeed Moisture Sensors
b. Seeed Water Level Sensor
c. Seeed Water Pump
d. Seeed Relays
e. Seeed Light Sensor
f. LM35 as a temperature Sensor
g. Seeed Gas Sensor

We used a grove base shield to connect all the parts and to mount the sensors, we designed and 3D Printed a simple stand.

1 IMG_20151024_193817

We needed more relays hence made a few expansions ourselves. WARNING: Working with mains is dangerous. Adult supervision is a must for kids. A single PCB with a BC547 to drive the relays was made and enclosed in a small plastic casing.

11 12

In order to connect the Lamp and the Pumps, the following diagram was created and followed:
[Image for Electrical Connects]

The sensor wire for the moisture sensor had to be very long and was created using wire from the local hardware store. We soldered the ends so that there were connectors at both ends.


The level sensor for the Hydroponics tray was strapped in place using scotch tape and we made sure the sensor face did not touch the wall. If it does, it may retain moisture and give a false sensor output even when the tray is empty.


This readies the basic sensor setup.

Creating an Enclosure for the Edison and 3D printing a mount for the sensors
We wanted to do something different for the enclosure and so a pyramidal design was chosen. We use a cardboard mockup to size up the required enclosure.


Once the size of the faces was verified, we then proceeded to cut acrylic sheets to form a pyramid shape for our enclosure. These sheets were glued together to form the final structure and a small stand was also constructed for the LCD. One side is left open for airflow for the sensors.


This finishes the hardware part of the build.

Setting up the Edison, Intel IoT and Intel XDK
The Intel Edison can be programmed via a multitude of ways including Arduino IDE, Python and Node.js. Intel XDK for Node.js can be downloaded from Intel’s website and the links are given below.
Setup guides for the Edison:
Setup guide for the Intel Iot Cloud:
Intel XDK Downloads:
Static IPs on Edison:

The program is written to be a service that will send and receive data via MQTT to a local MQTT Broker service. The Edison periodically sends data to the Intel IoT Analytics service as well for logging.



Setting up OpenHAB

A guide to setting up OpenHAB is given on my blog at:

These instructions may change with time hence are located externally.
Here is the link to the OpenHAB wiki where a lot of use cases have been already explained.

Configuring rules on OpenHAB is quite easy and works in a scripting language similar to javascript.

Our openhab configuration is attached at the end. Simple copy these files to their respective directories and you are good to go.

MQTT brokers and setup a local connection
An MQTT broker runs on the Edison itself at port 1883 so no need to sweat. We just need to connect our openhab to it so we need it’s IP. Here is an example of a simple switch with MQTT.

Concluding remarks

This project is lot bigger than an instructable and we are making a dedicated page on my blog for it. The objective of this instructable is to give you pointers on where to start. Where you take it from there is upto you. This project and everything in it including the Hardware, software and presentation was done by me and my wife. If you like our project, give it a vote. Me and my wife worked pretty hard to put things together and we appreciate you taking the time out to go through this instructable. We hope it can be useful for you as well.

BBC Micro Bit – A Line Following Robot Part 1

The BBC Microbic is a small ARM based, user friendly, micro controller targeted towards computer education in the UK. It has been developed by the partnership of a long list of organisations including Microsoft, Element14, Nordic, NXP and many more. (Click here for the wikipedia link)

Continue reading “BBC Micro Bit – A Line Following Robot Part 1”

Designing an IoT Modular Light feat. TI

Its been a while since this project and I really havn’t had the time to write a blogpost in a while. Last year, I made an IoT light for the roadtest plus where I used a lot of technology from Texas Instruments and Wurth Electronics. TI was kind enough to showcase the build on their power house blog and I wrote a two part series for the same.  Continue reading “Designing an IoT Modular Light feat. TI”

Setting up a CC3200 with Energia

Introduction & Background Bits

This blog post is part of a Project titled “IoT Lamp” and also serves as a tutorial for the CC3200 and Energia beginner.

I wanted to have a wireless connection to the light so that I may be able to control the color, brightness etc like in the case of phillips hues. I however wanted something that I could modify to have four channels so that I may use my own make and color of LEDs. This ofcourse later will be used for a hydroponic garden I have already setup BUT right now the point is to have a wireless connection. I had an assortment of options from 433MHz AM modules, to a cc2500 with MSP430 or Si4455s or LPRS eRICs or even my fav CC110L. I even bought a Cypress PSoC BLE kit to experiment with because writing firmware can be a tad bit boring at time. At this point I decided to try out Energia with the CC3200 and I had tried it before but I have had… issues.

My past experiences involved messing with service packs and there were a lot of problems with the REV3.2 board and the newer service pack. Long story short- it did not work out then and now I have a new project and so Energia was given a go.


Skip this section if you have already used energia. So what is Energia? Energia is TI’s delayed answer to Arduino- Simple! AVRs rule the DIY world because they are easy to use and that is due to the enormous community and the arduino IDE. Its based on processing IDE and is written in Java. The compiler is GCC and it can be ported to most OSs and for the most part, you don’t need to ‘install’ anything. Just copy the whole folder and bam! You are ready for the show. No messy configurations etc. You select the boards from a list and there is a library of demo code which comes with the thing, ready to go.
The downside? Its more or less based on prewritten C code like if you want to set a pin HIGH, then you call

digitalWrite(myPIN, HIGH);

which in turn passes your arguments to somewhere else and then the compiler is supposed to convert it into assembly blah blah blah. You get the point. In short, if you are an absolute control freak(like me who has memorized ASM for 8080, 8086, 8051 and AVR to the instruction cycle- I teach this stuff to undergrads!) you will never be truly happy. That is one of the reasons why I usually go Assembly or C that I know how to write and which I can predict most of the time. Energia comes in when you are either a beginner or a non-engineer or a lazy engineer 🙂 … like me in this instance. There is library for getting wifi up and running and that was my interest here. I did write a C application for a few CC3200 projects sometime back but I am not going to talk about that here. Maybe later.

Setting up the launchpad

Sounds interesting but its actually just a sequence of steps that you have to follow… EXACTLY OR YOU WILL DESTROY TIME AND SPACE!!!!

Just kidding. The CC3200 is a pretty tough cookie. Here is what you do.

If you have just taken out the LP out of the box, you should check the version of the board and the silicon. There are labels in the board that identify it like in my case REV 3.2 which tells me that its not the latest board and the latest software or firmware updates may not work for me. See the images below from

Screen Shot 2016-01-08 at 9.40.10 AM

Screen Shot 2016-01-08 at 9.38.01 AM.png

Next we need to checkout the part or silicon number. In my case it is the XCC3200HZ which is preproduction version as per and there are 80Kbs used for internal purposes. The service pack release notes at also tell us that the device is indeed supported. Cool! Lets move on.

Screen Shot 2016-01-08 at 9.46.44 AM.png

For our exercise we want to use the Energia platform and in my case i had already use my launchpad for previous applications. Hence I downloaded and installed the standalone version of uniflash from and when your run it,


There is an option to ‘Format’ which is what we need to do. Connect a jumper as shown in the image below and then the launchpad to the USB port. Type in the correct port number and when it asks for the size, simply enter 1MB.

Image [1].png

Image [2].png

At this point, my launchpad is pretty much good to go. Note that if you are trying to update the firmware, the instructions can be found

Doing the Energia

The CC3200 is an internet on a chip device so instead of the conventional Blinking LED, I setup the MQTT Demo. Start Energia and then… Follow the screeshots…

The Hello WiFi example is pretty straightforward and all you need to do is supply the Wifi Access Point Name, password and MQTT Topic. Done. To program the board, again connect the jumper as before and then reset the launchpad. Next use the Energia’s Upload button and it should tell you that the board was successfully programmed. Take out the jumper and reset the board and when you do, it will connect to the access point and start sending messages via MQTT. Use your favorite MQTT Client to subscribe to the topic you mentioned and you should see the CC3200 talk!

Screenshot 2016-01-11 01.22.23

Screenshot 2016-01-11 01.22.55

I hope this helps you and if does add a comment and share.

Thanks again,