Adding Finishing Touches to the Final Product

After 10 weeks, here is our finished product:

IMG_1984.JPG

After much discussion about integrating more functionality into our the Lora/Super Validator, we have decided to postpone field tests for now in favor of adding a few more weather and climate sensors to the Super Validator, measuring power consumption, and saving power by adding in an external clock to enable the micro controller to go into sleep mode until the clock's alarm periodically wakes it.

I have a working temperature and humidity sensor set up to write out data measured to an SD card, and our next goal is to be able to set up the LoRa radiopacket array to also send these values to from a remote location.  Granted that these field devices also won't have unlimited or even large supplies of power readily available, I don't want our Lora to be wasting power by constantly sending information and waiting for a reply.  Since climate and weather change gradually the user would only need readings about once or twice an hour.  The micro controller is capable of saving power by entering a sleep mode, however it also need and external device to interrupt its sleep so that it can do its job.  That's when a real time clock will come in handy by sending an alarm to the Protrinket at a certain time every hour to wake it up; after all transmission code is done, the Protrinket can go back to sleep.

Currently our device is powered by a 3.7V, 1000mAh Lithium Polymer battery. Once all the components are working together, I will need to measure the current draw of each component to estimate the final battery life.

LINKS TO RESOURCES:

Here are links to our most recent LoRa Super Validator transmitter and receiver code.

Also here are links the Adafruit site for the new components: SD card reader, Real time clock, and temp/humidity sensor.

And finally here's more information about the LiPo battery.

MSDS sheet for the LiPo battery

- Marissa Kwon URSA Undergraduate Student Researcher

Sending float data and attaching Li-poly Battery Backpack to the LoRa radio modules

SENDING/PRINTING FLOAT DATA

The LoRa radios use packetized sending of 8 bit integers (corresponding to ACSII values) to relay integer and float data by first taking the integer value, changing each decimal value into the corresponding character (ASCII) value using iota(), and adding this info to the radio packet to be sent.  On the receiving end, the data from the packet array is copied into a separate array, for our purposes its an array of 7 elements/bytes, and uses iota() to change it back into the correct integer value.  

For float values to be sent, you need select a decimal value the suits your precision needs.  For the Evaporometer we only decimal values to the ten thousandths place, and since our load cell will be taking measurements < 1000 grams I will need a maximum of 7 digits to store my data. The only difference I needed to make to send floats was to multiply the load cell's measurement by 10,000 before setting it to the packet, and dividing by 10,000 in the receiver end.  In order to print a float value, I also needed to include the precision value when using Serial.print() like so:

Serial.println(my_array,4);

ATTACHING THE BATTERY BACKPACK

For our field test, it will necessary to rewire the LoRa chip, load cell, and pro trinket onto a smaller breadboard that can fit onto the housing designed for the Evaporometer.  The Pro trinket is now powered off a portable LiPo battery.  The micro-usb connector on the Pro trinket powers the device as well, and plugging the device into a wall outlet through the usb also recharges the LiPo battery.  To improve signal strength the soldered in wire antenna was replaced with uff connector so that a larger antenna could be attached to the LoRa chip. The change in RSSI signal strength measured in the serial monitor reflected the changes I made to the antenna as well as the changes to the operating frequency (after we ramped up our new frequency to 915mHz).

Li-Po battery backpack connected to the ground, 5V, and bus pins on the Pro trinket

Li-Po battery backpack connected to the ground, 5V, and bus pins on the Pro trinket

transmitter ready for housing; fitted with LiPo battery and uFL antenna (with pen to scale size)

transmitter ready for housing; fitted with LiPo battery and uFL antenna (with pen to scale size)

- Marissa Kwon  URSA Program Undergraduate Student Researcher

Moving on to Smaller and Better Things

Moving on to Smaller and Better Things

Converting from the Arduino Uno to the Adafruit Pro Trinket

As this project continues to develope, it is time to begin looking to add a more practical means of implementing these systems into the environment in a small and user-friendly package. The problem? The Arduino Uno is an excellent prototyping microcontroller, its easy to work with, has several built in functions with many pins ready to be used, however, this ease of use and functionality comes at the cost of a bulky, power hungry microcontroller that likely can do much more then you need it to. The solution? The Adafruit (3 Volt) Pro Trinket.

The Adafruit Pro trinket is a tiny microcontroller that packs a punch! 

The New Adafruit Pro Trinket (3V) Micro controller being used for this project

The New Adafruit Pro Trinket (3V) Micro controller being used for this project

