Sunday, November 9, 2014

Tapping the cheap energy to power our gadgets

Vibrations which is always present in the environment can now be harnessed to power our gadget. Just imagine while you are walking, try to move your arms or when the wind is blowing, vibration is produced and thus can be converted into electric energy. Free electricity is also a good term for this.

What is needed to convert these vibrations into electrical energy is the piezo vibration sensor.  An example of a piezo electric sensor is like this:
This typical sensor can produce low alternating current but large voltage ranging from 1v up to 90v. The electrical energy produced by the sensor goes out of the 2 leads. There is an integrated circuit designed specifically to regulate the output of the sensor, I am referring to LTC3588. This system on chip electronic component requires minimal external component and the typical circuit provided by the manufacturer is in the following circuit diagram:

This is basically a piezoelectric energy harvester with 9V battery as back up power. There are also other implementations like Sparkfun's  LTC3588 breakout board uses solar energy as power source instead of the piezo vibration sensor. This works like you have to set a certain output voltage, the role of the solar panel is to charge the super capacitors connected in series, if the voltage across  the input of the breakout board reaches the preselected voltage output, the LTC3588 circuit will be awaken and start to power a device connected to its output, if the supercaps were fully discharge or their output voltage is less than the preselected output voltage, then the circuit will enter the sleep mode.
This technology can really be a must have for everyone who uses gadgets that requires electricity such as mobile phones. If 5million uses this technology, perhaps our fossil fuel consumption will be reduced and will be a huge savings for a nation where 95% of the population are struggling to make both ends meet.

Friday, November 7, 2014

Using Ibeacons as Land Mines in a Simulated Military Game

We often hear about simulated military games involving land mines as major obstacles. Land Mines in real sense is an explosive buried underground to disable vehicles of the enemy. In simulated military games, we can use the ibeacons instead as land mines.

One common problem encountered is the complexity of how land mines are distributed in a given space. In a mathematical sense, this can be rephrased as what is the optimal or fairest possible distribution of land mines in order to give the highest unpredictability of locating such weapons in a given space. The space is large but quantifiable.

One possible solution is the Simulated Annealing Algorithm. Annealing in metallurgy is the process of heating and controlled cooling in order to strengthen further the metal. So in the algorithm, it is basically providing a series of solutions until an optimal solution was reached with the goal of evenly distributing the land mines in such a unpredictable pattern.

Let us just imagine the mine field as rectangle where we need to distribute land mines which in this case are the ibeacons in a random pattern where the transmission range never overlaps.

Saturday, October 25, 2014

The proper way of turning the HM-10 into Ibeacon

From my few days of testing of HM-10 as Ibeacon, I noticed that just by activating the ibeacon with the following AT command is not enough:

With this configuration alone, HM-10 will still be consuming its normal rated power which is
about :
Rated Power = 3.3V*8.5mAmp = 28.05mW
This would mean it would only take a few days to drain the 580mAH Lipoly battery with this configuration but of course, the broadcasting range is still be at the confirmed value of above 100meters.

But if your requirement is just for indoor use and would want it to consume much less power, here is the proper way to configure the BLE module but take note that the lesser power it consumes, the shorter the broadcasting range it becomes and for sure with this configuration, it can not go further than 10meters:

 With this configuration, the HM-10 BLE Module can drain the fully charged 580mah lipoly battery in 6 months.

Friday, October 24, 2014

More Fun with HM 10

I got more curious about how to use the HM 10 BLE(Bluetooth low energy) module and asked myself if it will really be able to pair with arduino and instruct the arduino to do some tasks via an android phone. So did some research if anyone from the internet has posted similar project and I was so lucky that I found one that I thought is easy and would simply answer my question.

The original post can be found through this link: Control RGB lights from Android with Arduino & Bluetooth LE (BLE)

Aside from following the processes exactly as described in the article, I also did some twist to adapt it to what is available in my chest. The first thing I did is to deactivate the ibeacon function by issuing the following AT command:
To check whether ibeacon function is activated or not, this AT command is used:
HM-10 will respond: OK Get 1|0

