Getting Started with the nRF08001 Bluetooth LE chip

 

Initial setup for this project began early this week starting with soldering header pins onto the nRF08001 Bluetooth LE (Low Energy) breakout board so that a physical connection could be made with an Arduino Uno module to begin testing. A valuable resource that helped getting started can be found at adafruit.

The wiring of the Bluetooth board to the arduino was done as follows. 

Wiring Schematic


Wiring Schematic via Adafruit Wiring Schematic via Adafruit 

Wiring Schematic via Adafruit 


Wiring completed on April 5th to begin testingWiring completed on April 5th to begin testing

Wiring completed on April 5th to begin testing

  • VIN connects to the Arduino 5V pin (Red Wire)
  • GND connects to Arduino ground (Black Wire)
  • SCK connects to SPI clock.  (Blue Wire)
    On Arduino Uno/Duemilanove/328-based, thats Digital 13
    On Mega’s, its Digital 52 and on
    Leonardo/Micro its ICSP-3 (See SPI Connections for more details)
  • MISO connects to SPI MISO. (Yellow Wire)
    On Arduino Uno/Duemilanove/328-based, thats Digital 12
    On Mega’s, its Digital 50 and on
    Leonardo/Micro its ICSP-1 (See SPI Connections for more details)
  • MOSI connects to SPI MOSI. (Teal Wire)
    On Arduino Uno/Duemilanove/328-based, thats Digital 11
    On Mega’s, its Digital 51 and on
    Leonardo/Micro its ICSP-4 (See SPI Connections for more details)
  • REQ connects to our SPI Chip Select pin. We’ll be using Digital 10 but you can later change this to any pin. (Grey Wire)
  • RST connects to Digital 9 – this is for resetting the board when we start up, you can later change this to any pin. (Orange Wire)
  • RDY is the interrupt out from the nRF8001, we’ll connect to Digital 2 but be aware that if you want to change it, it must connect to an interrupt capable pin (see this Arduino page for which pins are interrupt-capable. Digital 2 is OK on Uno/Leonardo/Micro/Mega/etc.) (White Wire)
  • Note: Wire colors refer to first wiring diegram

Initial Testing

After wiring was completed testing of bluetooth transmissions and functionality began with positive initial results. By running a sample arduino code found on GitHub we were able to communicate to the arduino via the “Bluefruit LE” android application and likewise was able to transmit data from the command line of the arduino workspace directly to a smart phone via the bluetooth module.  Further Testing will contiuno next week.


Snip from the Arduino Serial Monitor during testingSnip from the Arduino Serial Monitor during testing

Snip from the Arduino Serial Monitor during testing

– Tom DeBell, Beginning Researcher Support Program researcher

Testing the range of LoRa radio breakouts

Abstract:

Today I confirmed that the range of the LoRa devices is at least 1-2 km; the documented range on Adafruit’s website is 2km line of sight in an open area.  I took a walk and brought along one LoRa radio to the far west side of campus.  

Procedure:

Code on the Pro Trinket and the Arduino has been modified to send updated sensor values to and from the transmitter as packets of data.  I the receiver along on my walk and waited for the LED to stop blinking indicating that nothing was being transmitted.  In the video below, the red LED on both radio units lights up if the sensor hooked up to the transmitter sends a value below 36 cm to the receiver:  


LoRa_rangeLoRa_range

Results:

About 1.6 km (a mile) of open space was between the receiver and the transmitter before I reached some tall trees and the connection began to cut out.

 

 

What’s Next:

Now that I have the two radios constantly sending signals back and forth, my next job will be implementing a timer to limit the sending of sensor values to once every second and eventually use the LoRa radios into transmit data from a rain catchment  device.

 Marissa Kwon Undergraduate Student Researcher

Adafruit IO data logging update

By: Alex Grejuc

I have been working on using an Arduino and an ESP8266 wifi module to log data on an online platform for the past few weeks and after many hurdles, I have something that works reliably.

The general progress can be seen in the previous blog posts, so I will not discuss that.

Background:

This code hinges around sending HTTP GET requests. GET is an HTTP method that “asks” for a resource (a web page) from a server. In this case, we are requesting to send data to the IO platform. A GET request follows the general format:

GET HTTP/1.1

Host: <host>

Connection: close\r\n\ (connection can also be kept alive with keep-alive)

When sending these over the ESP, \r\n (carriage return and newline characters) must be appended to each line (the last line has an extra \r\n). Without them, the command may not be properly understood by the server.

Once this command is sent, the server will respond by returning html. This is essentially how an internet browser functions: a URL is entered, the browser receives html from a server, and then displays the html. In this case, however, the response is going to the ESP, which will display “+IPD” (which indicates the ESP has received data) to the serial monitor and then the HTTP code and some html. My information of networking and HTTP is very limited, so much more information can be found online. A resource I skimmed can be found here.

Process:

First, I created an Adafruit IO account and familiarized myself with the platform. Adafruit IO is a platform for the internet of things that makes it easy to record and view data. They have a lot of documentation, tutorials, and support, so it is a good choice. Note that their recommended route for using the ESP8266 involves the Huzzah breakout and uploads code directly to the ESP8266. This was not quite what we wanted to do, so I worked on interfacing with the ESP through the Arduino by sending AT commands.

Next, wire up the ESP and Arduino and get familiar with the ESP and its AT commands. All of this information can be found in this previous blog post. The code there is for a different purpose, so that can be ignored.

After that, upload this code and fill in your own WiFi and Adafruit credentials.

This should be enough to get a bare bones method of logging data up and running.

Extra Resources:

Additionally, here are a couple of posts and websites that helped me troubleshoot and understand what was going on:

  • Arduino forum on an ESP GET request issue
  • The Adafruit page that explains how to send and receive data using HTTP requests
  • A post with more detail on some AT commands
  • A video that goes over the process, which helped me break through my issues


Adafruit_data