Remapping Pin-outs

One of the biggest challenges with swapping the Pro Trinket for the Uno  is the difference in board configurations and pin allocations. The blog post "Getting Started with the nRF08001 Bluetooth LE chip" lays out how the pins and wiring of the nRF08001 is set up for the Arduino uno. In this post we will be exploring how to do it for the Pro Trinket. Below is a diagram of the Pro Trinkets Pin outs as well as breakdown of the pin allocation.

Pin Schematic of the Adafruit Pro Trinket

Pin Schematic of the Adafruit Pro Trinket

  • RX - also known as Digital #0, this is the hardware serial input pin. This is used when programming with an FTDI cable but is available when using the native USB to program
  • TX - also known as Digital #1, this is the hardware serial output pin. This is used when programming with an FTDI cable but is available when using the native USB to program
  • Digital 3 - Also known as external interrupt #1. This pin can also be used as a PWM output pin using analogWrite() (This is the most significant difference between the Uno and the Pro-Trinket and requires manual changes to sketches in order to work)
  • Digital 4 - Nothing particularly special about this GPIO pin
  • Digital 5 - this pin can also be used as a PWM output pin using analogWrite()
  • Digital 6 - this pin can also be used as a PWM output pin using analogWrite()
  • Digital 8 - Nothing particularly special about this GPIO pin
  • Digital 9 - this pin can also be used as a PWM output pin using analogWrite() It's also good for driving servos because its a high-speed PWM output
  • Digital 10 - this pin can also be used as a PWM output pin using analogWrite() It's also good for driving servos because its a high-speed PWM output
  • Digital 11 - Also known as the SPI MOSI pin. this pin can also be used as a PWM output pin using analogWrite()
  • Digital 12 - Also known as the SPI MISO pin
  • Digital 13 - Also known as the SPI CLOCK pin. This is also connected to the red #13 LED!
  • Analog 0 - also known as Digital 14, this pin can be a digital I/O pin or an analog input pin
  • Analog 1 - also known as Digital 15, this pin can be a digital I/O pin or an analog input pin
  • Analog 2 - also known as Digital 16, this pin can be a digital I/O pin or an analog input pin
  • Analog 3 - also known as Digital 17, this pin can be a digital I/O pin or an analog input pin
  • Analog 4 - also known as Digital 18, this pin can be a digital I/O pin or an analog input pin. It's also the I2C SDA pin
  • Analog 5 - also known as Digital 19, this pin can be a digital I/O pin or an analog input pin. It's also the I2C SCL pin

Conclusions about the switch

The only changes you may have to consider when adapting Arduino sketches are:

  • Pins #2 and #7 are not available *
  • The onboard 3.3V or 5V regulator can provide 150mA output, not 800mA out, this is due to power saving functionality designed into the Pro Trinket, which is ideal for this project
  • You cannot plug shields directly into the Pro Trinket
  • There is no Serial-to-USB chip onboard. This is to keep the Pro Trinket small and inexpensive, you can use any FTDI cable to connect to the FTDI port for a Serial connection
  • The 3V Pro Trinket runs at 12MHz not 16MHz so its a bit slower, but with the advantage of significantly less power draw, extending battery life significantly
  • The bootloader on the Pro Trinket use 4KB of FLASH so the maximum sketch size is 28,672 bytes, more than enough space for almost all applications. The bootloader does not affect RAM usage.
  • And most importantly that all sketches that use pin 2 as the interrupt must be switched to pin 3. 

Writing a script to bring it all together

This week I have also begin sketching the new data transmission protocol that will be used across the Internet of Ag project. After getting communication between the Pro Trinket and BLE module set up and the demo functioning it was time to start a new script from the ground up. This week I was able to begin drafting out the basic logic, and looking over example codes of the protocol and will contiune working on a sketch next week. 

- Tom DeBell, Beginning Researcher Support Program researcher

Updates to the LoRa devices

In the past few weeks, I've been working with another student name Manuel to apply the LoRa devices to a rain catchment device designed to measure evaporation.  Below is a picture of the strain gauge rain catchment system he built for the project.  The LoRa device can be placed on the platform where a load cell can be hooked up to our LoRa system to measure and transmit data to our LoRa receiver and to an offsite server.  

Since the LoRa device will need to transfer data as precisely as our load cell can measure, the code will need to be adjusted to accommodate integer and float values with adjustable decimal precision.  I have made the proper updates to the code and will post more details on that in the future.

