JellySafe
Last semester, Isabelle, Jimena, and I embarked on a pretty ambitious engineering project. Our objective was to create “a smart device for improving the quality of life for the user.” With very minimal requirements, we were at liberty to make whatever design, cost, material, electrical, and software decisions we deemed fit.
We wanted to make something that had never been made before at USC, so we came up with the idea to design a device that would let us monitor an aquarium — specifically, a jellyfish aquarium. Now, why jellyfish? That’s a good question. I think Isa and I wanted to push the bounds of what would be permissible by the school, but… think about it: the objective is to make the user’s life simpler. By making a tank that automatically changes its water and monitors its own salinity and bacteria levels, we’re making it a lot more approachable for first-time tank owners to have their own jellies.
Since the device would go into our jellyfish tank, we spent a good amount of time researching different jellyfish tanks. However, this quickly posed some problems. First of all, a lot of the cool tanks you can find on Instagram or YouTube are circular or cylindrical. That’s because jellyfish are very fragile and can get caught on corners easily and tear. But this makes it more challenging to fit our probes and device inside, because they take up space, and measuring things with our sensors would disrupt the circular shape. We’d also be losing a lot of valuable real estate that could be used for another sensor. Another challenge was that the tanks were very expensive. If we spent $300 on a tank, we’d essentially be using most of our quote-unquote budget on something that wasn’t even the embedded device.
Thinking… brainstorming… what could we do?
We decided to make our own! Despite having no prior SolidWorks knowledge, we made a model of what the tank would look like. Then we used the laser cutter to cut out pieces of acrylic from the model to form the back of the tank. Below is the initial design of how it would look.
The curved portion of the tank would be assembled separately, since we’d need a heat gun to make that curve and much thicker acrylic. We also added some other important components:
- The filtration system works in two ways. First, the water travels through the first chamber, where the water-flow ledge is, and reaches the first filtering sponge. It’s the shortest piece of acrylic, ensuring the water flows here first. This removes any small debris before the water passes to the second chamber through a grate cut into the bottom of the acrylic.
- In here, we have aquarium filter media to purify our jellies’ water further and make sure the healthy bacteria necessary for the aquarium can survive. After it’s cleaned, the water goes into the final chamber through another grate in the bottom.
- The third chamber houses the pump and supplies water to the tank. We tried a variety of pumps and settled on a small, waterproof betta fish pump.
- For the plumbing, we used a regular hose and heated the end so it could expand and latch securely onto the pump and the tank’s output port. For reinforcement, we used aquarium-safe silicone.
- The pump’s output port sits behind the tank’s spray screen. This creates our circular water flow and makes sure our jellies don’t get cut or hurt on the edges of the spray bar or sucked into the grates.
We ended up with a tank that held around 10 gallons of water. After it was all designed, cut, assembled, and built, it was time to fill the tank with salt water. We needed to let the water cycle for around two weeks so the bacteria the jellyfish need to survive could form — and so all the bubbles you can see in the photo above could clear out. Bubbles, yes. Even a bubble can pierce a jellyfish and damage its bell.
Phew, that was a lot. But yay, we essentially just built an aquarium, and our jellyfish look really happy. In fact, when we received one of them, it had various deformities on its bell (hence its name, Cauliflower). After around two to three weeks of swimming in the tank, it had practically fully recovered! Pretty cool, and not bad for some first-time jellyfish keepers.
Moving on to the actual embedded device — aka our actual capstone project.
We initially started with a protoboard, just getting power and ground set up. With a couple of initial labs, we added an oscillator, an ATmega328P microcontroller, a switch, some capacitors, a connector for programming the microcontroller, and a couple of LEDs.
From our protoboard experimentation, we learned that the ATmega328P microcontroller posed some additional hurdles. First, by using the ATmega328P, we’d need an external Wi-Fi component. The module increased our cost, and the pins that needed to connect to the ATmega were already being used by our AVR programmer. This created a bit of a chicken-and-egg problem: we needed the programmer for the computer to give directions to the microcontroller, but we also needed the module to supply directions in the other direction.
Even though the documentation and Professor Weber supported keeping the ATmega, we found that a lot of the other teams had been using an ESP32, which already had the Wi-Fi module integrated and was cheaper than buying a separate Wi-Fi module. The ESP32 also includes built-in Bluetooth, so it offered a lot more room for cooler features and integrations down the line. So we made the switch, rewired, retested, and consolidated a lot of the board’s real estate.
Each component was soldered on and verified on the oscilloscope to ensure that a current was indeed running through our protoboard. Next we needed to figure out what would be our inputs and outputs. We knew that our sensors were definitely inputs but we also had a couple additional things to account for.
Each component was soldered on and verified on the oscilloscope to ensure that current was indeed flowing through our protoboard. Next, we needed to figure out what our inputs and outputs would be. We knew our sensors were definitely inputs, but we also had a couple of other things to account for.
Inputs:
- Joystick + button: We wanted to gamify our screens, since Isa is also a game design major and I was taking a games class at the time. The joystick makes it simple to navigate the screens, since it’s a pretty small OLED screen, and it also includes a button for selecting things.
- Water-level sensor: To measure the presence of water in the tank, we used a small sensor near the water-level edge. We made a small casing for it so it could suction to the side of the tank, and applied some waterproof silicone to the end so the salt water wouldn’t erode it as quickly.
- TDS sensor: TDS stands for total dissolved solids. It’s just a probe that sits in the water and reports its reading back to the microcontroller. From that, we can determine if there’s too much or too little salt in the water.
- Temperature sensor (DS18B20): Looking quite similar to the TDS sensor, the temperature sensor measures the water’s temperature and reports it in Celsius (yes, we’re stubborn).
- Color sensor (AS726x): Now, why do we need this? Well, since there wasn’t an ammonia sensor economically available to us, we decided to use a regular fish-tank ammonia alert and then use the color sensor to read the color it produced. The color sensor detects the ammonia reader’s dominant color, which tells us if there’s too much algae or bacteria in the tank.
Now for outputs we had a lot fewer but they made the information coming from the inputs a lot more digestible.
Get Leslie Garcia-Sanchez’s stories in your inbox
Join Medium for free to get updates from this writer.
Outputs:
- OLED display (SSD1306): This was our screen — a small user interface for all our sensor readings. When idle, it showed a small swimming-fish screen (I’m not 100% sure if it made it into the final code submission). We used C and the Arduino IDE for all the coding.
- Email notification (SMTP): Sends a status email over the connected Wi-Fi network when navigating to Screen 4. For now, it only sends to my email address, but additional email functionality could be implemented down the line.
- Relay module: A relay is basically a fancy switch that either supplies power or doesn’t. In our case, it was connected to the heater. Based on the temperature sensor’s readings, it would switch the heater on or off. Thankfully, the temperature where we were working was pretty consistent most of the time.
You’ll notice that a lot of our components look a little cloudy or dirty. That’s silicone we added to make everything more waterproof, since electronics and water — especially corrosive salt water — don’t mix very well. We also designed and laser-cut extra acrylic to form small protective boxes for the external parts, like the water-level and color sensors.
We also had just enough material left to make a cool, retro arcade-style box for our joystick and OLED navigator. Since we did a lot of the final work — creating the casing and assembling it — in about two weeks, there were certainly some hiccups. To help explain this a bit better, I’ve included a picture of our schematic, which unfortunately couldn’t be turned into a full PCB in time.
The ESP microcontroller is kind of like the brain of the whole system. It tells the different sensors to transmit or receive information. So when Leslie decided to stuff all the components into a tiny box (it measures around 3 × 1.5 × 2 inches) and glue it together at 3 a.m., some glue got on the microcontroller’s RST button. It was pretty much invisible, but we couldn’t figure out why JellySafe seemed to power down so suddenly after being connected to power. We resoldered a new ESP32, but it turned out to be broken, so we decided to return to the original one and dissolve some of the superglue that was stuck on the reset button. This was a really tedious process, and I’ll admit that many tears were shed — but in the end, it worked.
Another important consideration was that some of the ESP32 Mini’s pins had to be assigned very specifically. The color sensor and the OLED both required I²C (Inter-Integrated Circuit) connections. We used yellow for SCL (Serial Clock Line) — this synchronizes the transfer of data by providing a clock signal, kind of like a metronome. It comes out of pin 9 on the ESP and connects to both devices. We did the same with SDA (Serial Data Line), which carries the actual data bits, and connected it to pin 8 of the ESP.
For most of the rest, we used pretty standard colors: red for power, black for ground, and blue and green for different sensor signals. We also needed some pull-up resistors, but other than that, it was a relatively simple system. In the end, it created this very beautiful mess of wires, which I’m pretty happy to see, honestly — even though a PCB would’ve been cool too.
So yup, that’s the story. It’s kind of condensed, and I certainly omitted a lot of the trial-and-error details to focus on what we ended up with, but I learned a lot. Persistence and never giving up, for one thing. I also learned that jellyfish are really cool creatures and that there’s so much they — and nature — can teach us. I’m grateful I was able to combine my love for animals and technology. I’m sure this isn’t something that will go to market; it was kind of made to test the limits of what would be possible in an undergraduate capstone class. But it was an amazing experience.
Thank you to Isa and Caramello for putting up with all my crash-outs and being awesome teammates. Thank you to Professor Weber for always answering my seemingly never-ending stream of office-hour visits and emails. Also, thank you to the USC Makerspace for letting us use their machines and giving me the Mech-E SolidWorks crash course. Thank you to Victor for saving me with a spare ESP32, and to everyone else who cheered me on, brought me food, or came to work alongside me in the lab.
Now I’m sure you’re wanting to see the jellyfish, too. Here are some more pictures.
Caramello also gets a feature :P
Thank you for reading this and getting all the way to the end!
Until the next adventure…









