Pull up resistors vs. Pull down resistors

January 2, 2018

I designed an add-on board for my Raspberry Pi Zero to interface a CCS811 volatile organic compound sensor (Source files available from here). The CCS811 comes with an I²C interface.

IMG_20180101_171840.jpg

Raspberry Pi Zero add-on board for Sparkfun’s CCS811 breakout

My intention behind designing a PCB was to avoid all the messy wires you would need while a prototyping board (or a “dot board”).

IMG_20171031_163834.jpg

Same circuit (as above) but soldered onto a prototyping board

The PCB design was a simple one and I did not anticipate problems with the design. When I soldered the PCBs and began my testing, I was surprised to note that the sensor was not detected by the i2cdetect command.

The circuit is very simple and the sensor breakout contains pull up resistors for the I²C interface. I had to draw four traces to interface the sensor (3.3V, GND, SDA & SCL).

The sensor breakout is equipped with a reset pin, a wake pin and an interrupt pin. All of them are active low signals.

PCB_Schematic

Raspberry Pi Zero add-on board

In order to exploit the sensor’s features, I decided to interface those pins to the Raspberry Pi’s GPIO interface.

If you are an EE, you might me aware of the fact that GPIO pins are set to a high impedance state. I was aware of this fact but I also found out that while they are set to a high impedance state, they are also either pulled up or pulled down (Source).

The wake pin of the sensor breakout is connected to a GPIO pin (of the Raspberry Pi) that is pulled high in its high impedance state. I was wracking my brain to understand why the sensor wasn’t detected by the Raspberry Pi. My assumption was a bad solder or lack of continuity.

It turns out that a combination of current leakage (from the GPIO pin) and a weak pull-down resistor caused this headache. The sensor breakout’s reset pin comes with a 100K pull down resistor on the wake pin.

ccs811

CCS811 schematic

It turns out that the 100K pull-down resistor was not sufficient to overcome the effects of leakage current. The wake pin was tied to “high” and put my sensor to sleep. I had to create a solder bridge between the wake pin and the ground pin. It worked like a charm!

i2c_detect

I wonder if a stronger pull-down resistor would have solved the problem. I was conducting further investigation into the problem and I learned that pull-down resistors are a bad idea. Read all about it in Jack Ganssle’s article.

Adafruit has a similar sensor breakout and they used a pull-up resistor. You need to tie the pin to ground and it makes sense to me.sensors_schematic

I think it is crucial to choose the right resistor value AND it is best to pull up your signal line (wherever possible).

Advertisements

2017 – The year of Maker Faires!

December 31, 2017

I am never able to recall what I did in a particular year. But, I think 2017 has been an exciting year for me. Here are the things that come to my mind about 2017 (I collaborated with my brother on most of these projects):

  • I switched jobs and I moved from the West Coast to the East.
  • I visited 13 states this year (30 overall)
  • We exhibited at 4 Maker Faires
  • We wrote three articles for different magazines
  • We published a book!

I am really proud of our exhibit at the Maker Faires: A Personal Health Dashboard

IMG_20170915_210828.jpg

Personal Health Dashboard

Function of the dashboard

We built the personal health dashboard to motivate oneself to be physically active. It is driven by a Raspberry Pi Zero. We use a Fitbit tracker to keep track of our physical activity. Hence, we used the Fitbit API to build this dashboard.

  • Every 15 minutes, the dashboard makes use of the Fitbit API to determine the total number of steps clocked for the day.
  • The dashboard counts down from the step goal using the steps clocked for the day. For example: In the above picture, I have about 3625 steps left for the day and my daily step goal is 11000.
  • We built two versions: one that counts up while the other that counts down. We found the latter to be useful since it informs you of the activity left for the day. You could plan your exercise accordingly.
IMG_20170509_001843.jpg

Dashboard V1: Counts up to the step goal

IMG_20171201_083520.jpg

Dashboard V2: Counts down from the step goal

We participated in 4 Maker Faires across the country:

  • World Maker Faire – September 2017 in Queens, NY
  • East Bay Mini Maker Faire – October 2017 in Oakland, CA
  • Cleveland Mini Maker Faire – November 2017 in Cleveland, OH
  • Rochester Mini Maker Faire – November 2017 in Rochester, NY

What did we learn?

Traveling is awesome

Our first trip was to the World Maker Faire in NYC. I picked my brother up from Cleveland and drove to New York City. It was an amazing experience.

I am someone who is always nervous before embarking on a trip. I don’t know why but this is slowly changing since I started traveling frequently. We also got to visit the Adirondacks region in Upstate New York:

IMG_20170925_124936.jpg

Adirondacks, Upstate New York

Maker Faires are a source of entertainment

You get to meet a lot of people at the Maker Faire. It is important to visit other booths at the Maker Faire. They serve as a source of inspiration for future projects. We got to meet Lady Ada from adafruit.com, John Park from Adafruit, 3D Printing Nerd, the dude from Maker’s Muse. I strongly recommend visiting other booths at the Maker Faire:

We also witnessed some major announcements in the Hardware World:

  • The Arduino Foundation announced some major changes to their organization: Arduino.org and Arduino.cc merged to become a single entity
IMG_20170923_130959.jpg

Massimo Banzi’s announcement at the World Maker Faire

  • They also announced some exciting new hardware:
IMG_20170923_132017.jpg

Massimo Banzi’s Hardware Announcement

Freebies:

We got a lot of freebies at the Maker Faires. Our favorites include:

DKbtaSvUQAAcIxd

  • A book by Simon Monk signed by the author himself:
1941-01

Image source: adafruit.com

IMG_20171231_215648

Simon Monk’s autograph

heartypatch2

Image: Protocentral’s Github repo

Networking Opportunities

We got to meet different kinds of people from different walks of life. Here are some highlights:

  • The Raspberry Pi Foundation director tweeted about our project:

As I write this article, I realized that 2017 was an eventful (successful?) year! I look forward to 2018!


Trick to draw circular PCB outlines in Eagle

December 26, 2017

If you haven’t used the Eagle PCB design tool lately, you will be surprised to learn that it has underwent a major update since it was acquired by Autodesk.

Eagle’s license model has been switched over to a subscription service and I am liking the experience so far. I am able to get the latest updates of the software (unlike earlier, the updates are quite frequent). I am currently using Eagle 8.5.x and it comes with the “Push and Shove” feature that automatically pushes signal traces while routing your PCB.

PCB Outlines

I was working on a circular PCB for building something like a fidget spinner. I assumed that I could draw circular PCB outlines by drawing a simple circle.

Circle_snapshot

Circle feature in Eagle PCB

Being able to draw circular outlines can make your life easy. For example: You could draw a random circle and specify its radius, center etc (similar to Mechanical CAD tools).

Circle_Radius

It turns out that the software considers this an error. When I started to route the PCB, the automated DRC check ignored glaringly obvious errors.

eagle_2017-12-26_19-54-44

Errors resulting from the Circular Outline

In the above snapshot, you will note that I am able to route traces over PCB pads and the cursor indicates bad news.

After wasting some time, I found out from this forum thread that I need to draw my outline using arcs.

In Eagle, drawing an arc is a three step process:

  • Specify the starting point
  • Move the cursor to specify the arc radius
  • Draw the arc

It is definitely confusing and imagine drawing a “closed circle” using arcs. It can be frustrating.

I eventually managed to find a simple solution that involves combining arcs to draw circular outlines. Check it out!

I am no video expert. I made this video using basic screen capture tools. I look forward to hearing your tips on improving the video.

I really hope Autodesk simplifies creation of non-standard outlines. Did you have a similar experience? Drop your thoughts in the comments section!

My design is off to OSH Park. What manufacturing house do you use for your designs? I will share my build in upcoming blog posts.

 

 


Color Coded GPIO headers

August 26, 2017

I came across this color coded GPIO header for the Raspberry Pi Zero from the Pi Hut. This can be really useful while prototyping a circuit. 5V pins are coded red, 3.3V pins are coded yellow, Ground pins are coded black.

20170826_154123

It can help avoid connections to the wrong pin.

20170826_164549.jpg

I usually refer to the GPIO pinout when I am connecting to the UART or the I2C interface. I always mix up the pin names. I wish the header had side labels like the Arduino.

IMG_20170826_165653

Given the header height, I guess it is not practical to have labels. You can buy the headers from here.


National Maker Week (June 16 – June 22)

June 21, 2017

 

This week is being celebrated as the National Week of Making by Nation of Makers – a nonprofit dedicated towards supporting the maker movement in the United States.

When the new administration took charge of the White House in January 2017, they took down all pages related to the maker movement in the United States. It is not known whether these pages would be restored in the near future. I learned this from watching Adafruit’s Show and Tell and I also learned that Nation of Makers decided to take lead on driving the maker movement.

They are encouraging makerspaces to conduct maker townhall events by offering grants to them. I promised myself to celebrate this week by building something useful (another blog post coming soon!).

I also wanted to share some interesting news to celebrate this week. Digi-Key and Adafruit announced that they will be donating a Circuit Playground to Girls Who Code for every Circuit Playground sold on their website. Check it out!

I also recommend checking out this week’s Ask an Engineer episode from Adafruit (shared below). Happy Making!


You can now use Google’s AI to add voice commands to your Raspberry Pi – The Verge

May 4, 2017

Google has released hardware that enables to interact with your Raspberry Pi 3 using Google’s Cloud Speech API. Check it out!

Source: You can now use Google’s AI to add voice commands to your Raspberry Pi – The Verge


Webinar on IPv6 over BLE

April 24, 2017

Design News is conducting a webinar on Implementing an IPv6 network using Bluetooth Low Energy devices (BLE) and a Raspberry Pi. The webinar runs for 5 days for 30 minutes. The webinar demonstrates the implementation using a Raspberry Pi 3.

It appears that this following development kit is necessary to follow along with the webinar. I will share my experience after watching all the webinars. The webinars are recorded for posterity.