A Spark of Curiosity: Journey into Circuits


A fun project featuring Arduino, Raspberry Pi, Python, and React+Next.js

Michael Clifford
Feb 6, 2024

Picture of the circuit in its final form

This story begins with a spark of inspiration and unfolds into a project, all inspired by the innocent wonder of a child.

What is this?

CloudVane is the sum of parts made up of Arduino, Raspberry Pi, Python, and React/Next.js.

But why?

About a week ago, my daughter, a 3rd grader and cat lover, came home from school excited to share that she had learned about how switches and lightbulbs work. Essentially, she was introduced to the basic concept of circuits, and she was eager to tell me more and learn more herself.

I was ecstatic. Having been introduced to computers at the age of 5 (in 1985!), I've always had a passion for technology. My journey into software development paralleled my adventures in building my own circuits and becoming familiar with Ohm's Law (ah, P=IE). This presented a wonderful opportunity to share something I love with her and to foster her interest.

Unfortunately, my hardware days are long behind me, and I had given away most of my equipment to classmates and friends who continued to pursue it as a hobby. However, armed with my trusty multimeter, I discovered that getting back into it felt like relearning to ride a bike: you never really forget, and wow, there are some impressive bikes these days.

Arduino is incredible. These self-contained microcontroller development boards replace the custom ISA cards we used to build. The Arduino language makes it unnecessary to switch to ASM from C.

The Raspberry Pi offers an entire platform for writing code, hosting a web service, and gathering data from other connected devices. It's such a capable computer in a tiny package. While I own more than one, I've primarily used them as tiny retro emulators to pass time at lunch with coworkers (and to satisfy my Dr. Mario craving).

While none of these technologies are new, this was my first opportunity to play with some modern toys (and perhaps show my kids how cool their old man is).

How does it work?

In summary, a DHT11 sensor measures temperature and humidity data. This sensor data is then captured by an Arduino and transmitted to a Raspberry Pi via a serial connection. The corresponding Arduino sketch is available on GitHub.

On the Raspberry Pi, a Python script reads the data from the serial connection and forwards it as JSON through HTTP requests. This server is made accessible to the internet via ngrok.

However, nobody enjoys reading raw JSON (as my wife put it: "Make it prettier!"), so a React/Next.js client retrieves the data from the Python service and presents it in a more user-friendly format, suitable for human interpretation.

Together, this setup is an example of what is collectively known as the Internet of Things (IoT).

Project Schematic

Coming soon!

What's next?

My current plan involves developing smaller sensors that transmit data via Bluetooth, enabling the placement of a sensor in each room of the house for highly localized climate information. Stay tuned!

Hardware List

Arduino Mega 2560 Rev3

Raspberry Pi 4

DHT11 Climate Sensor

DS3231 RTC Module

16x2 LCD Module Display

830 Point Solderless Breadboad

Project Links

Arduino Sketch: arduino-weather-clock

Python Server: cloudvane-api

React UI: cloudvane