I am exhibiting at the World Maker Faire (September 23 – September 24)

August 24, 2017

I haven’t been actively maintaining my blog these days. I recently moved to the Buffalo, New York area and settling down. I am willing to keep up with my blog posts. I have some great news to share with my readers.

My brother and I are going to be exhibiting at the World Maker Faire on September 23rd and 24th, 2017 in New York City. We are going to be showing off a DIY Personal Health Dashboard.  We have been working on a visual aid that motivates one to stay physically active.


I plan to share my progress of our dashboard through the different stages.


We look forward to seeing you there.


The S.F. Bay Area is not a haven for the electronics hobbyist!

November 29, 2015

Note: This post is not a hate fest!

I realized this when I was at the Orange County Microcenter in SoCal to get my hands on the Raspberry Pi Zero.

Yep, you read that right! I had to drive 392 miles to get a $5 Raspberry Pi Zero! I plan to share the details of my trip in a later post. While I did this trip for fun, it is quite difficult to buy some discrete components in the Bay Area.

Chicago v.s. S.F. Bay Area


I lived in the Chicago suburbs for 2 years and 3 months before I moved to the Bay Area in May/June 2014.  While living in Chicago, I had several options to buy discrete electronic components:

  • Microcenter– (2 stores in Chicago!) – Carries a lot of DIY kits (I am not talking about the Arduino and Raspberry Pi). Open Sundays.
  • American Science and Surplus (Milwaukee/Foster Ave neighborhood) – This store sells stepper motors, cool DIY science kits, test tubes, conical flasks etc. Open Sundays.
  • Chicago Electronics Distributors (Winnetka)- A distributor of Adafruit products. This guy is awesome. He used to let me arrange a late evening local pickup for emergencies.  I do not recall buying anything on a Sunday from this guy.
  • Fry’s electronics (Downer’s Grove) – The Chicago store is somewhat far away from the city. Open Sundays.
  • Radio Shack – This is no longer an option but Radio Shack carries a couple of components.

Given these options, I could always find a part locally (unless my requirement is very specific/exotic).


There are 3 hackerspaces in the Chicago area. Pumping Station 1, Workshop 88 and the South Side hackerspace. I was a member of Pumping Station 1. It was so easy to build your own enclosures using a laser cutter. Pumping Station 1 is easily accessible from different parts of the city and the starving hacker membership was approximately $40 a month.

S.F. Bay Area:

  • Radio Shack – This is no longer an option. Radio Shack has gotten rid of a part its DIY electronics shelf. Now you could buy some basic accessories like solder.
  • Fry’s electronics – Open Sundays. You could buy some discrete resistors, capacitors etc. Arduino kits etc are ridiculously expensive.
  • Jameco – They have  a store front in Belmont. They are open only Mondays to Fridays, 9 a.m. to 5 p.m.. It is best to order your stuff online and pick it up. They sell a variety of discrete components, kits etc. They do have an online chat support to discuss your order. Good luck driving from San Francisco to Belmont in rush hour traffic.
  • oddWires – This store also allows local pick up but only on week days. I have never used this store as it is very far away from where I live.
  • Hobby engineering – This store provides pickup on all days of the week upon prior arrangement. Their store collection is not so extensive and I never had the chance to use their business.
  • Evil Mad Scientist (Sunnyvale CA) – A re-seller of Adafruit products and they also carry a lot of DIY electronics kits.  The pickup option is available only on week days during business hours.
  • Al Lasher’s Electronics – This store is open 8:30 a.m. to 5:00 p.m. on all week days and 8:30 a.m. to 2 p.m. on Saturdays.  They are a distributor of Sparkfun and they do sell a vast variety of components that peeked my interest.



A sign inside Al Lasher’s electronics


Al Lasher’s electronics, Berkeley CA


If you have plenty of time in your hands and if you are trying to buy an Arduino or a Raspberry Pi, you can try crawling through craigslist. If you are lucky, there might be some one in your area who is trying to getting rid of their electronics stash.

Arduino_Raspberry Pi

Search results for arduino in the SF Bay Area Craigslist

Update (06/21/2017): A reader left a note in the comments about HSC (Halted Electronics) and Anchor Electronics in San Jose. I have been to Halted Electronics in San Jose. It is a big store and they carry an array of components but you have to be patient going through different aisles. If you are looking for cheap DC motors, HSC is a great resource. I haven’t been to Anchor Electronics. Thanks Travis!


I learned of 2 hackerspaces in the Bay Area namely Noisebridge and Tech Shop that is equipped with tools like a laser cutter. While TechShop is a bit pricey, applying for Noisebridge’s membership is a tad complicated.  You need two members who could potentially support your membership application. This is probably to prevent abuse of the hackerspace equipment. Given my socialization skills,  securing a membership is next to impossible.  I decided to navigate this situation by getting my own 3D printer.

