techBASIC Example Circuit
The example we are about to describe shows how to read data from climate sensors using techBASIC. The sensors can measure temperature, humidity, atmospheric pressure and UV intensity. The readings are sent to an iPhone or iPad, which runs a techBASIC program, over BLE. For BLE communications we will be using a BL600 module, which will surely be familiar to many Elektor readers. We will make use of two breakout boards: an Adafruit Si1145 breakout board for UV intensity measurement and a BME280 breakout board for the other three quantities. The whole thing will be powered from a CR2032 coin cell: in my prototype one cell has already given about ten months of continuous operation.
The circuit is shown in Figure 1. If desired, a ‘USB to UART converter’ can be attached at JP1 to allow programming and debugging of the BL600 module. JP5 allows configuration of the operating mode of the BL600: the details have already been discussed comprehensively in Elektor. In our application the jumper must be fitted in the ‘AUTORUN’ position. One special feature is the button S1: this, in conjunction with the software, is the key to the low power consumption of the device. Normally the device is in what is called ‘deep sleep mode’, where the current draw is very low indeed. Only when button S1 is pressed will the device wake up, read the sensors one by one, and transmit the readings over Bluetooth. After about two minutes the BL600 returns to deep sleep mode. The software for the BL600 ($autorun$.klima.sb) is available for download from the Elektor website .