Ibeacon is activated if it returns 1 and deactivated when it returns 0.

Here are the materials and components I used:
1. HM10 BLE module
2. Arduino Pro Mini 8Mhz and 3.3V
3. Dupont wires
4. The RS232-TTL Adaptor that I used to upload sketch on the Pro Mini
5. Li-Poly Battery
6. BreadBoard

I will still be using the same connection just like what I did in my previous testing of HM-10 and was described in detail in my previous post. If you haven't read it yet, you may click on this link: HM10 BLE Module with Ibeacon .

With that set-up, all I need is to upload the sketch as described in the reference article but since I don't have an RGB LED, I could just use the LED in the arduino pro mini which is connected to digital pin 13. Digital pin 13 is not a PWM pin so I can only turn it on or off and not able to dim it.

I also downloaded the android app in the reference article and installed on my android phone.

Test Result:
It was awesome!!!

Here's the video of my testing:

This is the sketch that I used:
#include <SoftwareSerial.h> 
int bluetoothTx = 3;  // TX-O pin of bluetooth mate, Arduino D2
int bluetoothRx = 2;  // RX-I pin of bluetooth mate, Arduino D3
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
const int redPin = 13;
 const int greenPin = 5;
 const int bluePin = 6;
void setup() {
   // initialize serial:
   // make the pins outputs:
   pinMode(redPin, OUTPUT);
   pinMode(greenPin, OUTPUT);
   pinMode(bluePin, OUTPUT);
  bluetooth.begin(115200);  // The Bluetooth Mate defaults to 115200bps
  delay(100);  // Short delay, wait for the Mate to send back CMD
  bluetooth.println("U,9600,N");  // Temporarily Change the baudrate to 9600, no parity
  // 115200 can be too fast at times for NewSoftSerial to relay the data reliably
void loop() {
   // if there's any serial available, read it:
     if(bluetooth.available())  // If the bluetooth sent any characters
  while (bluetooth.available() > 0) {
     // look for the next valid integer in the incoming serial stream:
     int red = bluetooth.parseInt();
     // do it again:
     int green = bluetooth.parseInt();
     // do it again:
     int blue = bluetooth.parseInt();
     // look for the newline. That's the end of your
     // sentence:
     if ( == '\n') {
       // constrain the values to 0 - 255 and invert
       // if you're using a common-cathode LED, just use "constrain(color, 0, 255);"
       red = 255 - constrain(red, 0, 255);
       green = 255 - constrain(green, 0, 255);
       blue = 255 - constrain(blue, 0, 255);
       // fade the red, green, and blue legs of the LED:
       analogWrite(redPin, red);
       analogWrite(greenPin, green);
       analogWrite(bluePin, blue); 

I am still using the software serial library because that was my previous setup and I wanted to use the original serial port to communicate with the pc when ever it is needed or necessary.

Saturday, October 18, 2014

HM10 BLE Module with Ibeacon

Upon learning that somebody has just posted a HM10 BLE module at, I immediately contacted the seller and bought 1 for my testing. HM-10 is not only just a Bluetooth low energy(ble) module but can be used as ibeacon as well.

It is so easy to use and adding an arduino is very easy. I used the following circuit diagram and it just so happened that my arduino pro mini is a 3.3V 8mhz which is just perfect for the HM-10.

I also bought a small lipoly battery(580mah) just to do some experiments on how much time it will take before hm-10 can drain the battery.

Here are some pictures of my setup:


As usual, I could have never done the soldering part without the help of my cellphone technician friend.

During my testing, the battery with 1 hour of charging could last up to 1 day, that is just probably at 15% charging, so may take a week when fully charged.

I used the following sketch to test the HM-10 Module with arduino:
#include <SoftwareSerial.h> 
int bluetoothTx = 2;  // TX-O pin of bluetooth mate, Arduino D2
int bluetoothRx = 3;  // RX-I pin of bluetooth mate, Arduino D3
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
void setup()
  Serial.begin(9600);  // Begin the serial monitor at 9600bps
  bluetooth.begin(115200);  // The Bluetooth Mate defaults to 115200bps
  delay(100);  // Short delay, wait for the Mate to send back CMD
  bluetooth.println("U,9600,N");  // Temporarily Change the baudrate to 9600, no parity
  // 115200 can be too fast at times for NewSoftSerial to relay the data reliably
  bluetooth.begin(9600);  // Start bluetooth serial at 9600
void loop()
  if(bluetooth.available())  // If the bluetooth sent any characters
    // Send any characters the bluetooth prints to the serial monitor
  if(Serial.available())  // If stuff was typed in the serial monitor
    // Send any characters the Serial monitor prints to the bluetooth
  // and loop forever and ever!

To test the sketch,  just open the serial monitor of the arduino IDE and type in "AT" at the text box then press the "send" button. If the HM-10 is connected properly, it will respond "OK". All AT commands are available at the datasheet which can be easily found on the internet.

I also tested the transmission range if it can reach 100meters, and here's the result on my android phone:

It was able to reach 125.5meters.

I am very satisfied with the results of my testing and this is really one of the best Ibeacons that is on sale at olx. But for some other purposes, like when you just need simple ibeacon apps that are short range these ibeacons can be very useful too:

Monday, October 6, 2014

Just another Ibeacon App Idea

You can not just let chance get you find it. I am quite sure that it is but natural to find or look for someone that is very much compatible to you somewhere. And you can increase further the probability of finding that someone with technology and perhaps ibeacon with a nice app for this purpose could be the best answer.

The Hardware
The hardware need not be expensive, find an ibeacon and configure it to describe your self. This is done by just renaming your personal ibeacon with your name. And of course a phone capable of receiving ibeacon signals. If you still don't have a pc, you can go to an internet cafe or you may use your phone as well.

The Software
An android or IOS app must not only be obviously installed in your phone but must also be installed in that special someone's phone in order for him or her to receive your message ans so do you. So the app must be opened all the time and the phone must be connected to the internet. If ever you get near that someone, the app will alert you and he/she as well. The alert should be like your picture should appear on his/her phone with 3 buttons that should allow both of you to either just ignore the alert, invite for a short chit chat, or just send a message.

This is a social networking app so there must be a website where you have registered and uploaded your picture and some personal information, the description of your special someone. The latter is very important because the android app will use it as basis for locating that special someone.

Someone can be very dishonest about their preferences so perhaps the web based application would use data mining to increase the accuracy of matching the perfect someone that you are looking for.

Saturday, September 6, 2014

Affordable Phones for iBeacons

A few months ago, ibeacons signals can be received by a few high end smartphones like the samsung galaxy 5s and iphone 5s. But now, even those smart phones costing below Php5000.00 are now fully equipped with the latest hardware and software enabling them to receive ibeacon signals. The LG L40 is the one I am testing right now.

I downloaded an app that will confirm if this smartphone is capable of receiving ibeacon signal and yes, it really can.

Tuesday, June 24, 2014

Fully Automated Toll Road with Ibeacons

Toll road projects is a big hit in the Philippines because it prevents people from constructing various commercial buildings along the roadside and provides an almost very convenient long distance driving but I think this is not true all the time. With huge number of vehicles of all sizes, there are times(especially during holidays when people go to their respective provinces)when these toll roads experience monstrous traffic gridlock and this goes on for almost a day. I could not imagine how I will be spending the whole day and night on the road!

 Here's a quote from a famous columnist(read the full article here):
Secondly, the tollgates at exit points simply cannot possibly serve the huge volume of vehicles even over a 48-hour period. The waiting time to pass through exit tollgates was as long as 45 minutes each time. (Traveling through the 3 expressways today means having to pay through 3 exit toll stations).
The columnist identified what has caused that monstrous traffic jam and that is the huge number of vehicles that could not be served by the toll plaza even on an over 48-hour period. But I think, this could have been avoided if 100% of these vehicles were equipped with ibeacons. And an app could have been developed to automatically deduct the toll fee right after the vehicle entered the toll road zone.

Ibeacons can be used not just to collect toll fees, it can also be used to monitor the speed of each vehicle. And the best part of it all is the erasure of the human factor that may also have caused that problem. Just imagine how you can enjoy travelling the whole year round with the beautiful view of the countryside as your background. This really should make life a lot pleasurable and enjoyable which is the main goal and motivation of every inventor.

Here a sample view at TPLEX(Tarlac-Pangasinan-La Union):

Sunday, June 22, 2014

Miniaturized Arm Based Arduinos

For electronics projects where space and size really matters, a miniaturized arm based arduinos can be an excellent solution as it will definitely speed up development efforts especially during prototyping stage. My previous post which was about miniaturized arduinos does not offer much because those were just small arduino uno. What most hobbyist want and I would say an ideal tiny development board should at least be 40Mhz with huge rams and eeproms.

So I tried to search the web again to find arduinos having the above mentioned specs and to my surprise, I only found 1 and another tiny board almost qualified but then it is worth mentioning because of it unique features and it's a little bit more powerful than an ordinary arduino.

Teensy 3.1 is a small and is definitely a miniaturized arm based arduino. It uses the powerful MK20DX256 32 bit ARM Cortex-M4 72 MHz microcontroller and can be program in the arduino ide. The only feature that did not met my requirement is the small eeprom which is the standard 2kb, the manufacturer should have at least inluded an external eeprom ic to compensate for this lackness but overall, the teensy 3.1 will enable hobbyists develop a wide range of small but very powerful devices.
The other arm based arduino is small but is only 16Mhz (that's why it did not qualified) is the rfduino. What is nice about this tiny arduino module is having a bluetooth low energy module on board, this can also be used as an alternative ibeacon device or can be programmed to recieve ibeacon data. enablng other non-ble equipped devices to have the latest hardware in the market.

Thursday, June 19, 2014

My Mobile Application Idea using Ibeacons

Micro location devices such as ibeacons are getting the right attention nowadays because these devices can truly make huge events in a large venue interactive making the event more organized and more enjoyable.Still, quite a number of people still don't know what ibeacons can do and what it can do to help them save time or enhance their experience.

Currently, a lot of new app design ideas have been coming out and I would like to share mine. I am not an expert in mobile app development but I think the concept is viable and can really help people who loves shopping or going out to buy some hard to find items.

Here's my idea:
  1. Before I go out of the house, I will list down the items I am going to buy on the app.
  2. I proceed to the mall where each shop has active ibeacons.
  3. While I am inside the mall, I open the app showing the list I created.
  4. I click on an item and immediately, the app will tell me which shop sells the item.
  5. I click the shop that sells the item to give me the exact location and tells me if there is an on going sales discounts or they're giving away freebies.
  6. Assuming it is so far away, so I will just send a message to the shop owner to just send the product to my current location and I will just click the "pay" button to pay for the product using my paypal.
  7. I will just wait for the product to be delivered while enjoying a cup of coffee.
The list are just high level outline of my idea, if I would dig a little deeper into the features, I would probably add these items into the list:
  • The list of enumerated shops must include the selling price so I could decide immediately from which shop should I buy. 
  • The search algorithm I would use in determining which shop sells the item is keyword based. But it would be a lot simpler if I would tell all the shop owners to have similar product code. For example, I intend to buy a laptop which has i7 octacore cpu, ips touch screen of at least 11". I would also include my budget and ideal casing. The app should use the keywords "i7 octacore cpu" "ips touch screen" and 11".
  • If I click on a product, it would show the typical brochure-like screen filled with useful information and at the button several widgets that shows the related items, the "people who bought this item also bought the following items", reviews and feed backs.  

With this app, I don't have to go each and every shop just to ask them if they have the item I am looking for.
This app can really be very helpful especially when you have a project and you will start looking for the components you need and shops are located far from each other and not to mention the extremely humid weather.

Friday, February 14, 2014

My Femtoduino Multipurpose Shield

Having too much clutter on one's desk or work table can really be annoying. This is the main reason why I really need to transfer my newly created gadget from breadboard to a pcb. Ok not the near commercial version of it, just a quick solution. So I came up with a really nice mutlipurpose shield just perfect for my current need.

Last week, upon the arrival of my BMP180 sensor, I quickly did some experimenting and since all of the results were just as I expected, I really need to transfer all of my setup to a pcb so that I can concentrate in the creation of the firmware.

This was my previous setup:

And now, this is my shield:

I have become a big fan of my friend who happens to be a cellphone technician because he did an amazing job at assembling my project. He never made any mistake and I only have to leave him all the parts I used, with some instructions from me and I made a totally ugly sketch of the schematic diagram. I am so proud of him for doing such an amazing job. Here is my sketch:
I made this sketch in less than an hour, because I was so very excited.

More about the shield:
The shield can be used in a lot of ways. I designed it to be flexible and all modules I used can be easily removed and replaced with another module. Here is the list of components I used:
  1.  1.8" tft display, I have chosen this over my Nokia 5110 lcd module because this tft display is a lot more functional, offers twice as much resolution at 128x160 pixels as compared to Nokia 5110's 84x48 resolution, small footprint, full color and most importantly power consumption is very low, so a coincell battery can still be used for this project.
  2. Femtoduino, it is the only microcontroller I have at the moment so I have no choice but to use it.
  3. Buzzer, I needed somehow to hear some sounds so this is a good addition.
  4. BMP180, this is the main reason why I came up with this shield, it is a very functional sensor because with it, I can measure altitude, vertical velocity, atmospheric pressure, relative temperature and humidity.
  5. DC-DC Step-down converter, this module converts 5V to 3.3V. This is needed in the shield because the Femtoduino requires 5V while the 1.8" TFT Display and BMP180 requires 3.3V.
I also included a jumper port so that when I need to take a picture of the 1.8" TFT display using my tablet, there wont be any problem because normally, to achieve full brightness of the display, it had to be connected to 3.3V, having it this way, the backlight can not be controlled programatically. At full brightness, my tablet could not take picture of it. So when I connect the backlight of the display to digital pin 9 of my Femtoduino, I can control the brightness but if connected this way, the full brightness of the display will not be achieved.

I still have plans to add more modules like the accelerometer and the digital compass which anytime soon will be arriving.

Finally, I took a video of the shield featuring the digital clock, the ringtone program that I downloaded from the internet, the screen for displaying the temperature, pressure, altitude and the vertical velocity. I am still in the process of finding ways to make the firmware efficient and planning to improve the splash screen. I am also going to add more functionalities like the device must be able to store the readings using the 3kB eeprom that is builtin the Femtoduino and display these reading on a line graph. The 3kB is already good enough to store the following:
  1. 1 minute of readings at 1 sec interval
  2. 1 hour of readings at 1 min interval
  3. 1 day of readings at 15 mins interval
  4. 1 week of readings at 12 hrs interval
  5. 1 month of readings at 5 days interval
The total of these readings will be 2.25kB and I will still have plenty of rooms for storing my other important settings( I will be writing more about the software on my next post). But unfortunately, those readings will be just for the altitude. I may consider to add a new module and that is the I2C eeprom to enable the shield to store more data.

Here's the video:

Tuesday, January 28, 2014

Status Update on my Portable Battery Bank

The batteries I ordered finally arrived. And so, this will let me finish my portable battery bank project. The batteries  ordered have the following specs:
  1. 3.7V 
  2. 2800mAH
1 battery is capable of charging my 7" android tablet 2 times or can be capable to power up my Arduino Digital Clock project for at least 5 days.
Here are some pictures of my project:

Each battery came in with an attached wire for positive and negative terminals for easy attachment and solderability to any diy projects. And I managed to quickly connect it to my 1Amp microUsb charger and my 500mAmp Usb DC-DC step up converter where I usually attach the device that I need to charge.

I tested my project for several days now and it performs just like what I have expected and I am so happy that it did just that.