HDC1000 temperature and humidity sensor breakout, with Arduino library!

Some time ago I came across a new chip from TI, the HDC1000. It’s a temperature and humidity sensor with I2C interface and requires little to no additional components. It comes in an 8BGA package: we can all agree it’s pretty small.
Some of the peculiar characteristics of this chip are that it has a DRDYn pin which goes low any time there is a new reading from the chip (so you can precisely time your requests) and that the sensor is located on the bottom of the IC, so that it’s not exposed to dust and other agents that may false the readings. Also, it has an integrated heater that can remove humidity from the sensor.

So I developed a very small breakout board for this chip as well as an Arduino library (yay, my first one! raspberryPi and nodemcu might come next).

The breakout boards.

I learned quite a lot about PCB design and soldering, effectively putting my new hot air station to good use.

Board layout

The boards were again fulfilled by DirtyPCBs, perfect for this kind of small projects.

Continue reading

LSF0204 breakout board: a bidirectional, multi-voltage level converter!

Hello everyone!

I needed a small, fast and reliable multi-voltage level translator (mainly for connecting ESP8266 boards to the Arduino, got tired of resistor networks pretty quickly) so I built a breakout board for TI’s LSF0204(D).

Datasheet and info here.

The LSF0204 is a nice little chip. It can translate up to 4 signals to and from the following values:

1.0 V ↔ 1.8/2.5/3.3/5 V.
1.2 V ↔ 1.8/2.5/3.3/5 V.
1.8 V ↔ 2.5/3.3/5 V.
2.5 V ↔ 3.3/5 V.
3.3 V ↔ 5 V.

Here’s a picture of the board design:

Board layout


It’s very easy to use: connect the reference voltages to VA (1.0-4.5V) and VB (1.8-5.5V), and your signals to A1/2/3/4 or B1/2/3/4. It will translate and output them to the opposite A or B pins.

Continue reading

My holiday project: Internet-controlled lights using different flavors of Arduino.

Brace yourselves, Christmas is coming.

Even though it’s been a while since I’ve last felt the magic atmosphere of Christmas, this year I want to celebrate it in a quite different way.

In the era of IoT, I’m building some internet-controllable lights using all the Arduinos I have.

The main point is that there will be different “light clients” which are Arduino that can be connected to different light sources such as analog LED strips, 3/10W RGB LEDs (my custom driver might come in handy!) and WS2812B addressable strips (provided that they come in time).

Each of these devices can receive commands over TCP. This means that they can be controlled from any internet-connected device. I am building a “controller box” which will have some analog controls and can choose which light client to connect to, and control it through user input (sticks and pots, yay!) and will also host a web interface.

Available lighting modes will be: manual mode, fade mode (single or from one color to another), random mode, strobe mode. I might add some photo/sound sensors if I have time.

Continue reading

Worklog #2: Handling joystick input on Arduino and LinkIt ONE.

After expanding the LinkIt ONE and Arduino analog inputs, I had to find a proper way to handle user input. The easier and most convenient way was using an analog joystick, so I ordered one off AliExpress.

As I figured it will take way too much time to get here, I decided I’d open up my Xbox 360 controller and use its joysticks in the meanwhile.


Butchered 360 controller. Red = VCC, Violet = GND, Yellow = A0, Orange = A1.

Butchered 360 controller. Red = VCC, Violet = GND, Yellow = A0, Orange = A1.

Joysticks are made by joining two analog pots together (one for vertical movement, and one for horizontal) and a tactile button.

Continue reading

Worklog #1: Expanding LinkIt ONE/Arduino analog inputs.

While working on the controller for my RGB light system, I quickly noticed the analog inputs on the LinkIt ONE wouldn’t be enough. It only has three analog inputs while I needed at least 5 (2 for the controlling a joystick – which is basically two pots in one – and 3 for the color-choosing pots (R, G, B).

In order to increase the number of analog inputs, I decided to buy a 4052 4-channel (de)multiplexer. It costs roughly 50 cents and can handle both inputs and outputs: my local store had the ST version (HCF4052BE) so I bought that one, but TI also makes the same chip.

You can take a look at the datasheet here.


HCF4052B pinout.

HCF4052B pinout.


Operation is fairly simple: you connect your analog devices to pins 1, 2, 4, 5 (for channel Y) or 11, 12, 14, 15 (for channel X). The signal will then be output from pin 3 (for channel Y) or pin 13(for channel X), depending on the high/low states on pins 9 and 10 (B and A, respectively), which are connected to your Arduino/LinkIt.

Take a look at the following table to understand how the thing works:


HCF4052B truth table.

HCF4052B truth table.

This basically means that, provided that the INH pin (6) is connected to GND, if B and A are both low (connected to GND too), common pin 3 (or 13) will be connected to pin 1 – 0x (or pin 12 – 0y). If A is high (connected to VDD) and B is low, pin 3 (and 13) will then be connected to pin 5 (and 14), and so on.

Don’t forget to connect pin 16 to 5V and pin 6, 7 and 8 to GND.

Here is some example code to get this thing working for both Arduino and LinkIt, using only 3 of the 4 inputs. Try to modify the code to make it work for all pins!

In this particular case, I used this code to get the input from 3 potentiometers on the same analog pin.


And that’s it!




A new board came in today: SeeedStudio’s LinkIt ONE!

A few days ago, Seeed Studio posted a contest in which 10 pieces of their newest board, the LinkIt ONE, would have been given away to makers who had a good idea on how to use them for an hobby project.

You can find more info about the board here, it’s basically a 32-bit MCU development board which has lots of connectivity options built-in (GPS, cellular, Wi-Fi, Bluetooth, Audio, SD card) and is compatibile with the Arduino IDE. It is based on the MT2502A microcontroller.

I immediately applied for the contest and a few days later they replied saying they liked my idea and they were kind enough to send me a LinkIt ONE.

I received the board today (fast shipping with FedEx!) and it’s very neat.

This is how the whole package looks like. The board is definitely well-made and feels solid.


Center: LinkIt ONE board. Left: Wi-Fi/BT, GSM and GPS antennas. Right: 1000mAh battery (included) and 2 Grove modules I needed (not included)

Center: LinkIt ONE board. Left: Wi-Fi/BT, GSM and GPS antennas. Right: 1000mAh battery (included) and 2 Grove modules I needed (not included). SD and SIM slots on the back.


The info sheet is included in the package: By quickly looking at it, the only complaint I have is the limited number of PWM outputs (2, might be solved with software PWM libraries) and analog inputs (3, can be increased using a demultiplexer) compared to Arduino.

However, the price (79$) is unbeatable considering all its connection options: separate Arduino shields would definitely have a much higher cost. Moreover, the MCU is a lot beefier than your average Atmega. Keep in mind that this board runs at 3.3V.

More info and photos after the jump!

Continue reading