Moisture Reader Update 3

Author: Brett Stoddard

Hi everyone, it’s been a while since the last update with the moisture sensor and a lot of progress has been made in that time. Progress has been made with confirming moisture readings and on the code side of things.

After a few more rounds of testing I have confirmed that the tags, for sure, can be used to measure a range of moisture levels. The test involved dropping different volumes of water onto the edge of a tag’s tail. The tail would soak some of that water up and onto the moisture sensitive part of the tag. The tails were about an inch long and increments of 25mL of water was dripped onto them using a precision eyedropper. The data (TABLE 1) showed a definite positive correlation which is good news. I also did a few trials on really wet and really dry soil and the tags were able to tell the difference between a desert and a swamp, although a more accurate of testing tags in soil was needed–which is where the next development comes into play.

 

 


TABLE 1. Table of tag measurements given a certian amount of water on the edge of the tail of a tag and a certian amount of time for the water to work its way up the tag.

 

Since the last post, I have gotten the RFID reader shield and the GPS logger shield to work together. I have added a polished example code bit onto the GitHub library. Available here, it records the average value of the RFID tag after 100 measurements then records measurement from a YL-69+YL-38 moisture sensor. The plan with this reader is to eventually use it to calibrate the values that we’re currently receiving off of the RFID tags (0 for wet, 20 for dry). This will involve setting the YL probe and RFID tag onto the same soil sample and letting it sit there for a few days and take measurements periodically as the soil drys. After we get this data we will be able to tell how well the RFID tags will work for measuring soil moisture.

I have also gone through and updated a little bit of the other example codes to make them work better.

Cheers, Brett Stoddard

We’re Getting Closer! Adding More Functionality to the Final Produce

Author: Marissa Kwon

Abstract:

We’re releasing details about our project after ten weeks of development including support for portable limply batteries, project code/resources, and why some additional functionality is necessary before deployment.


IMG_1984.JPGIMG_1984.JPG

Why It’s Best to Wait:

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.

What’s Next:

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

New Design: Water Sampler 4040

Abstract

I finished the new design of the 24-bottle water sampler which will be fabricated within the next week before the electronics PCB gets here. The new design is made entirely out of 4040 (a 40 mm x 40 mm profile) extruded aluminum, common store-bought joints, and 3D printed components.


water sampler 40404 renderwater sampler 40404 render

Objective

This redesign solves several issues with the original foam enclosure:

1. The 4040 frame does not require a laser cutter to manufacture

2. The frame is rigid

3. Mounting objects rigidly to the frame is very easy

Materials and Methods

This design uses 2 primary materials at the moment: 4040 extruded aluminum, and 3D printed ABS plastic. All of the printed parts could be replaced with machined mounts and brackets in the absence of a 3D printer. 4040 was chosen for the frame material because of its ease of use and because we have tons of it here at the lab, but future designs will most likely use slimmer extrusions like 2020 to save cost and weight.

Explanation of the Design

Four long extrusions make up the outer corners of the frame. They are 600mm long, roughly corresponding to the 24 inch length of the original design. The short outer-frame pieces are all 210 mm long to provide enough space for the bags to hang. A 600mm length piece of 4040 runs across the top and provides channels to mount the valves, pumps, and electronics. Two 520mm lengths of 4040 across the sides, offset from the top by a few centimeters, provide the channels for the bag caps which the sample bags hang from.

The orange brackets are 3D printed and connect the central channel perpendicularly to to the frame. Other brackets are store-bought and aren’t included in the design. All mounting is done using t-nuts and/or t-bolts that slide in to the 4040 channel to limit the amount of machining required to assemble the sampler. A thin sheet of PETG plastic will cover the top of the assembly and protect the device from rain but could easily be replaced with a large trash bag or tarp.

Electronics Enclosure for Evaporimeter

Having the electronics secured and accessible on the evaporimeter is essential. The solution that we came up with is having a transparent jar that would screw on the evaporimeter’s pole attachment. Here is the updated design:

When turned to the underside, one can see the extruded base to accommodate the threads and the breadboard and battery compartments. The breadboard slot might be edited to have a slide in feature instead of having a little slot to hold it in. The battery slot is just fine. Here are some pictures of the assembled pole attachement with the jar:


Assembled EvaporimeterAssembled Evaporimeter

Assembled Evaporimeter


Pole attachment without the jar.Pole attachment without the jar.

Pole attachment without the jar.

The inside is not a smooth print because it prints on the support material, but we are more concerned about function of the inside piece and not the aesthetics. 


Jar and pole attachment Jar and pole attachment 

Jar and pole attachment 

A humidity/temperature sensor and a uSD card adapter are being added to the electronics. I prototyped these new electronics and wrote code for them. An intern here at the lab is integrating the code and new electronics into the current design. 

New Water Sampler Electronics Board

After lots of struggling with the current perf board electronics, we decided getting a PCB made was the way to go. The electronics have changed quite a bit since the last version so I started this one from scratch.

 

Changes include many more connections to the arduino, headers to connect the H-bridge and RTC breakouts, and removing the MOSFETs. The PCB includes a proper ground plane, our logo, and holes for mounting!

 

The primary benefit of moving to a PCB is the ability to use a rectangular connector on the board and insulation-displacement-connector for the ribbon cable, which means that we will be able to snap the 50-wire cable on and off the board. The quantity of connections made for a messy perf board and caused a lot of headaches while troubleshooting malfunctions. Despite the current setup working, it wouldn’t be reliable in the field.


WaterSamplerBoard_v1WaterSamplerBoard_v1

There are a few changes I need to make to the design, such as optimizing the sizes of the VCC traces, but it should be sent out to be manufactured soon!

Designing Base for Camera System

Most of the design for the rotating system is complete, but there are still some minor things to straighten out. One of the next things to design is the actual attachment to the pole that will be holding the whole system. This attachment has to be really strong because it will be holding the whole weight of the camera and rotating system. Here is the initial design of the base:

My initial idea is to have the attachment slide over the top of the pole and use some bolts as set screws to make sure that it will not move or fall off. The attachment has to also be connect to the motor housing. As of right now, I have four bolts coming from the motor housing into the base attach. I am trying to think about a way to get the nuts into the piece itselft, this way they are secure and will not fall out. I might just end up making a bigger holes on the bottom and use a socket to tighten them. Here is the the pole that we are using for this project.


Hyperspectral Camera TripodHyperspectral Camera Tripod

Hyperspectral Camera Tripod

This week I will finish the design and print it. I will then proceed to mount the rotating system on it, and start testing the whole thing. 

A First Look at Field Deployment

Author: Marissa Kwon

Abstract:

As progress on the LoRa radios leads to integration into the Evaporometer Project, we take a closer look at some of the aspects of data transmission and providing portable power.

Sending and 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 trinketLi-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;&nbsp;fitted with LiPo battery and uFL antenna (with pen to scale size)transmitter ready for housing;&nbsp;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

Drone build completed

Author: Jonah Siekmann

It’s been a while since we updated this blog on the drone build progress, but today the last part came in and the drone is officially flying! We still have to mount the RFID/GPS stack, so it’s not autonomous, but it’s flying very smoothly.

For the drone, we used:

CC3D Flight Controller

750kv 28-30 motors

30A SimonK ESCs

11″ propellors

5000mAh 4s 25c battery

Flysky T6 transmitter/receiver

S500 frame

Here is a short video showing part of its maiden flight:

Also, you may recall in the last drone update, we documented an issue where the Arduino Uno microcontroller would shut off mid-flight – this was because of a faulty UBEC that wasn’t supplying a steady 5v, forcing the Arduino’s internal regulator to work overtime and thus overheating. Replacing the UBEC solved the issue. 

Now, we just have to program the autonomous navigation portion of the drone and mount the Arduino/RFID/GPS stack. 

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 projectThe 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 TrinketPin 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