Friday, 23 May 2014

BlueFlyVario_TTL_GPS_v9 Released

The BlueFlyVario_TTL_v8 has proven to be very popular to use with the Kobo. I think that most people who have ordered one want to use it with a GPS, so today I am happy to release the next version with an included GPS and upgraded firmware - the BlueFlyVario_TTL_GPS_v9.

GPS Selection

I chose the Global Top PA6H GPS for a few reasons:
  • It is pretty cheap.
  • It has good performance for low power consumption. 
  • It is small.
  • It has a sleep mode. 
  • Many people have used it (or the Adafruit Ultimate one, which is pretty much the same with slightly tweaked firmware). 

The new device is shown in the image below. From a hardware perspective the only key addition was the GPS and associated LED, resistor and capacitor. 

I initially added a small switch in near the ttl serial to switch the voltage, but discovered that the Tx and Rx lines keep the device powered and sucking power. So I did not include the switch, and instead have added some firmware settings to reduce power. The device includes a neoprene cover over the pressure sensor and the device is encased in heatshrink. Also note that the TTL_GPS_v9 is shipped with the 1x4P 2.54mm header and the 4 pin dupont connector

Kobo Installation

This device is specifically targeted at installing on the Kobo. The directions in my previous blog post are all still applicable. Some users will want to solder wires directly to the device (from the back) then drill 4 x 1mm holes into the Kobo at an appropriate spot, put the wires through, then solder them to the circuit board. Others will want to solder on the 4x1P header and use the dupont connector. Post your installation pictures on the Facebook page

Firmware Updates

The v9 firmware has some important updates to hardware settings and commands:

  • uart2BRG - $BR2 xxx* - where xxx is used for altering the baud rate of U2 (the main output). This should really only be used with extreme care, but there are a few cases where it is the only way to communicate with the GPS via the micro. 
  • uartPassthrough - $BPT x* - where x is a boolean used for passing characters received on U2 through the micro to U1. Due to different baud rates (U2 > U1) the characters are stored in a FIFO buffer of length 100. This length allows for normal NMEA commands when the baud rates are different. 
  • uart1Raw - $BUR x* - where x is a boolean used to indicate if characters received at U1 are should passed straight through to U2 or recorded line by line (i.e. $...<LF>) and then multiplexed with pressure output. This is used to allow bulk transfer of information that is sent by GPS other than standard NMEA sentences. 
  • greenLED - $BLD x* - where x is a boolean to indicate if the green LED is lighted for each lift beep.
  • outputMode - I added a new outputMode = 4, which essentially stops the pressure output. 
  • $RST* to reset the module, essentially a hot reboot. 
  • $RSX* to reset the module and reset all of the hardware settings to factory defaults, an extended hot reboot equivalent to start up with programming pads 2 and 4 shorted. 
  • $SLP* to send the module to sleep mode. Note it also sends the PA6H GPS to sleep mode using the PMTK standby command. The micro plus pressure sensor consumes about 0.05mA in sleep mode, but the GPS still consumes about 1.5mA. To wake from sleep mode without a power cycle you just send any character to the module on U2. This will then force a hot reboot, and you are back to the power on state, including the GPS. 
I should get around to updating the hardware settings manual and BFVDesktop app for these new settings by the time shipments arrive. 

The TTL_v8 and v8(Bluetooth versions)

I will be shipping future BlueFlyVario_TTL_v8 and BlueFlyVario_v8 (Bluetooth) with the new V9 firmware from today.

However, note that the BlueFlyVario_v8 (Bluetooth) are currently on back order. I am still waiting on components (sorry). I should be able to ship in a few weeks. 


