element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Blog Bluetooth Instrument Datalogger
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: rsc
  • Date Created: 28 Mar 2016 4:01 PM Date Created
  • Views 1287 views
  • Likes 3 likes
  • Comments 6 comments
Related
Recommended

Bluetooth Instrument Datalogger

rsc
rsc
28 Mar 2016

image

Description

Abstract

The standard for transfer of digital data from instrumentation for many years has been RS232. Very few computers and laptops are currently manufactured with RS232 interfaces. To interface with these instruments, USB adapters can be used, or older computers can be retained in the lab for specific instrument use. This can cause problems for researchers with software compatibility and network interfacing. The Bluetooth Registered wireless technology has been around since 1994 and can be used to interface with these instruments. This paper describes a method to interface a R. M. Young model 81000 ultrasonic anemometer to a small Arduino Registered (Atmel) microprocessor via Bluetooth, and logging the digital data directly to a micro-SD non-volatile memory card. A real-time clock (RTC) is included to add a timestamp to the data stream.

Hardware – Instrument Transmitter

  The ultrasonic anemometer is powered by an external DC power supply from 12 to 30 volts.The Bluetooth interface requires a 5VDC power supply.A circuit board was built with a 5VDC regulator to utilize the same power supply as the anemometer.Two other circuits are required on the instrument side, a RS232 voltage level shifter, and the Bluetooth RF module.Bluetooth modules have different output levels for specific applications, a Class-1 module was chosen for this project for maximum distance (20m-30m).The circuit board for the instrument transmitter is shown in figure 1.

image

The Bluetooth module was designed by SparkFun electronics (WRL-12580) as a simple streaming modem, and is capable of baud rates up to 115200bps. The inputs to the module are TTL Rx, Tx, and 3.3 to 6 VDC.The module can be programmed for master or slave operation, and can be bound to a specific module, or can pair to the first device it finds.The RS232 level shifter for this project is also from SparkFun electronics (PRT-08780) and interfaces the Bluetooth module TTL Rx and Tx pins to the RS232 level pins of the instrument.The schematic for the instrument side wiring is shown in figure 2.

image

The physical connections to the R.M. Young 81000 anemometer are shown in figure 3.Pins used are +PWR (12VDC), PWR REF(GND), Tx-O, RX-I, and SREF(GND).

image

Hardware – Bluetooth DataLogger

The datalogger circuit was built by combining four off-the-shelf modules.The first is an Arduino Registered Micro prototyping board designed around the Atmel ATmega32u416MHz processor.A real-time clock (RTC) module from SparkFun (BOB-12708) is connected to the Arduino via a two wire I²C interface. This module is required to add a timestamp to the data stream.The data is received by another Bluetooth module (WRL-12580) and the combined time information and anemometer data is written to a micro-SD memory card using another SparkFun product called OpenLog (DEV-09530).OpenLog is a small PCB that combines a SD card reader with an AtmelATmega328 processor,and uses an open source software library available through the GitHub repository.The datalogger is programmable using the Arduino Registered PC software, and the PCB can be powered by battery or a small (500ma) 5 VDC power supply.The datalogger is shown in figure 4.

image

 

The four modules are connected using a standard prototyping pcb and a few jumpers to allow in-circuit programming of the Bluetooth module and the OpenLog module with a serial port TTL adapter and a standard PC terminal program such as Hyperterminal or TeraTerm.Figure 5 shows a block schematic of the module wiring.The 5 VDC power to all the modules comes from the micro-USB connector on the Arduino board.An externalpower supply can power the datalogger from this port also.

image

Software – Bluetooth Module Programming

To save time and keep the Arduino program simple, the programming for the modules are done off-line before powering the system.The parameters for the Bluetooth module are as follows:

***Settings***

BTA=00066669aaaa

BTName=RNBT-aaaa

Baudrt=38.4

Mode=Pair

Authen=0

PinCod=1234

Bonded=1

Rem=00066669bbbb

In this mode, the Bluetooth module will automatically look for device 00066669bbbb and pair with it after powering up.

Software – RTC Module Programming

