After our previous article explored the potential of Bluetooth transmission, it was only a matter of time before we gave the NeoTeo Weather Station a wireless makeover. Originally designed as part of an RS485 network, the station now uses a Microingenia S.L. RN41 Bluetooth module to become a self-contained, portable instrument. That means we can finally take weather measurements in the field—without a cable, mains power or a computer tethering us in place. Radio lets us monitor and study weather data from a distance using any mobile computer.
After waiting since March, the NeoTeo Weather Station is back, now paired with the RN41. Its move from an RS485 network to a radio link gives it a new degree of mobility and independence. The changes to the original build are minimal; the circuit and videos show what to do. If you already have the earlier version, as we did, you can remove a few components and adapt others. For a new build, make a printed circuit board with connections for the Bluetooth module, but leave out the SN75176 (MAX485) IC and its supporting components.
The modifications are minor whether you are starting from scratch or reusing the original board. The board’s built-in 7805 voltage regulator can power the system, and the station can run from a battery. We used a battery connected to the NeoTeo modular power supply to provide the 5 volts required by both the Bluetooth module and the board carrying the PIC and other circuitry. No other hardware changes are needed. The PIC firmware, however, has been substantially revised: the program is simpler and easier to understand. At the end of the article you’ll find the source code, whether you want to adapt it for your own application, load our firmware onto a PIC, or study its structure and port it to another programming language.
With Bluetooth, there’s no need to manage data collisions on the RS485 network or keep the system constantly “listening for instructions.” The station takes measurements and sends them to the computer at intervals set in the PIC firmware. To receive the Bluetooth signal, use the same adapter from the previous article, plugged into one of the computer’s available USB ports. My computer has no built-in Bluetooth, so I use an external adapter.
PIC clock and RN41 configuration
The NeoTeo Weather Station circuit uses a 20 MHz crystal to clock the PIC, and its data connection runs at 38,400 bps. At that clock frequency, a higher data rate can cause transmission errors. Since external interference matters on a radio link, 38,400 bps is a safe, effective choice.
The RN41’s operating speed can be set easily: drive pin PIO7 high to select 9600 bps. If PIO7 is left unconnected or held low, the module switches to 115,200 bps. We could simply lower the PIC firmware’s speed to 9600 bps, but since we have set the PIC up for a faster rate, it makes sense to use it.
To set the RN41’s speed, enter the module’s programming mode and send SET commands. Type $$$ (three dollar signs); the module should reply CMD followed by a question mark. It is then ready for a SET command—in this case, SU,38 (without the quotation marks). To finish, send three hyphens, ---; the module replies END. Restart the system, and the module will use the speed set by the PIC.
It’s also worth reviewing the available commands to configure the RN41 to suit your needs. If a command goes wrong, you may need to restore the factory settings. Connect a 1 kΩ resistor from module pin PIO4 to its 3.3 V power supply. Then connect and disconnect the pin from the supply at least three times. This resets the module to its factory settings. You’ll need to enter your custom settings again afterward.
To send SET commands and configure the RN41 to receive the station’s data on your computer, use any software that can work with a serial port. HyperTerminal is one option; we used a tool included with our PIC programming software. Proton comes with Serial Communicator, which can send and receive data over a serial connection. Make sure the transmission speeds and settings match on the module, computer and software, both when configuring the module and when receiving its data.
As the videos show, getting started is simple: connect the power and data cables, and you’re ready to work wirelessly. The Microingenia S.L. RN41 Bluetooth module makes it easy. The magic of radio makes it possible—and, of course, NeoTeo is happy to share it with you.
Download the code: NeoTeo Bluetooth Weather Station