Intro: Generated Jar [Generative Design] [TfCD]
This instructable will show you how to use Generative Design to create a unique 3D Jar incorporating user input and sensor input. Generative design makes use of algorithms to generate and explore variants of a design.
In this example we will define the basic shape of a jar, then the final shape will be generated randomly within our constrains, the color will be given by the temperature sensor and the height and width will be set by user input. The user will be able to save the generated design as a .STL file, which can be used to 3D print or modify it.
Step 1: Necessary Hardware & Software
The following is the list of required elements that we will use in this example. Software is free and hardware is less than 50€, generally included in any arduino kit:
- Git: Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Download and install it.
- Arduino IDE. Download and install it.
- Arduino board. Most of arduino boards will work, even an Elegoo board (used in this example).
- Bread board. To use the Thermistor sensor.
- 10K Ohm NTC Thermistor. To gather temperature. It is a sensor that is generally included in arduino kits.
- 10K Ohm Resistor.
- Hookup Wires. To connect the arduino to the breadboard.
Other software/elements used to make this example (note that you do not need to download these because are included in the the code):
- Bootstrap: To style the website.
- OpenJSCAD: To view, download and generate the geometry.
- Express: Node.js framework for our "application".
Important: The amount of software/apps used in this example might be overwhelming for a person with little experience in coding. Nevertheless the step-by-step will clarify why every thing is used for.
Step 2: Connecting the Board
It's a very simple circuit as shown in the picture. As the R1 (resistor 1) value changes, Vout changes. In this case R1 will be the thermistor and its value will change relative to the temperature. Vout is connected to our analog port on the Arduino so we can monitor it.
Step 3: Install the APP
Once you have installed the required software mentioned in step one:
- Create a folder in your desktop. Call it generative_jar.
- Open the command line and cd/generative_jar. (Go to the folder with the command line). Here is a simple tutorial for users that do not have experience with the command line.
- Once in your folder type the following in the command line:
git clone https://github.com/kevinmamaqi/TfCD_A2_Generative_Jar
You will notice that a folder called TfCD_A2_Generative_Jar has been created, and it contains many files and folders. To proceed:
- Open the firmata.ino (inside Firmata > firmata > firmata.ino) file with your Arduino IDE.
- With your arduino board connected click on Upload. This will allow us to use Johnny-five to recover data from the arduino file.
Once we have this we can proceed.
Step 4: Test That Board Is Connected
In your command line type:
If everything goes fine it will look like the image. The connection is set, the temperature is being read, and if you touch your sensor it will increase the temperature (if your body is warmer than the room temperature, of course).
Step 5: Try the App Yourself
Now we can try the app by going to http://localhost:3000 in our browser. It will appear a website with 2 parameters that the user can input and a figure that will be generated automatically every time we click on Generate it Again!.