The schematic and pcb layout for the new device is shown below. 


  1. Al, I found your blog while googling for variometer schematics and I'm very happy you shared your research results here. I'm also contemplating about building an audio variometer but I'll most likely use an Arduino Pro Mini and a MS5611 baro, because I have some Arduino experience. I'm also a newbie Android developer and have a Nexus 4 with baro sensor. So I started to wonder which is the best way to do it. What are the advantages of creating a hardware variometer over writing an Andoid app to use the phone's baro sensor?



    1. If we want a vario which is sensitive and responsive there are a few important ingredients. We need the sensor to be very sensitive and we need to be to be able to read it very often and with reliable timing. The BlueFlyVario pressure sensor has a resolution of 10cm and it is read 50 times a second with very reliable timing between measurements (20 ms). Pressure sensors on phones typically have a resolution of 25 ms, and it is hard to control how often it is actually read and know exactly when each measurement was made because android is doing all kinds of others things at the same time. It is possible to make a vario using the phone's sensor, but it will not be like a dedicated device.

  2. Hi Al.
    You are totally right with the problems in power management. I discovered the same when I wanted to measure the current drawn by the module, the TTL_V8 continued to run without V+, only TX, RX and Gnd connected. It even delivered correct altitude values. The RX not, but TX delivers around 60 mA total, but it is not ok that this supplies the PIC. May be the I/O register must be different programmed, so that the “Input” pin 5 U2RX is not able to supply the chip.

    I still like the idea to have a switch to turn on/off the module as well as to toggle the speaker volume. This should be easy task, because you are using the TC1015 voltage regulator which has a shut down pin. So a tiny switch connected to an input “S” of the PIC and with a diode to the TC1015 pin3, and an output “ON” from the PIC also connected to this pin 3 will do it. After power on by the switch, the PIC will set his output “ON” to high to keep the TC1015 on. Input “S” signals will afterwards be used to switch the volume of the speaker alternating to 100%, to 50%, to 10%, to off, to 100%. Every push could be confirmed by the LED to go on with the keystroke. When thereafter for example a input “S” signal is detected for more then 3 seconds, the PIC could initiate a shut down procedure and set the output “ON” to off.

    I am sure you get a lot of proposals, probably better than mine. But may be you consider this for the TTL_V10.
    Cheers Martin.

    1. Martin,
      I tried a range of settings on the IO pin, but I could not force it not to draw power. The datasheet implies that power should only be supplied to a pin if Vcc are connected.

      I will do something like what you are suggesting for the switch on an off and for the speaker volume. I will probably just use the sleep function of the micro for on/off after a long press on a tact switch (the micro consumes very little power in sleep mode), but will have a separate TC1015 for the GPS which I use to switch the enable pin. When off, a short press of the tact switch will turn on. When on, a short press of the tact switch would cycle speaker volumes. The tact switch will be on a spare IO and will use the CN interrupt to wake from sleep. A power cycle would turn the device on.

    2. That sounds not so bad. I know, I have also loked to the datasheet and could not clear find how this problem could be solved. May be I should ask Microchip. I will invastigate that further and keep you informed. But before you ad a second voltage regulator as a go around, you could add a simple mosfet transistor to cut the RX line. This could by the way improve the TX Signal level. In addition you can power the U-bat on the GPS chip with V+ from before the existing voltage regulator. I think you either need the Vario and the GPS (i.e. with a Kobo like me) or you do not need it at all. A sleep mode will not be required.
      Cheers, Martin

    3. I still think soft power off with the sleep mode is the best way to go. This effectively shuts down Rx and Tx.

      I tried using an IO to power the GPS but the dropout is too much when powering the GPS. This story starts in other parts of the circuit. It is really important to supply the PIC and MS5611 with a stable supply. The 3.3 coming out of the Kobo is a little too noisy; the 'main' LDO helps as part of the stability control. However, I need to use a 3.0V TC1015 as the 3.3V version becomes unstable with only a 3.3V supply. The no-load voltage on an io pin is close to the supply (which is now 3.0V) but as soon as the GPS draws 20mA or so then the voltage drops below the minimum supply of the GPS (down to below 2.6V), and the GPS fails to work. A P-Channel mosfet to switch the GPS supply from the main rail would work, but a second TC1015 will work just as well and is not much more expensive (a few cents). I can't really use a super cheap N-Channel mosfet on the ground as I think it will screw up the nice ground plane which helps with GPS performance.

    4. I got your points. Yes I found out that the I/O´s of the PIC have overvoltage protection diodes to Vpp. So when you lower Vpp 0.3 V below the Input pin, these pin starts to source Vpp.

      As you know, I am using the blocx NEO-6M GPS module, which has his own voltage regulator. Therefore I disconnected VDD to the GPS on the BFV board and made a bridge with V+ from the header, so the GPS module is parallel supplied from the 3.3V from the Kobo. So if you are using the GPS module MT3339 you will probably need a extra VR for the GPS.

      I am still concerned about the current draw from the TX line when Vpp is off. My idea was to place a tiny Mosfet => D to Vpp, S to RX pin and the Gate to TX, perhaps with a 47K to Gnd to prevent noise. May be better solution would be to use a dual Op Amp like LM358 to drive TX and RX lines by Vpp. This would kill the lines when you shut power off. Or I go ahead and place a 10K in the TX line, what would at least reduce the current to 0,3 mA and should not jeopardy the Input signal level.

      Sorry if I bother you with this discussions, but I see a great demand in a simple module, what you could use with e-book reader like the Kobo. I guess you discovered the same. It might not be so tiny, but it should provide perfect signals.

      Cheers, Martin.

    5. Thanks Martin. I welcome the discussion. The module in its current form works well as the Kobo shuts appears to shut down the Tx and Rx lines at poweroff. When the Kobo is switched on Vpp draws power, but neither Tx and Rx do. If you switch to sleep mode (by sending $SLP* to the module), then power is again only drawn by Vpp, and it is a lot less. If you switch the Kobo off then no power is drawn by any lines.

      I know I could add components to clean up Tx and Rx lines, but it works very well without them.

    6. One simple idea more;-) What´s with a pull up at pin 6 (22K) and a (fast) diode to the TX line??

    7. I am not sure how that would make it better? I am trying to keep everything as simple as possible with minimal components.

  3. Has anyone put any thought into an enclosure for the PCB? I'm waiting for my TTL_v9, and wondering how I will protect it. I'm thinking about a ventilated plastic box, using the dupont connector, and attaching it with velcro.

    Any other experience with this? Would it make sense to mount it on the rear? The pressure sensor should work fine so long as the box is ventilated, right? Anything I need to keep in mind?

    1. Ben,

      What you do not see in the picture is that the PCB is enclosed in heatshrink. This keeps the little bit of neoprene securely on the pressure sensor. It also protects most of the electronics from sweaty fingers creating random shorts in the circuit. I would not be too concerned about putting the whole thing in a case unless you are super concerned about how it looks. I have just glued mine to the front.

      Sometime soon I intend to upload another blog post with pics which show a slightly different way of installing on the Kobo. To start with I drill the 1mm holes for the wires 2.54mm apart to match the spacing of the header port. Instead of using the dupont connector I solder wires directly to the board, then mount the whole thing flush. You can't see the wires at all.

    2. I would like to see this alternative method.I'm discussing with my colleague what the best way would be to install / attach the vario to the kobo.

      Do you think using something like Sugru ( would be an option? Or would it affect the pressure sensor to much?

    3. I think Sugru is a good option, you just need to leave a little hole for air to get to the neoprene under the heatshrink. Not a big hole, a small pin prick in the top of the heatshrink should be enough.

  4. hello,
    thank you for your researchs.
    just one question about power and battery ....
    I have noticed that the kobo battery is quiet thin (3mm, 45*60 mm) and that there is place enough to put a thicker battery (about 6 or 7 mm). That way, it should be possible to put a 2000 ma (may be a little more) instead of the original battery (1000 ma).
    Do you think this is technically possible ? (filling the empty space is not a heating problem ?)
    Can you confirm that the battery is a "Li-po" battery ?
    I have found,on the Net, chinese dealer who sells that kind of batteries but it seems to be complicated to buy just a few batteries...
    Do you know where i could find easily such batteries ?

    thank you for your help

    1. I can only tell for the kobo touch. I have bought this battery:
      It is for Samsung mobile phone and has the right measurments to fit into the kobo.
      I have soldered the original cables to this battery, protection is the same.
      Cheers Marty

    2. Martin was it easy to get the original battery out? I've also looked into this but found my battery to be glued in and I'm worried that it's glued to the back of the screen.

  5. Sorry, I just saw your reply.

    Yes the battery is clued, but with a little care and with a flat knife I could loosen it. I have removed the black foil from the new battery as well as the plastic frame. By that the new battery measures only 57,6 x 42,75 x 4,5 mm. So probably a little bigger battery might work. I measured that up to 60 x 48 x 5 mm should fit. A little try and error to find the best replacement battery.


    1. Cool, I'll be going this route too. With the external speaker I'm draining more power. Do I understand correctly that you just used the original protection circuitry on the new battery?

    2. Ah, having done some reading the protection circuitry should be located in the new battery too, and so as far as I understand it I can simply connect the battery>

  6. Is there an android app that can configure v9 over telnet ? Ie. create a wifi network on the android, have the kobo join that network, then have the android app configure the the bluefly over telnet commands. ??

    1. I do not know of such an app. You would also need to run an application on the Kobo to connect to the serial port. I am sure it is possible.

  7. Al,
    could you tell me how to disable only the sink tone.
    I have tried to adjusting BFS to something really high (500), but it still gives me a sink tone when flying. And no, I'm not descending that fast ;-)