2015/06/10: Updated pictures to show my personal build of this project.
Over a year ago, I published the GPS time-date clock project here on Hackster.io:
Since that time, I have hacked away from time to time on my own clock to make minor improvements; for example, shifting from the 8-bit AVR Atmega328P to a 32-bit design based on ARM running at 72-MHz. The increased horsepower of the new design has allowed me to add significant new hardware and software such that in one unit, I now have both a GPS clock and a precision temperature and barometric sensor based on the BMP180 running on a $4.80 USD Chinese clone of the STM32 Maple Mini.
What this means is that you really need to know what you are doing in Arduino Land to replicate the project. Said another way, I do not hold your hand. I will list the parts, the connections, and other general build concerns, but there are no Fritzing diagrams showing point-to-point wiring.
But, if you have a few medium complexity Arduino projects of the 3.3V design under your belt, this one should not prove to be an obstacle to construction. For example, everything is 3.3V design: GPS, STM32F103 Maple Mini Clone, BMP180 I2C sensor, and the 2.2 inch 320x240 TFT ILI9341 SPI display.
This is an experimental design
The STM32F103 support under Arduino is an experimental design based on the original work done a few years back by LeafLabs. You can still purchase their original Maple Mini or for between $4 and $12 U.S.D. you can purchase a Maple Mini Clone on eBay or on AliExpress. I have clones from both sources and each work acceptably for this project. The original Maple Mini is a superior 4-layer board for superior analog performance but this project does not utilize any analog signals, so the clones perform acceptably. If you do purchase through one of discount/auction exchanges, please note that you are on your own as to the merchandise, quality, and even the receipt of the goods; I make no recommendation for your purchase.
Make-up of the new Barometric Pressure Display
This on-demand (via hand wave or via push button) is designed to be informative and provide much information in the 5 seconds it is displayed (of course, you can lengthen the 5 seconds by editing the code.) The SI unit of pressure is shown in the measurement of hPa and the Imperial pressure is shown in inches of mercury, or inHg - the screen labeling is improper in the stock picture.
The X axis consists of 320 pixels and the Y axis consists of 240 pixels. In graph is shown as a left-right (current to 12 hours previous.) The X scale will show tic marks for 3, 6, 9, and 12 hours. The right-hand legend shows the scale high-low which ranges from 985hPa to 1040hPa. This range was selected as adequate to cover the U.S. State of Georgia. The single magenta line (between 1012 and 1026) is a floating indicator which will always seek the lowest reading in the 12 hour span. One can easily add programming if they wish the peak reading, too, but the eyes acquire the peak reading visually much easier than the minimum; hence the single line in the display. Users opting to build this project can easily play with the code if they wish - the beauty of open source.
I am using a part many of you may not be familiar with: The Vishay TCRT5000 "Reflective Optical Sensor". Essentially, this is an IR diode with a NPN transistor gated by the IR reflective signal. In this project, passing your hand over the sensor at approximately 0.5 inch will cause the IR light to be reflected into the optical transistor section of the device and the base is biased into conduction.
Once the base conducts, the Emitter is electrically connected to the Collector and this will be used as a digital switch - notifying the STM32 that the human user wishes to view the barometric screen. If you do not wish this level of sophistication, you can use a momentary pushbutton with a 4.7K resistor to 3.3V Vcc.
Typical connections for use:
A == Anode of IR LED == 100 Ohm resistor to 3.3V Vcc
C == Cathode of LED == GND (common ground)
C == Collector Transistor == 3.3V Vcc
E == Emitter of Transistor == "but"ton connection on Mini Maple board
SDA == STM32 pin 15 *
SCL == STM32 pin 16 *
* Generally you must supply a pull-up resistor; refer to board manufacturer documentation as some breakouts have these onboard.
SPI ILI9341 TFT Color Display Module
Pin# GLCD Generic Breakout Connection
1 Vcc 3.3V Vcc 3.3V
2 Gnd Gnd (common)
3 CS Maple Mini # 13
4 Reset Maple Mini # 14
5 DC / A0 Maple Mini # 12
6 MOSI/SDA Maple Mini # 4
7 SCLK/SCK Maple MIni # 6
8 LED/BL/Backlight Vcc/3.3V **
** My breakout unit has a 10 Ohm onboard current limiting resistor. Other units may require a current limiting resistor if one is not provided.
GPS 9600 BAUD serial output goes to Maple Mini board pin #0 which is labeled rx3. This project makes use of SoftwareSerial (a hacked-version for STM32) and rx3 will be dedicated to the GPS functionality.
Pin #18 on the Maple Mini is left open for non-DST (Standard Time) and is closed to ground for DST. Changes to this pin state much be accompanied by a Reset to take effect.
Pin "but" or the second button pin has already been mentioned: it is open for normal use and is pulled up to 3.3V to signify a request for the Barometric screen. The signal to but must go high and then go low before the screen transition occurs.
Generally speaking, most of the pins and signals are documented in the source code. If you are looking for something specific, the code should provide the answer- please search.
The code - my portion is Public Domain but other more restrictive uses for some libraries are included in the license.h tab. For example, Adafruit_ILI9341 is published under the MIT license. The SoftwareSerial library is under the GNU Lesser GPL.
Updated: May 1, 2015
- Small changes to allow GPS clock to work without BMP180 connected.
- Small changes in BMP180 graphing routines to align Y-axis correctly with legends.
- Small changes to allow code to compile with STM32 core files after 4/15/2015.
Please note that all source code must go into one directory - this is because many of these standard Arduino libraries have been modified (hacked!) to work with the STM32 Maple Mini board and microcontroller. The current directory name is GPS_Time_Baro
Note: The big gray thing under the display is the USB rechargeable 5V battery pack. Unit runs constantly, so there is no power switch. Separately purchased AC to USB wall unit keeps things charged.