Internet of Things Weather Indicator

This project uses a Particle Photon to draw weather data from the cloud. The data then triggers a NeoPixel LED ring that displays the weather forecast

Engineer

Rohit T

Area of Interest

Computer Science

Homestead High School

Grade

Rising Sophmore

Reflection: This project was fun and I learned so much. Despite the shortened time frame, I worked my hardest and did as much as I could  As a three week student, I was able to make progress on the cat toy, but not enough to sufficiently debug and modify the project. If I had more time, I would have chosen a project more sophisticated than a basic robotic arm. Perhaps a robot controlled by Alexa would have been more appropriate. However, given the time constraints, this project fulfilled some of my basic expectations.

As a second year student, I analyzed whether an automated cat toy can be sold at a competitive price. I found that by building the box out of wood, and by using a cheaper alternative to the Particle Photon (the ESP8266), I could build a single cat toy for about 11.75. This price would likely go down if a bulk order were made. Most automated cat toys currently on the market cost between 12 and 20 dollars. Thus, this toy could be sold competitively for a profit at around $15. Cat toys are a small market, only amounting to 250 million dollars each year. However, automated cat toys are rare and thus there is tremendous opportunity in the automated cat toy market.

Final Milestone:

 

My final milestone was the building of the ultrasonic arm and the configuration of the ultrasonic sensors with Alexa. I can issue Alexa a command to play with the cat which, through the diagram under milestone milestone one, which ultimately relays this command to the particle photon. The photon calls a function which moves the arm to play with the cat.

I modified a project box from Amazon, making it compatible with the ultrasonic sensors and the three micro servos. Thus, these components can be mounted outside the box while maintaining connections with the circuitry. Additionally, one of the servos sits in a hole I drilled into the box.

The robotic arm is on top of the project box. It contains a circular base plate and two rectangular components. It has three degrees of motion and the servos provide enough torque to move the entire arm. Additionally, the arm can be configured with the sensors to move the arm based on the location of the cat.

A CAD drawing of the robotic arm (which is slightly different than the project box itself) can be found here.

The schematic file for the circuitry can be downloaded by clicking here. Finally, you can find the relevant code in the GitHub link, located here.

The main difficulty I encountered was loose and/or improper connections. All connections must be correct for the sensors to work. Additionally, the photon is buggy and has difficulty connecting to Wifi. This makes it highly difficult  to upload code and debug at times. This has been very frustrating and I will, in the future, explore using Arduino with a bluetooth/wifi shield instead of the particle.

Once I am able to configure the sensors by fixing the connections, I can program the arm to move the arm away from the cat. This would be a tremendous modification to add to my project.

Second Milestone:

 

My second milestone is the completion of a number miscellaneous and important tasks that are vital to the creation of an automated cat toy. It is not one large accomplishment, but rather a group of small achievements which compound to form a milestone.

  • The first milestone only involved tasks that had one command, (set a pin value to HIGH, return a temperature, etc.). For  a robot to continuously play with a cat, I must have the Alexa Skill fire one trigger which then continues so that it can play with the cat. I was able to achieve this in this milestone using a coding trick.
    • The first time Alexa sends the command to play with a cat, a function is called which sets a boolean value to true. Then, in the loop, a separate function moving the servo is called only if this boolean is true. If I tell Alexa to stop playing with the cat, it sets the previously mentioned boolean to false. Thus, the function stops running.
  • Secondly, I calibrated the ultrasonic sensor. It has four pins, two of which are power and ground. It also has a trigger and echo pin. The trigger pin, which is an output pin, causes it to send out ultrasonic waves which hit an object and bounce back. The time this takes is recorded. The bounced sound waves send a signal, indicating the time required for the ultrasonic wave to make a round trip,  through the echo pin back to the particle.. This time is divided by a constant (from the ultrasonic sound library) to convert to a distance in centimeters. The process by which the ultrasonic sensor worksis demonstrated by the green LED, which only turns on when my hand is within 5 centimeters of it.
  • Essentially, this milestone consists of my making of a unique Alexa skill which has the ability to loop, and the calibration of an US sensor.
  • Some difficulties I encountered was coding in Javascript, which I had never encountered before. I enjoyed being successful with these simplified tasks as I now know I have the tools to build a working automated cat toy.

First Milestone Diagram (This is a diagram which describes the processes explained below)

I reached my first milestone by having Alexa effectively communicate with a temperature and humidity sensor (DHT11). I used this linkto guide my first steps in completing this project. There are four main components to the communication between the Alexa and the various circuit components used:

  1. Amazon Skills Kit – This is where the custom Alexa skill is defined. This definition includes various phrases which can activate certain commands. It also designates the identifiers for each unique command. In other words, it converts words (through voice recognition) into a string which are then analyzed and converted into specific variables. These variables are sent to AWS (Amazon Web Services) Lambda (refer below for AWS Lambda) where the variables are sorted and data is sent to the Particle Cloud API. The Skill also has a unique Application ID which allows AWS to directly reference it.
  2. AWS Lambda– A server provided by Amazon Web Services which integrates various custom Alexa skill sets with one another. The server is programmed to understand various outputs from the Alexa custom skill. It receives this information from the skill and sends it to the Particle Cloud API, and eventually to the Photon itself. (see below)
  3. Particle Cloud API– The Particle Photon – which has a microprocessor and pins, similar to an Arduino – is connected via the internet to the cloud API. The photon provides the API with its unique device ID as well as an access key. The API, in turn, is able to connect to AWS lambda via the internet. It receives commands from the AWS Lambda which correspond to verbal commands from the skill set.  These commands will be interpreted digitally by the photon, and then implemented into the analog circuitry. For example, a command to turn the green light on will be converted into a function which sets a pin to High, giving it a voltage and turning on the LED. Essentially, the Particle Cloud API is the means through which the AWS Lambda sends data to the Particle Photon.
  4. Particle Photon –  A physical device which has pins, a microprocessor, and a microUSB slot through which code is uploaded. It converts the commands from the API into digital outputs from its pins. It also receives data from various circuit components, such as the temperature/humidity sensor (DHT11). It can take data from the sensor and send it to the API and all the way to the Amazon Skills Kit, where Alexa can return the temperature.

My first milestone was successfully linking each of these components. The LEDs can now be activated via a voice command and temperature values can be sent to Alexa from the circuit board.

My starter project is the Big Time Watch Kit. It is powered by a coin cell battery which is housed inside a soldered on coin cell battery holder. It has a crystal oscillator which allows the watch to tell the time. It is filled with quartz and vibrates the quartz inside of it. The frequency of the vibrations are measured and can be used to tell time by adding them up. There are also two capacitors and one resistor which are used to reduce the net voltage of the system. The capacitors store electrical energy while the resistor disperses it into the air. There is a 4-digit display which shows the time. There is a button which is used to turn on the watch and to change the time if you hold it for a few seconds. The “shell” is made of several different plastic plates that are overlapped on the MintyBoost. They are screwed together and a watch strap runs through the bottom layer.

Leave a Comment

Start typing and press Enter to search