It might appear that the Bay Area has several options for a hobbyist. It is just difficult getting to these places when they are open.

As you may have noticed, most of these places are open only on week days except for the hackerspaces. The traffic in the Bay Area is insane until around 7 p.m. (more like 7:30 ish). Most of these stores are closed for business by 7 p.m..

When I was at the Orange County Microcenter to buy the Raspberry Pi Zero, I recalled all the options I had back in Chicago.  I was told that there used to be a Micro Center in the Bay Area but they had to shut down.


Fully stocked aisles at the Micro Center

The Bay Area is home to a lot of semiconductor manufacturers, smart device manufacturers etc. Yet, you have to go online to buy parts for your project.

As the title states, the S.F. Bay Area is not a haven for the electronics hobbyist.

P.S.: If you know of a great resource that I missed here, leave a comment.

Notes from the Sigfox “Connect your city” Hackathon

November 24, 2015

I attended the Connect your City hackathon organized by Sigfox and the city of San Francisco. It was absolute fun.

What is Sigfox?

Sigfox is a European company that has installed low power wide area networks across several cities in Europe and San Francisco.  Sigfox’s radio network enables interfacing low power sensors to a network enabled by radio transceivers installed in San Francisco’s public libraries.

This radio network enables transmitting a 12 byte message at a time and it is capped at 140 messages per day. This network is very useful in the case of interfacing sensors that do not provide real time updated. For example. sensors that report their status every hour or so, panic buttons that transmit emergency alerts to first responders etc.

The Hackathon

In the hackathon, teams were given the Texas Instruments Sigfox boosterpack, access to the Sigfox backend, assistance from Microsoft’s Azure team and Plasma/Connect2me. The hackathon’s objective was to build proof-of-concepts that would have a civic impact in the city of San Francisco.

My team’s project

My team picked a project that enabled collecting information related to the number of people assembled in any room of a building. This information is transmitted to the Sigfox network in the event of an earthquake (detected by an accelerometer installed in the building) or whenever a panic button is pressed.

We also used a PIR sensor, temperature sensor and a force detecting sensor to simulate events like large pillar columns falling down, buildings catching fire etc. This information could be used by first responders to effectively deploy resources in an emergency.

We built two gadgets. I built one of them and is shown in the figure below. It includes a panic button, temperature sensor and a force detecting sensor.


Gadget that I built includes panic button, temperature and force sensors

My team mate Yingxian built another radio that gathered information from an accelerometer and a PIR sensor.

photo (4)

Photo Courtesy: Yingxian Wang

The radios transmitted the messages to the Sigfox radio network. The transmitted messages were supposed to be used for visualization in a web dashboard like the one shown below.



Dashboard by Tim Strickland

How does this gadget work?

The figure below provides a simple description of how these radios interact with the “cloud”.


We got an unlimited evaluation license for our radios and our radios did not have any daily cap on the number of messages that could be transmitted to the network for development purposes.

The radios were very easy to use. They transmit any message received through the serial port. We used an Arduino Yun to interface our sensors. The Arduino Yun transmits the message to the radio via serial port. It also talks to a processor running linux on the Arduino Yun. Here is a short video of my project: It sends an emergency alert to the Sigfox network and plays an audio alert.


Here is another video where we simulated an earthquake. My teammate,  Yingxian wrote the code to detect earthquake like movements to detect earthquake simulations using an accelerometer.

My team

I met my team mates at the hackathon and I am amazed by how we were able to get along with each other. Here is a pic of my team after the hackathon prizes were announced.


Left to Right: Yingxian, me, Tim, Louis, Albert and Alex.

Who were the winners?

AudioArgus – A team that built a service that predicts faulty rotary/reciprocating equipment requiring service and alerts the city about it. I see this as a project that enforces behavior change using the Internet of Things.

Dry Water – A water sprinkler controller project that considers several weather factors to turn on/off a sprinkler. I see this one also a behavior change tool by building connected devices

There was also a bike project that enabled enhancement of bike rental experience. I am not sure that I am able to recall the project’s theme correctly.

  1. The radio network’s coverage spans between parts of San Bruno in the San Francisco Bay peninsula, Hayward in the eastern side of the Bay, parts of Marin County and Berkeley.
  2. The sketch used to transmit messages is available from here.

What next?

I had fun working on this project last weekend. This has motivated me to register for another smart city hackathon on December 5th. If you are interested in working on a similar project (not the same one) at that hackathon, you should write to me @ yamanoorsaiatgmaildotcom or ping me via twitter using the same handle.


Flashing an Arduino Mega 2560 with firmware stored on a micro SD card

May 31, 2015

