Robo, A DIY Intelligent Roof
A shape-shifting roof that moves according to changes in natural light and precipitation
In my last post, I introduced Robo, a design solution that takes a fresh look at the juncture of Internet of Things (IoT) and kinetic architecture. The following video is a short demo of Robo’s main functionalities.
Further, the system diagram below highlights the workflow and the relationship between components used in this project. For more information on the design and high level functionalities, feel free to visit my last post.
Here, I will explain the steps to make a DIY 1/50 scale prototype of Robo using a Raspberry Pi and some Python programming. Let’s get started!
Prerequisite
Skills that are needed for this project are as follows:
- Knowledge of programming in Python
- Knowledge of some basic Linux commands
- Some basic understanding of electronic circuits and being able to work with a breadboard
- Making the physical model with balsa wood, foam board, and paper. (The canopy is made out of a single sheet of thin paper and has a specific pleating pattern that allows the form to expand and contract easily.)
Hardware Components
The components used in this project are as follows:
- Raspberry Pi4 (RPi)
- TSL25911FN QCrobot light sensor
- HiLetgo LM393 Rain Drops Sensor
- TT dc 6v motor
- Rack and pinion system
- A breadboard, LED lights, push buttons, and jumper wires
- Material and equipment to make the physical model
Main Capabilities
Robo has two modes of operation: automatic, and manual. When in manual mode, it follows the user’s commands by pushing either the open button or the close button. However, when in automatic mode, it moves in three different scenarios depending on the input from light and rain sensors:
- At sunrise, it closes the canopy to let the sunlight reach the interior space.
- At sunset, it opens the canopy and turns on the LED in the patio to create a cozy setting for an enjoyable evening hangout.
- When it is rainy (or snowy), it opens the canopy regardless of time of the day.
These scenarios were designed for winter conditions in Northeast of the United States. However, they can be modified to apply to different climates and seasons accordingly by changing the thresholds for the sensors and changing the actions taken by the actuators in the source code (see the following section).
Programming it in Python
The program is initiated in automatic mode. In case the manual button is pressed at any time, the program switches to manual mode and can be controlled by either open or closed push buttons by the user. There are six modules, each performing a single functionality:
- manual: to switch between manual and automatic mode
- buttons: to manually open or close the canopy (only in manual mode)
- light_sensor: to detect if it is daytime or nighttime
- rain_sensor: to detect if it is raining/snowing
- dc_motor: to rotate the motor backward/forward and hence, close/open the canopy
- LED: to turn the night lights on
The source code for Robo is available on my Github repo for your reference.
Manual Mode
Manual module is responsible for switching between manual and automatic mode. In addition, it turns on a blue LED when the manual mode is on.
Buttons
This module is only in use when the manual mode is on. In that case, it opens or closes the canopy manually, using the two corresponding push buttons.
- open_button checks if the canopy is already closed and if yes, it opens the canopy and turns the lights on.
- close_button checks if the canopy is already open and if yes, it closes the canopy and turns the lights off.
Light Sensor
Light sensor is responsible for checking the lux (unit of illumination) and determining if it is daytime or nighttime. If the outdoor light level is 10 lux or more it is considered daytime. Here are the requirements for assembling the circuit for this sensor:
- QCrobot light sensor (Built-in TSL25911FN chip)
- Install the required python package, waveshare_TSL2591
- Jumper wire (F-M and M-M DuPont connectors)
Raindrop Sensor
This module is responsible for detecting water drops on the raindrop sensing board. A large drop of water that spans 3 lines of copper on the raindrop detection board is enough to trigger the detection of rainfall. Adjusting the potentiometer will change the sensitivity of the digital trigger. Here are the requirements for assembling this sensor:
- HiLetgo LM393 Rain Drops Sensor
- Control board
- Jumper wire (F-F DuPont connectors)
DC Motor
This module is responsible for rotating the motor forward and backward which results in opening and closing the canopy, respectively. The variable pulse width modulation named pwm is defined for adjusting the rotation speed. Controlling the speed is important for testing the mechanical part of the physical prototype. Rotation takes a specified amount of time that is defined in the module and can be edited. Here are the requirements for setting up the dc-motor:
- l293 or SN755410 motor driver chip
- One TT dc 6v motor
- 4x AA batteries
- Jumper wire (F-F DuPont connectors)
LED
This module is responsible for turning the LED located in the balcony on and off. Here are the requirements for setting the hardware up:
- LED
- 330 Ω resistor
- Jumper wire (M-F DuPont connectors)
Unit Testing
Testing each module separately is a vital part of the process. They should each work properly before being integrated into the main program. Below are the ways modules can be tested:
Putting it all together
The main file imports the required functions from each of the six modules. It would be necessary to test each module to see if they work in conjunction with other modules.
The program starts in a state in which Robo is closed and manual mode is off. Program includes three chunks of code:
- It checks if manual mode is on or off.
- If manual mode is on it opens or closes Robo manually.
- If manual mode is off it opens or closes Robo automatically.
What’s Next?
I would love to take this idea further. Exploring more kinetic geometries and perhaps build an actual prototype (to the scale) for our balcony. As this project is designed for a 1/50 scale, building a full scale model require some updates in the software and a total reconsideration for dc motor and structure of the canopy. It would be great if a user interface can be developed. Additionally, the possibility of integrated photovoltaic cells on the surface of the canopy can be explored. If you have any ideas for how I can develop this further, please let me know. I would love to team up with other enthusiasts!
I hope this post gives you some ideas to work with environmental real-time data. Let me know if you make your own Robo or if this inspires you to build other projects. I would love to see them!