Author Archives: egurvitz

HobbyKing AIO – GPS and Bluetooth

I started by connecting the HobbyKing AIO board to the GPS that I bought from HobbyKing for $35 and to the HC-05 Bluetooth module. This allows me to configure the AIO via BT.


The connections are as follows:

GPS to AIO board

The UBlox Neo-7M GPS comes with a cable that has 2 mini-molex connectors, one with 4 pins and one with 5 pins.

gps connector

Some changes must be made to these connections in order to fit them to the AIO board. Moving the cables between pins is simple – lift the flap that holds the cable inside the connector and pull the cable out. See the photo below.


The changes to cabling are as follows:

4-pin connector

The 4 pin connector is connected to the i2C connector on the AIO.

It should have the following cable connected to it, from top (leftmost) to bottom:

  1. SCL – moved from pin 2
  2. SDA – moved from pin 3
  3. VCC – moved from the 5-pin connector
  4. GND – moved from the 5-pin connector

5-pin connector

The TX and RX cables from the 5-pin connector must be connected to RX2 and TX2 on the AIO board respectively. So I replaced the 5-pin connector with a 6-pin connector that I had from the AIO package and connected the TX and RX cables at the right slots.

AIO board to HC-05 BT module

The BT module connects to the FTDI port on the AIO as follows:

  1. AIO GND  —> HC-05 GND
  2. AIO VCC   —> HC-05 5V
  3. AIO – RX   —> HC-05 TX
  4. AIO TX is connected to HC-05 RC via a voltage divider in order to protect the HC-05. The HC-05 uses 3.3V while the output of the AIO board may be 5V. The following photo of a crumpled piece of paper shows the two resistors that form the voltage divider.


AIO external power

The AIO receives 5V power from an external source on the GND and VCC pins.

HC-05 Setup

The HobbyKing AIO that I’m using in this project talks MAVLink with the APM console (or any other MAVLink management console). I decided to use BT for connecting it to the console so I borrowed a HC-05 module from my good friend Tomer.

The HC-05 comes configured for 38400 bps (bits per second) so the first step was to configure it to operate at 115200 bps.

Configuration of the HC-05 is done with a FTDI board. I bought one on Ali express for $2.48.

Here are the HC-05 on the right and the FTDI board on the left:


This FTDI board has a switch that sets it to use 3.3V or 5V. Since the HC-05 is sensitive to voltages over 3.3 I used 3.3V.

The HC-05 enters configuration mode (via AT commands) when pin 34 is pulled high. On this board pin 34 is connected to “Key”.

The two boards are connected as follows:

  1. FTDI ground —> HC-05 ground
  2. FTDI TX          —> HC-05 RX
  3. FTDI RX          —> HC-05 TX
  4. FTDI VCC       —> HC-05 Key
  5. FTDI VCC       —> HC-05 5V

Now the FTDI board can be connected to a USB port and you can use a terminal program (I used Arduino’s serial monitor) to connect to it. Remember that the connection speed is 38400.

Sent “AT” to the board and it should respond with “OK”.

To change the bit rate send “AT+UART=115200,0,0”. The board should respond with “OK” and it is ready.

The data sheet for the HC-05 can be found here.

Flying by cellular – Project Plan

After a long break while working for a start-up company I’m returning to my main technological hobby – quadcopters.

This time I’m building a quadcopter based on the HobbyKing AIO board:


My main goal is to control the UAS (unmanned aerial system) over the cellular network. This means that commands will be sent to the UAS over the cellular network and the video feed from the UAS to the operator’s console (a computer, or a cheap PS3 joystick) will also be transmitted over the cellular network.

There is nothing new in this approach by itself and people all over the net are doing it by putting a $50 Raspberry Pi running Linux on the UAS. My angle on this would be to try and achieve this goal with cheap hardware.

My development plan is as follows:

  1. Build a good and stable UAS and get it to fly with the HK AIO controller – using the HK firmware
  2. Compile the firmware from sources, configure it and get it to fly
  3. Transmit commands over the cellular network
  4. Transmit the video feed back over the cellular network

LED Controller – production version 0.1

The time has arrived to move the LED controller circuit from the bread board to a real board. It was to be my first experience with relatively delicate soldering of quite a few connections. I stuck the few components onto the board and started soldering the underside.


I realised after a short while that I shouldn’t have placed cables on this side at all because the soldering will break if any pressure is applied to them. Also, after some cables were already soldered it because difficult to solder more of them, especially those connections that already lay under other cables. Anyway, most of the cables in the photo above connect the 7-segment controller with the 7-segment display.

On the left side of the photo you can see the two common ground an 5V lines that I connected to the board. This was very convenient.

I passed the rest of the cables on the upper side.

One of the nice features of the board is the old green connector that I salvaged from an old PC board. In this photo I connected LEDs for verification, but when I’ll mount it onto the quadcopter I’ll connect the cables attached to the LEDs. Getting it out of the original board was hard and attaching it to this board was even harder because its pins were wider than the holes in the board. I filed them for a long time and finally decided to hammer the piece (gently) onto the board. This worked.


And here is the board in operation.

I had to protect the cables running on the bottom side so I prepared a frame from two pieces of this soft plastic material whose Enlish name I don’t know. I cut the frame to be smaller than the board so that it will hold the board in place.


When I replaced the test LEDs with real high-intensity LEDS I found the following problems:

  1. The high-intensity LEDs are rather dim. I didn’t debug this problem yet but I can think of two possible causes. One is that I used resistors that are too strong (220 Ohm).
  2. I may connected the transistors incorrectly.
  3. The transistors are not sourcing enough current.

I will have to talk to my friend Tomer about this problem.

CDS – Installation and Operation

The electronic part of the CDS is relatively simple compared to its installation. I started by gluing the sensor box to the metal window frame with a 2-sided glue strip.


Then I found a small reflector on an old bicycle and glued it with plaster at the exact position on the opposite wall.

Some time passed until I decided to finally connect the water pipes to my automatic irrigation system. I did that only when I discovered a small hole in one of the main pipes and had to take it apart and replace that section of the pipe. So I added a T-shaped connector and drew a line towards the window.


This is how both ends of the system look like.


And … it works perfectly!

One more video.

And here is how it looks from outside.

CDS – Cat Deterring System – Development

One of the cats living in our backyard has been bothering us for a long time. We love cats, but this one keeps sneaking into the house, meowing loudly even when it’s not hungry and trying to steal food on every occasion (even though we feed it outside). When we have a family meal we can’t open the kitchen window because it jumps inside and then tries to jump on the table.

Nothing helped until my daughter came up with the idea for a Cat Deterring System, or CDS in short. CDS is based on cat’s fear (or deep dislike) of being wet. The idea is to install a motion sensor across the window that opens an electric tap when the cat jumps on the ledge and sprays a could of water. Simple and cool.

I started by ordering this sensor on eBay. I checked the prices right now and they are very high. I managed to buy 2 of these for just 10 Euro each. They now sell for much higher prices – between 30 and 100 euros!


I also ordered an electric solenoid valve running on 12V (as the sensor). These valves were rather expensive and I’m a bit surprised that I bought them just for scaring a cat away …



These components were lying on my shelf for several months before I finally got down to develop the system. But at some point my wife threatened that she would do something drastic about the cat so I had no choice. I didn’t want to find out what that may be.

The most difficult part was to understand who the sensor works. Quite early in the process I realised that I need a reflector to position opposite the sensor. I also needed to create a connector for the sensor because it didn’t arrive with one. The sensor has 4 connections, two for ground and 12V input and output pins – one is high when the beam is reflected (no obstruction) and on is high when the beam is blocked. My friend Tomer helped me with the connectors – 4 pins salvaged from an old serial cable.

I hooked up a simple circuit in which the output of the sensor connects an old 12V relay that I had at home and the relay opens the valve. I needed the relay because the output from the sensor could not hold the valve open. Tomer said I should have used a transistor and that a relay would not work fast enough but in fact a relay is just perfect, and I had nothing to do with it.

So I set up a small test rig to try and get the sensor to work.




After looking around for a reflector I found an old hologram which worked well. You can see it in the next picture. Unfortunately, the sensor is very sensitive and can detect the reflected beam only if the reflector is set just right. It took me a very long time to get it to work.



The video below shows the system in operation.

The sensor has two lights, a green one that indicates that it is on and an orange one. The orange light comes on when the beam is reflected properly. It blinks when the beam is detected but not perfectly. It goes off when the beam is blocked.


LED Controller version 0.1

After many evenings and a long time of learning to use all the required resources of the PIC16F1825, here is the first version of the LED controller for my quadcopter. It requires some debugging but it works.

The video shows the test setup of the LED controller. The transmitter is on the right and the receiver is the small box between the transmitter and the breadboard.

The circuit on the breadboard consists of two PIC controllers, a 7-segment display, LEDs and some resistors. The left PIC controls the 7-segment and the one on the right controls executes the application.

When the video starts the 7 segment display shows a rotating segment for a split of a second. Then it enters the startup sequence for about 1 second. During this time the 7-segment displays  888 and all the LEDs light up. Then the 7-segment display shows the current mode and the LEDs enter this mode. The initial mode is 1 and all the LEDs are off.

Then I push the button that is associated to channel 6 upwards. This changes the PWM value on the channel and the modes start to change. There are 14 modes, so each mode corresponds to a range of PWM values and hence multiple presses are needed to switch to another mode. Notice how the LEDs change their behaviour when modes change.

There are still some bugs in the system. Notice how the number 154 appears on the display when I start pressing the button. This is because I configured the lower PWM value higher than the real minimum value. Also, the changing of modes is not smooth or predictable. This could be related to the non-linear configuration of the channel.