I was trying to determine if it is possible to remotely flash firmware on an ATmega2560 microcontroller using a micro SD card. I came across this repository of an ATmega2560 bootloader that flashes the microcontroller’s flash memory when a particular address on the EEPROM (Address: 0x1FF)  is set to the value ‘0xF0’.

When the microcontroller is reset, if the EEPROM value(at address ‘0x1FF’) is set to ‘0xF0’, the bootloader looks for a file ‘firmware.bin’ on the SD card and flashes the microcontroller with the new firmware.


Adafruit Music Maker shield mounted on the Arduino Mega2560

I had to make minor modifications to make use of this bootloader. I changed the Chip Select pin number of the micro SD Card (there are tutorials that explain how SD cards are interfaced to microcontrollers) in the macro definition to match that of the Adafruit Music Maker shield (the micro SD holder’s chip select pin is connected to Digital Pin 4 of the Arduino. This corresponds to pin 5, PORTG on the ATmega2560. Source: Arduino Mega 2560 schematic).

In the file asmfunc.S, I changed the CS pin to pin 5 on PORTG:

I also had to change the pin number of the LED used to indicate the progress of flashing the microcontroller by the bootloader.

After recompiling the bootloader’s source files, I flashed the new bootloader using AVR ISP MK II. I also had to make sure that the BOOTRST fuse was set in the ATmega2560’s fuse settings.


ATmega2560 fuse settings

I compiled an LED blinking sketch and converted it into a binary file by executing the following command:

Note: The Arduino IDE compiles and stores its hex files in a temporary directory. In order to save the hex file upon compilation, edit the IDE preferences after closing the IDE. The preferences text file can be located at File–>Preferences


Arduino IDE preferences

A line build.path has to be added to the preferences file. I included the path where the output of the compiled Arduino sketch would be located. I used Atmel Studio to convert the Arduino sketch’s hex file to a binary file (the avr-objcopy command shown in the above code snippet). I copied the binary file onto a micro SD card and inserted into the music maker shield’s micro SD card holder.

I made use of this sketch to set the value ‘0xF0’ at the address ‘0x1FF’. Upon reset, the bootloader flashed the microcontroller with the binary file located on the SD card.

Things to investigate:

1) When I was looking for a bootloader that would flash a microcontroller from an SD card, I read about problems encountered by others. I found out that people had problems using certain types of micro SD cards. I did have a hard time getting the bootloader working but it was due to the fact that I did not set the BOOTRST fuse.

Do let me know if you have used this bootloader or something similar in the past.

Starting to program with your FreeDuino

November 16, 2009

For those who aren’t aware of Arduino boards, I am posting some basic information.

Arduino is an open source hardware provided with a Free IDE. The information about Arduino Boards are available at :


As a beginner, you might not be proficient in soldering circuits and debugging them.  It is better to purchase an Arduino board that is readily available in the market.

If you are from India, one of the vendors in India for the Arduino boards is :


They are based in Pune and they are quite helpful in shipping the material and assisting you with all the necessary information. Their sales team was quick enough to answer to my queries.

In my opinion, 600INR  is worth spending on this board.

You may download the IDE from :


However, there are lots of constraints with this software like:

If you are using a low bandwidth connection, you may feel that the file size is quite large ( 80 MB).

It requires a Java run time engine ( that was not a problem for me at least ). Imagine a high school kid or a someone who is very new to computers and electronics trying to start with Arduino.  These minute details need some attention!

However, an Arduino is the best way to start your hobby.

When you power your board using a 9V adaptor, the Red LED on your board, starts blinking. It would have been loaded with the LED program already and it shows that your board is in a good condition.

When you launch the arduino.exe file, a screen appears before you as shown in the figure below:


I found the IDE to be user friendly. When I started learning MPLab (PIC Microcontrollers) and AVR Studio ( AVR microcontrollers), they were complex enough to make me lose interest in learning them.

There are good examples available along with this IDE. You may access them as shown in the figure below:

Launching an application

This opens up a LED Blinking program in a new window.

LED blinking

The actual code for the program is available at the link highlighted in the picture.


int ledPin =  13;
The 13th pin is where your LED is connected. So it is assigned to a variable ledPin.
void setup()   {

pinMode(ledPin, OUTPUT);
The 13th Pin is configured as an output pin.
void loop() — This is where the body of the program is written.  
digitalWrite(ledPin, HIGH);
A signal “1”is sent to the 13th pin.
There are code libraries which generate delay in milliseconds when you enter an integer value in the delay(integer) function. Here the delay is for 1000 ms.
digitalWrite(ledPin, LOW);
A signal “0”is sent to the 13th pin.
A delay for another 1000 ms.
Hence your LED switches on and off every second.
Any code needs to be compiled before you run it. You can compile this code by clicking the button : Play
Now when your compiling is done,  a “Done compiling” message appears below your window.
Press “Ctrl+U”, The LED connected to your 13th pin starts blinking!