Monday, December 23, 2013

I2C Sensors that can be combined on a small board

I discovered that there are several tiny sensors that can be combined together in a single pcb board. This is cool because these sensors requires only 2 pins which means you can add more devices when more pins are available. The scarcity of pins is a common problem of newbie electronic hobbyists. The other most common problem is the availability of space, the more the device that is connected requires bigger pcb, and the device can be as big as a normal personal computer already which does not makes sense if you want to carry your diy device around. And the coolest thing about these sensors is that they have very similar circuit implementation. So if you have read my previous about the Digital Compass, then it should not be hard for you to implement the other sensors.

My previous post used HMC5883L which is a low cost 3-axis Digital Compass. Aside from showing where you are facing, this is device can be used to control the direction of rotation of a motor without pressing a button.

If your goal is to create a device that can give you information like the current temperature, pressure and how high your location or how fast you are moving upward or downward then you need a BMP180 Digital Pressure Sensor. This is commonly used in rocketry or even in drones. It is also commonly used by explorers and mountaineers.

Another sensor that has many applications and can tell so much about your movement such as angle of inclination, how fast you are spinning and can tell you your orientation and this is the MPU6050, a MEMs 3-axix gyroscope and 3-axis accelerometer at the same time.

All three sensors(BMP180, HMC5883L and MPU6050) can be combined is a tiny pcb board with very minimal passive components. Here is the module:,Position,1-1,1

Sunday, December 22, 2013

Digital Compass during Sunday Midnight

I could not sleep last night so I kept myself busy by creating a simple breakout board of HMC5883L which is a low cost 3-axis Digital Compass. I thought it would keep me busy the whole night until the morning but I was wrong, it only took me less than an hour to finish the job.

Here's some picture of what I have done:
1. The 3D render from Kicad:

2. The back panel of the pcb. This image was produced upon submission to the fab:

3. The front panel of the pcb. This image was also produced upon submission to the fab:

 4. The pcb view from Kicad:

5. And finally the schematic diagram:
Sparkfun has similar breakout board and some features listed in their website is as follows:

  • Simple I2C interface
  • 2.16-3.6VDC supply range
  • Low current draw
  • 5 milli-gauss resolution
I did copied their breakout board but coincedintally, probably we have the same source, the ic's datasheet. I just followed  the Single Supply Reference Design provided in the datasheet.

Tuesday, December 10, 2013

Transferring my Digital Clock from Breadboard to a PCB

I had fun learning KiCAD last weekend. After 2 days of fun learning, I thought I should transfer my digital clock project to a nice pcb. I asked myself why do I need a gorgeous pcb? And here are the answers to my questions:

1. I want to get rid of the mess on my work table.
2. The hardware can be temporarily freeze to its current version. I still have plans of adding more features on the hardware side.
3. I want to check how it will look like in a professionaly designed and fabricated pcb.
4. I want to concentrate in creating a better firmware.

With the above mentioned reasons, I was able to convinced and motivate myself to create the pcb. As of today, I am done with the initial design and here is the initial render:

Back View:

Front View:

The pcb I created is basically an arduino uno shield that can be used as a tool for learning and getting familiarized with the programming language of arduino. This really perfect for beginners and can still be appreciated by  the experts.

Friday, December 6, 2013

The Clock is Simple No More

Well it is really awesome to say that the clock is no longer that simple because I added a few more features to make it a nice clock, it is not yet the final version because I have tons of ideas to make a one hell of a device which I can call one of my best projects ever!

The New Features
 I've added 3 new features which are as follows:
1. 2 new buttons to control the brightness. This is just a temporary version, I just want to check whether it is nice to have a button and to control the brightness. It turns out that yes, it is indeed needed. I still am thinking  if I will make this permanent because I plan to control the brightness, contrast, set time and date, store important dates and alarms using the pc. I connected the 2 buttons using the schematic below:

2. A back-up battery with Charger and DC-DC Step Up converter. The clock will not be connected to the pc 90% of the time so a battery is needed to power it up and must be rechargeable just like cellphone. I used the AREF pin to bypass the on board  regulator of the arduino because it is not efficient. The battery is rated 3.6V so it is not enough to power-up the arduino that is why I need to bost that voltage to 5V using the DC-DC Step-up converter. Below is the connection diagram I used:

3. A software feature to monitor the battery charge. Using the diagram above, I connected A1(analog pin 1) of the arduino to the positive terminal of the battery to measure current charge of the battery. I used the following codes:

    val3 = val3 + analogRead(1);
    val3 = val3/charglim; 

    val1 = val3/204.6; //0-5V

    charglim = 0;
    val3 = 0;  
analogRead(1) will return values between 0 to 1023 which is summed up to val3 40 times and the average is taken and converted to voltage reading.

Here's the actual pictures of the components I used:

Some of the components I used can be bought from my sulit shop