The real time clock module only needs to be set once when the lithium coin cell battery is first inserted.A line in the Arduino code is added to set the clock, then it is commented out and reloaded.The following is the line of code required to adjust the time to 17 April 2015 at 11:20am:

Rtc.adjust(DateTime(2015, 4, 17, 11, 20, 0));

The RTC module keeps time in seconds only, so the Arduino software must add the milliseconds to the timestamp before sending the data to the SD card.

Software – OpenLog Module Programming

The software for the OpenLog module did not need to be changed for this project.The configuration settings are written to a file on the SD card when a new formatted card is inserted in its socket.The standard configuration file is very short and consists of the following two lines:

38400,26,3,0,0,0,0

baud,escape,esc#,mode,verb,echo,ignoreRX

Software – Arduino Micro Programming

#include 
#include "RTClib.h"
RTC_DS1307 rtc;
char inblue = '$';
const int ledPin = 13;  
int ledState = LOW;  
long msa = 0;
long msb = 0;
bool sync = false;
DateTime now;
DateTime now1;
void setup () {
  pinMode(ledPin, OUTPUT);
  Serial1.begin(38400);
  Wire.begin();
  rtc.begin();
  now = rtc.now();
  delay(2000);
  msa = millis();
}

void loop () {
  delay(10);
  now = rtc.now();
  if (now1.second() != now.second())
  {
  msa = millis();
  now1 = now;
  }
  msb = (millis()-msa);
  if (msb > 999)
  msb = 999;
  Serial1.print(now.year(), DEC);
  Serial1.print('/');
  Serial1.print(now.month(), DEC);
  Serial1.print('/');
  Serial1.print(now.day(), DEC);
  Serial1.print(' ');
  Serial1.print(now.hour(), DEC);
  Serial1.print(':');
  Serial1.print(now.minute(), DEC);
  Serial1.print(':');
  Serial1.print(now.second(), DEC);
  Serial1.print(':');
  Serial1.print(msb, DEC);  
  Serial1.print(' ');
  inblue = '$'; 
  while (inblue != '\r')
  {
  ledState = HIGH;
  digitalWrite(ledPin, ledState);
  inblue = '$';
  if (Serial1.available())
  inblue = Serial1.read();
  if (inblue != -1){
  if (inblue != '$')
  Serial1.print(inblue);
  }
  }
  Serial1.println("\r");
  ledState = LOW;  
  digitalWrite(ledPin, ledState);
 }

 

Data – Sample Data Stream recorded on SD card (LOGO00145.TXT)

2015/4/17 15:55:27:937 -0.03 -0.08 0.16 26.47

2015/4/17 15:55:27:950 -0.03 0.00 0.16 26.47

2015/4/17 15:55:27:983 -0.08 -0.03 0.14 26.51

2015/4/17 15:55:27:996 -0.10 0.03 0.16 26.47

2015/4/17 15:55:28:0 -0.08 0.00 0.18 26.51

2015/4/17 15:55:28:50 -0.03 0.03 0.19 26.56

2015/4/17 15:55:28:64 -0.03 0.00 0.16 26.59

2015/4/17 15:55:28:131 -0.07 0.03 0.14 26.56

2015/4/17 15:55:28:170 -0.07 0.03 0.14 26.56

2015/4/17 15:55:28:182 -0.03 0.08 0.16 26.59

 

(Published also on Hackaday.io)

  • Sign in to reply
  • rsc
    rsc over 9 years ago in reply to DAB

    In the lab we use them to calibrate CTA hot films and hot wires, in the field we use them for basic meteorology measurements.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • clem57
    clem57 over 9 years ago

    Know why it is called the R.M. Young 81000? Because it uses 81,000 volts!

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 9 years ago in reply to rsc

    That is some serious coin, are you using it in a laboratory environment or field work?

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • rsc
    rsc over 9 years ago in reply to DAB

    The R.M. Young 81000 was $2750.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 9 years ago

    Very nice post.

     

    I liked the easy to follow descriptions and code example.

     

    Just curious, what did the anemometer set you back?

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube