Zander P.

Hi, my name is Zander and I am going to be a senior at the Urban School of San Francisco. My main project for my time at BlueStamp is a weather station base station that is based on this instructable. I chose this project because I am very interested in combining advanced hardware with custom software in new and interesting ways.

Engineer

Zander P.

Area of Interest

Undecided

School

The Urban School of San Francisco.

Grade

Incoming Senior.

Final Milestone

My third and final milestone was to program the base station to read temperatures from a sensor, keep accurate time and display the information on the LCD screen. This was extremely difficult to do as every piece required at least one library to work. In the end I have a total of 11 libraries in use for the code to function properly.

The code I wrote was based on the project on which I based mine. Unfortunately the code, at this point, was about a year old and the current parts were not available due to time constraints. While some parts are the same, such as the writing of the string which decides what to display for the humidity and temperature, the communication, for instance, is completely different and is based off virtual serial communication using an arduino Nano as a “middle man”, for lack of a better word. It communicates between the remote device using the NRF modules. For communication between the arduino Due and the intermediate, I used a virtual serial port combined with the the use of the Due’s extra TX and RX ports. Communicating without the hardware serial port became confusing and outputted incorrect values.

The code for the screen had to be rewritten from it’s original state because I was using a different screen and library, as I mentioned, to display the information. While it was close to the original code, i had to experiment significantly, often finding that I came up with a code that I didn’t actually need. Additionally, it took a lot of guessing and some basic math to display the UI in a useful and visually appealing way.

The RTC was pretty easy to use as the code and the library it used were still the same as the original project off of which I based mine. I did find it interesting, however, that the arduinos, at this point, do not just have integrated RTCs from which they can keep time with.

The final main piece of the code was the communication between the base station and the base receiver. This was used to take the code transmitted by the receiver and convert it into values that could be used by the weather algorithm for proper display of the data. This was my final challenge in this project because at the start of the project when making the wired connection between the base station and the receiver, I had no idea that virtual connections were possible, let alone necessary for the code to work properly. To get this part of the code to work, I used the virtual serial connection, made available through the SoftwareSerial library on the base station in order to transmit the information to serial port #1 on the arduino Due. On the Due there are a total of four TX and RX ports (four each) labeled 0-3, zero is the default and the one that is supposed to used for debugging, while the others are three hardware ports do not conflict with the main port. This gave me the choice to not use another virtual port, but rather a hardware one.

For sending the data between the receiver and the base station I needed to convert it into a string rather than the struct it was being sent as between the remote module and the receiver. Both the values were being sent at the same time as a string of ints (integers) that looked something like this: “<20114302>”. The  two “< >” are for determining the start and end of the data string to make sure none of the data is lost or omitted. The first part of the string, in this case “2011” means 20.11 degrees celsius. This was done because float values are not able to be transmitted through the serial properly. If they were they would just be output as “20” without the “.11” on the end. The “4302” is referring to the humidity, meaning the value is actually “43.02 %”. Once the string is sent, it is placed into an algorithm to make sure it is all there. The algorithm looks for the two “< >” for opening and closing. Once the entire value is there, they are removed then converted into an array so as to separate the first four numbers and the last four. At that point they are divided by 100 to place the decimal in the right place, then printed to the LCD for display.

I greatly enjoyed my time at BlueStamp, I was able to do the project I wanted and learn the things I wanted without the lecture component of school. I enjoyed trying new things such as using TFT LCD screens, while also returning to the basics of coding and the logic behind it. Throughout my time at BlueStamp I overcame many challenges pertaining to hardware, software, and a blend of the two. It is such a nice feeling to be working on solving one issue for multiple days and for all the different part to fall in to place like they were meant to. While my specific project, a weather station, does not have much use with modern technology, it did however provide me with a welcome challenge and the opportunity to further my knowledge of coding and hardware manipulation.

Second Milestone

My second milestone was much simpler to complete. It was the building and installation of the remote device that would send information from the device to the base station. For parts I used an arduino Nano, a sensor, and an NRF module for wireless communication. The coding for the remote device was pretty simple, using a total of only three libraries, one for the sensor, one for NRF device, and the final one was a core library used by the NRF module. The NRF library, called RF24, made the use of NRF modules much easier while the DHT library for the sensor allowed interface with the weather sensor.

First Milestone

My first milestone was the completion of the base station for my project. This is where the data is collected from the remote sensors and converted into a form that can be displayed on the LCD screen. The base station contains one sensor, a RTC (Real Time Clock), and an LCD screen on top of the arduino Due. The screen is powered off of the 5V output from the board while the sensor and RTC use 3.3V. My first major problem occurred when I tried to use the LCD screen. Since I had no experience using and LCD screen, I was not sure where to start. The first screen that I attempted to install was ultimately unusable because it was not directly compatible with an arduino. That led me to utilize an adafruit component that worked much better. While I had not started the coding for the arduino yet, I did use a library example for the LCD to see if it was working. At that point I was stopped by my second major problem, the arduino Due was not functioning properly. The arduino Due has two USB mini ports, one is the programing port and one is the native USB port. The arduino Due is supposed to be able to be programed by the programing port, but for me was quite hit or miss. The native port, on the other hand, was fully functional, but has the disadvantage of not working with serial monitor which is used for debugging. Once the port problem was solved, the screen worked perfectly without any further problems.

Starter Project

For my starter project I choose the electronic dice kit. To make this project I used an IC (integrated circuit) to read the data that was supplied by the Piezo sensor. The IC then outputs a command to turn on specific LEDs that are soldered onto the printed circuit board. The LEDs that are turned on are chosen somewhat at random, but remain in a set pattern that has the same appearance as a dice. The kit contains a total of six resistors and one diode. The diode is used to take the current from the battery and convert it into a useable current for the IC to use and force the current in one direction. From there the IC outputs current to the LEDs, but resistors are needed to lower the current further so the LEDs do not short circuit. The Piezo sensor is a sensor that measures mechanical force applied upon it. For instance an impact would trigger the sensor which would output a current that the IC would receive. Below the printed circuit board is the battery and battery housing that powers the IC and in effect the LEDs.

Leave a Comment

Start typing and press Enter to search

Bluestamp Engineering