We are moving quickly towards field testing these LoRa devices with the Evaporometer but there are a few changes that still need to be made.  The LoRa transmitters, which will be out in the field, will need a weatherproof housing and a portable power source.  Also our current transmission frequency is not suitable for a lot of ongoing communication, so our LoRa breakouts will also need to be replaced new ones that can transmit at a higher 915 mHz frequency.   

- Marissa Kwon Undergraduate Student Researcher

Coding with the nRF08001 Chip and Other Evils

Coding with the nRF08001 Chip and Other Evils

Testing Aftermath

After concluding testing on basic functionality earlier this week with positive results , it was time to dig into the real work... developing a protocol that would allow this Bluetooth LE breakout board to be used to transmit sensor data in a convenient and uniform way across the "Internet Of Agriculture" project . In addition, a second nRF08001 module was set up, and experimenting with two modules began.

Phase one - understanding the "out of the box" software

Before trying to construct an entire comprehensive script from scratch,  I thought it would be worth my time to familiarize myself with what others have done in some of the demo codes I explored here on Github.  

The code currently running on the two Arduinos (found here) has be modified slightly by myself but in general the  framework is done using universal asynchronous receiver/transmitter (UART)  protocol , where the data format and transmission speeds are configurable. The electric signaling levels and methods (such as differential signaling, etc.) are handled by a driver circuit external to the UART, in our case an Ardiuno uno, and eventually something as small as an Adafruit Pro Trinket . In other words, the UART takes one channel to transmit data and one to receive it.  

UART Sketch in detail (Part 1)

Initialization

Like most Arduino sketches the first step is to initialize the device in question (in our case the Arduino or Pro Trinket), and prepare the hardware for the data its about to send and receive. You'll need to include the header files and define the pins used. Since we're using hardware SPI, the CLK/MOSI and MISO pins are fixed (see wiring scheme in "Getting Started with the nFR08001" blog). 

the RDY pin is the only pin that must be an interrupt pin. We'll use 2, most Arduino's can use 2 or 3.

Then create the Adafruit_BLE_UART object at the top as shown below. 

 

These few lines of code are enough to get the Arduino oriented to the hardware and are the first steps to begin further use of the BLE module.

Unfortunately due to time constraints and hardware not cooperating, this is as far as we got this week. However, further exploration will continue.    

- Tom DeBell, Beginning Researcher Support Program researcher

ESP 8266 and IFTTT

Background:

I have been working on connecting to IFTTT using the ESP. IFTTT is a platform that makes it easy to connect different web apps and services to create applets or recipes. They work in an If this, then that (that is where the letters IFTTT come from) format. For example, if I like a video on YouTube, save its name and link to a list on Evernote. 

IFTTT has a service called Maker that allows a user to send a web request to their Maker service which can then trigger an action. I used this feature to create an applet, which, when triggered by the ESP will send data to a Google Drive spreadsheet. 

 

Process:

This will be wired the same way as all my previous Arduino and ESP guides. Most of the code is fairly similar and it is explained there as well. The wiring is here and the general info about sending GET requests is here

The first step is to create an IFTTT account and then create an applet (this link answers many of the questions about applets) using Maker.

After creating an applet, go into settings on the Maker page.

settings

Then, copy your personal URL and go to that page. 

 

On this page, you can see the information for sending HTTP requests and the full link that can be used in a GET request. The code will show how to add data values which can be sent over as query parameters in the request. 

Once this is all set up, you have the necessary information to send data to the web using IFTTT and your ESP. 

Next, download the code, add your credentials, and then upload it to the Arduino. 

 

This guide may be helpful, it is how I got my start. However, like many of the guides, this uses the ESPWifi library which I did not use. 

More Testing with the nRF08001 Bluetooth LE

More Testing with the nRF08001 Bluetooth LE

Note: The nRF8001 sends out packets of data, 20 bytes at time. Keep this in mind if you want to send a lot of data it will be packetized into chunks of 20. You can of course send less than 20 bytes.

Exploring Mobile Interface

