Blinking an LED on the Raspberry Pi

Introduction

The Raspberry Pi offers an array of general purpose Input-Output pins(GPIOs) which enables software running on the Linux computer to sense events in the physical world as well as effect it in very simple ways. A software program can be used to read a switch or even a sensor connected to the GPIOs in addition to the ability to send electrical signals out. For example, a user program can be used to read a simple push button which in turn can be used to trigger events in software. The user may also elect to control a single LED by switching it ON and OFF to reflect events in software.

Continue reading “Blinking an LED on the Raspberry Pi”

TI Econo Launchpad for DIY People

A quick post here. I have been working with TI’s MSP430 recently and will all the excellent community support, I thought I should give something back. I just released a beta version of a small Economy launchpad for the G Series at https://github.com/inderpreet/MSP430EconoPad
and you can download the Eagle Files as well as the Gerbers from the Releases tab.
Here are some features:
> Fits in 5cm x 5cm
> Onboard 3.3V Regulator
> I2C Headers for 3V3 AND 5V0 communication
> Also has a mounting Hole!

This small board can be fabricated on the cheap and you are welcome to clone and modify. Just gimme a shout out on http://www.twitter.com/ip_v1 if you find this useful.

Thanks and enjoy.

Screenshot 2016-03-17 13.28.26

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.

Energia?

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 http://www.ti.com/lit/ug/swru372b/swru372b.pdf

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

https://e2e.ti.com/support/wireless_connectivity/simplelink_wifi_cc31xx_cc32xx/f/968/t/399389 and there are 80Kbs used for internal purposes. The service pack release notes at http://processors.wiki.ti.com/index.php/CC32xx_Release_Notes 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 http://www.ti.com/tool/uniflash and when your run it,

Image.png

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 http://energia.nu/cc3200guide/

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

https://vine.co/v/ibgzEB13bKp/embed/simplehttps://platform.vine.co/static/scripts/embed.js

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

Thanks again,

Cheers,

IP

[RPi Rover] Another Raspberry Pi Robot – Episode 2 – Starting Python

Raspberry Pi Rover

Introduction

In the last post, I described the hardware part for our robot which uses the Seeed Studios GrovePi+ since I am yet to receive my kit. In this post, I talk about the software part and making the robot move. Lets see what we can do. Continue reading “[RPi Rover] Another Raspberry Pi Robot – Episode 2 – Starting Python”

[RPi Rover] Another Raspberry Pi Robot – Episode 1 – The chassis

Introduction

I have experimented with Raspberry Pi Robots in the past but I wanted to make a generic Robot that you can use practically. This series is about making a Robot using scrap and as many things as you can find in the house and then make it useful and solve a problem. In this post I start by making the chassis. Continue reading “[RPi Rover] Another Raspberry Pi Robot – Episode 1 – The chassis”

Tutorial on setting up Sierra Wireless Air Vantage with your Custom IoT Device

Prelude

The challenge is to create a system for air quality sensing which can operate without human intervention. My idea is to create a system that can measure air quality indoors and outdoors and log this data to the Sierra Wireless System. For the indoor unit, I have a CC3200 power unit which can measure temperature and an MICS5524 sensor which can measure air pollutants and connects to the cloud over wifi. It is powered by the TI Fuel Booster Pack and charged wirelessly with the Wurth Electronics Wireless Charging System. All parts are TI and Wurth Electronics. Continue reading “Tutorial on setting up Sierra Wireless Air Vantage with your Custom IoT Device”

Seeedstudios Groove Pi+ Pre-Review Part 1

Introduction

SeeedStudios has their own system of prototyping hardward called Grove which uses four pin connectors to connect sensors, actuators and subsystems together to a central controller which can be arduino based or MSP430 based. Recently, they have introduced an interface to the Rapberry Pi called the grovepi+ which is a Raspberry Pi Hat with an Atmega328P which allows the RPi to take advantage of the grove widgets. I was one of the people who got their hands on one of the pre-review units in a Kit form and I decided to do a little something with it. In this article I will go through the basic kit and it’s contents and my first impressions since this is the first time I am using the Grove System. I had a few preconceptions and I will discuss my experience with the kit so far along with a project plan I have going. Lets go! Continue reading “Seeedstudios Groove Pi+ Pre-Review Part 1”

A guide to the CC3200

Prelude

The challenge is to create a system for air quality sensing which can operate without human intervention. My idea is to create a system that can measure air quality indoors and outdoors and log this data to the Sierra Wireless System. For the indoor unit, I have a CC3200 power unit which can measure temperature and an MICS5524 sensor which can measure air pollutants and connects to the cloud over wifi. It is powered by the TI Fuel Booster Pack and charged wirelessly with the Wurth Electronics Wireless Charging System. All parts are TI and Wurth Electronics. Continue reading “A guide to the CC3200”