After initial setup and software tests, I was able to explore the Adafruit developer smart phone application found in the android market, "BlueFruit LE". (APK file linked here

Much like Serial you can use the .write and .print functions allow us to send data out to the connected device:

Features included in Bluefruit LE App

 

Home screen of the "Bluefruit LE" smartphone application

Home screen of the "Bluefruit LE" smartphone application

Display after connection with Bluetooth module

Display after connection with Bluetooth module

Info

Displays MAC address and other relevant Device Information

Screenshot_20170412-101741.png

 

UART

Screenshot showing a message being transmitted to the Arduino from my smartphone 

Screenshot showing a message being transmitted to the Arduino from my smartphone 

The "UART" function allows a basic text message interface from smartphone to the Arduino Series monitor. However, after testing it was apparent that although the application allows infinite characters of transmission, the messages are broken apart into 20 character fragments due to the data transmitting capabilities of the bluetooth chip.

Snip showing successful reception of the message from my smartphone to the Arduino seriel monitor

Snip showing successful reception of the message from my smartphone to the Arduino seriel monitor

 

 

Pin I/O

The Pin I/O section of the mobile phone application allows the user to control input and output of pins (both analog and digital) on Arduino shield. However, this particular function required significant code modification in order to allow functionality on Android enabled devices. Once the code is finalized it will be published and linked here. In order to display this faciniating functionality a small demo was contructed in order to deminstate the smart phone interfaces capabilities. 

With just a slide of my finger I am able to modify the signal strength being admitted from the Arduino 

With just a slide of my finger I am able to modify the signal strength being admitted from the Arduino 

The Blue LED is only lightly illuminated due to low PWM signal as specified by the photo on the left 

The Blue LED is only lightly illuminated due to low PWM signal as specified by the photo on the left 

The PWM slider was moved all the way to right to allow for maximum signal strength

The PWM slider was moved all the way to right to allow for maximum signal strength

The increased signal strength as shown on the left caused the LED to shine brightly

The increased signal strength as shown on the left caused the LED to shine brightly

This section of the Bluefruit LE application appears to be very useful, unstable and will require further explanation.

Controller

Streams sensor data from smart phone sensors (Quaternion (6-axis accelerometer), Accelerometer, Gyro, Magnetometer, Location)

Beacon

Puts smartphone in a state to receive pop-up text messages from serial monitor up to 20 characters  

Snip from the Arduino Serial Monitor during transmission testing

Snip from the Arduino Serial Monitor during transmission testing

Screenshot of the recived message from the Ardiuno 

Screenshot of the recived message from the Ardiuno 

          Messages are restricted to only 20 characters 

          Messages are restricted to only 20 characters 

Neopixel

Needs further exploration.

 

Conclusions

**Initial testing of connectivity shows an approximate range of 20 feet for reliable signal strength.**

After initial testing it would appear that  the Pin I/O will have the most practical capabilities and research of its functionality will continue. 


 

- Tom DeBell, Beginning Researcher Support Program researcher

Getting Started with the nRF08001 Bluetooth LE chip

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 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 testing

Snip from the Arduino Serial Monitor during testing

- Tom DeBell, Beginning Researcher Support Program researcher

Testing the range of LoRa radio breakouts

LoRa_range

 

Today I took a walk to see how far I could go before the LoRa radios lost connection.  The documented range on Adafruit's website is 2km line of sight in an open area.  I tested the LoRa's on the far west side of campus. About 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.

 

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.  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:  

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

Progress with LoRa Transmitter/Receiver

Update: Transmitter (left) and Receiver (right) on separate breadboards connected to portable 5V power sources

Update: Transmitter (left) and Receiver (right) on separate breadboards connected to portable 5V power sources

These are the components connected to now separate transmitter/receiver (pictured above): 

Transmitter:

- Matbotix 1220 sonar sensor

- RFM9X LoRa Radio

- Adafruit Pro Trinket (3V Logic) w/ FTDI cable connector

- Red LED

- 51 ohm resistor

Receiver:

- RFM9X LoRa Radio

- Arduino UNO (5V out) w/ macro USB cable connector

- 81 ohm resistor

- Red LED 

- White LED

The transmitter and receiver have been placed on separate breadboards in order to test the range on the LoRa chips.  Code on both the transmitter and receiver sketches has been rewritten to send and receive the data values measured by the MB1220.  Other changes include the replacement of the Arduino Uno development board with the smaller 3V Adafruit Protrinket.  If you haven't already, you will need to set up your Arduino IDE so that it recognizes Adafruit's development boards when plugged into the USB port using an FTDI cable.  

SETTING UP THE ARDUINO IDE: You will need to go into Arduino's Preferences, paste the Adafruit Board Support Package URL into the space next to "Additional Board Manager URLS", click OK, then go into the Tools tab and select the "Boards Manager" found in "Boards:".  Filter your search by choosing "Contributed" from the dropdown menu and typing "Adafruit AVR" in the search bar.  Then install the package "Adafruit AVR Boards".  Once installed, you can upload your Arduino sketches to the Pro Trinket by selecting "Pro Trinket3V/12MHz (FTDI)" from the Boards dropdown menu.

The Pro Trinket uses the Atmega328P chip - the same core chip as our Arduino UNO - making it easy to switch between the two.  When transitioning to the Pro Trinket I realized it lacked pins #2 and #7 as well as the level shifting featured on the UNO (5V input on the Pro Trinket will have to be reduced to 3.3V to prevent damage to the board). To accommodate the Pro Trinket, I replaced interrupt Pin#2 for Pin#3 and digital write Pin#7 for Pin#6 and applied these changes to the UNO so the transmitter and receiver code can be used for either board.   Here are the updated versions of the transmitter and receiver code.

I have provided links to more information about the Pro Trinket's limitations compared to the UNO and step by step instructions for installing the Adafruit AVR package.

- Marissa Kwon Undergraduate Student Researcher

Logging data on Adafruit IO

Today I finally succeeded in getting “data” (arbitrary numbers that I either hardcoded or looped through) from the Arduino through the ESP and to Adafruit IO.

I troubleshooted my bad requests by sending in AT commands manually through the Arduino serial monitor. After digging around on the internet, I found that the Arduino serial monitor does not recognize the \r and \n (carriage return and newline) escape sequences, so I sent each line of the GET request in line-by-line, and it worked.

This was manifesting itself in my code too because my character counts were off (the ESP AT command requires the length of the argument you are going to send it and will not work properly if it is off). After troubleshooting, I found the “correct” character count for my requests and I was able to receive a proper response from an Adafruit test page.

After this, I looked into sending a GET request to the IO platform with data. I was able to get this working as well and published some test data to an Adafruit “feed.”

I plan on cleaning up the code by writing some functions to make it more readable and easier to use as well as updating my comments now that I have a better understanding of the process. Once I do this, I will publish the code along with some of the resources that helped me along the way.

Here is a screenshot of some of the data on the Adafruit IO website. 


 

Working with Adafruit RFM9x (LoRa) Radio Transceiver Modules

LoRa is a Low Power Wide Area Network (LPWAN) hardware set for creating long range (2km to 10s of kilometers) star or star-of-star networks. OPEnS Lab is evaluating LoRa for on of it's 4 Internet of Ag communication options (others being close-range RF (100m), WiFi, and GSM).

In this experiment, one of our URSA Engage research students (Marissa K) got the LoRa radios up and running using this Adafruit tutorial. Below, she will detail what she had to do and modify to get this working with the RFM96W 433MHz breakout board - along with accompanying example code. These cost only $20.

Arduino Uno connected to Adafruit's LoRa RFM9x Radio Transceiver Module

Arduino Uno connected to Adafruit's LoRa RFM9x Radio Transceiver Module

Wiring:

Here's the setup pictured above:

LORA                  Arduino Uno

Vin ----------------- 5V

GND --------------- GND

GO (IRQ) --------- 2

SCK ---------------- D13

MISO -------------- D12

MOSI -------------- D11

CS ------------------ D10

RST ---------------- D9

GND --------------- GND

Antenna connection - soldered a 6.5 inch wire (green) that corresponds to a frequency of 433 MHz

Note: The Arduino Uno is capable of supplying either 5V or 3.3V.   For this project I went with the 5V supply since additional components used for collecting data from the surrounding environment will require a higher voltage and the LoRa pins use level shifting circuitry to safely power the chip with 3.3V-6V of direct current.  With level shifting circuitry the MOSI on the LoRa radio operates on a 3.3V logic level while sensors connected to the power rails on the breadboard are powered with 5V.

LoRa Radio breakouts communicating; LED attached to designated "Receiver" LoRa Module

LoRa Radio breakouts communicating; LED attached to designated "Receiver" LoRa Module

Code:

The source code used to program the LoRa radio's to receive and transmit data came from the Adafruit website and AirSpayce's Radiohead Library.  In the Arduino IDE, the radio frequency was changed from 915.0 to 433.0 MHz.  Here are the links for the code I used to program the transmitter and there receiver.

Serial Output:

Once the transmitter Arduino was programmed and powered, it initialized and began sending signals awaiting a response from another radio unit on the same frequency.  If no response was found, then the following output would appear on the serial monitor:

Transmitter radio without a recepient

Transmitter radio without a recepient

Once the receiver Arduino was programmed and powered the two began sending and receiving packets of information - in this case a simple message, RSSI signal strength, and a count incrementing after each successful exchange:

Communication between transmitter and receiver LoRa Radios; output printed to the serial monitor in Arduino IDE.

Communication between transmitter and receiver LoRa Radios; output printed to the serial monitor in Arduino IDE.

Now that the two LoRa radios can communicate we should be able to transmit raw data from one radio to another.  The next step is to attach a sensor to the transmitter Arduino that collects such data in real time.  Over the next few days I will be using Maxbotix's XL-MaxSonar-EZ sensor to collect data and transmit that data to the receiver.  The MB1220 sensor that I will be using detects objects within 15ft from the front of the sensor and outputs the distance away in inches when connected to the analog pin A0 on the Arduino and the breadboard's ground and power rail supplying 5V.

Here is the data sheet for the MB1220 as well as the code used to test MB1220.

Maxbotix's XL-MaxSonar-EZ sensor MB1220 with wires connected to Ground, Vcc, and Pin3 (Analog output).

Maxbotix's XL-MaxSonar-EZ sensor MB1220 with wires connected to Ground, Vcc, and Pin3 (Analog output).

- Marissa Kwon Undergraduate Student Researcher

 

 

WSAN Pro Trinket 3V Shield Schematics

First versions of Pro Trinket 3V Shield Schematics Are Here!

One shield is for the receiver hub (aka Gateway) and won't change too much except for exploring different terminal protocols for the Gateway (e.g. Direct to computer serial like thi one, vs WiFi, LoRa, and Bluetooth). Basically, only the header for the nRF24L01+ was needed.

The other shield is a general-purpose i2c (designed with the MPU6050 3-axis accel + 3-axis gyro in mind, but can take any i2C device) with 3 general purpose Analog inputs. A custom circuit on the Analog input lines enables a choice of either using a 2-wire voltage divider (variable resistor) sensor, or a 3-pin powered sensor (takes 3V, GND, and outputs analog signal). This is meant to serve a wide multitude of general sensing purposes, where one may also choose to not populate the analog or i2c headers if not being used. Also comes with a LiPo JST battery connector, power switch. Header for nRF24L01+ also required.

 

OPEnS Wireless Sensor/Actuator Net (WSAN)

Introducing a new, modular, open-source, open-hardware wireless sensor-actuator network toolkit for environmental and agricultural projects. The main idea is: may people in environmental and agricultural fields have need for (or could greatly benefit from) deploying sensor-actuator systems in their practice. However, the exact system of sensors for each individual is idiosyncratic to their unique environment, constraints, and line of inquiry, requiring customs systems be designed from scratch for each new project. This results in a barrier to entry for those who don't have the background or time to learn and develop their own sensor-actuator systems. OPEnS WSAN proposes a plug and play, modular, reconfigurable architecture that would enable those with little-to-no expertise in engineering to quickly map out and assemble a unique system to fit their needs in relatively little time.

Transmitter prototype with Adafruit Pro Trinket 3V, nRF24L01+, with Sonar and FSR sensors.

Transmitter prototype with Adafruit Pro Trinket 3V, nRF24L01+, with Sonar and FSR sensors.

Hub

A single hub will collect all transmitted data from nodes and translate data streams into WiFi for uploading onto a cloud storage service.

Sensor Nodes

Will be comprised of parents and children. There can be up to 6 unique parents directly connected to the hub. Children placed further away can communicate to the hub by passing messages along to their parent.

Actuator nodes

These nodes will receive commands from the hub to drive relays, motors, servos, valves, and other commonly used actuators. Messages may be sent in real time by the user sending commands to the hub, or automated through a cloud service like IFTTT (If This Then That). In this manner, hub may be programmed to alter the behavior of sensors or trigger events of actuators based on the behavior or events from other nodes.

Repeater Nodes

These simply extend the range of communication of nodes to the hub by relaying messages to their target destination.

Library

I'm using the RF24Network library by maniacbug, which can be accessed on GitHub, or through the Arduino IDE Library manager. I'm also using the i2cdev library by jrowberg to manage communication with the MPU6050 IMU sensor (see below).

Progress to Date

I've begun preliminary work on evaluating the Nordic nRF24L01+ wireless transceiver radios with the Arduino Uno and Adafruit Pro Trinket 3V. These ultra-low power radios give significant range and adjustable data rate down to 250kbps. The datasheet is here. 2 sensor transmitters and one hub now work, will add more when more nRF radios arrive in the mail.

Sensors supported so far

Actuators

  • None yet