Light sensor input
workflow Arduino to Firefly to Grasshopper
(note: Grasshopper GH is a a Rhino plugin Firefly is an add on to Grasshopper)
Based on the hexagon unit that I developed in modulus 3 - press-fit construction kit
I develop a GH script that uses 6 triangles to make up a hexagon.
each triangle is setup on polar points in order for a degree change to be applied to it. This change fold the triangle and hence creates a change in the pattern and in the way the hexagon is perceived.
The Hexagon is then regard as a unit with a network and each unit has a responsiveness mechanism in it.
The opening and closing of the unit is related to amount of light.
To make the connection between my Input- physical world data and My output- A virtual Model
I used firefly to mediate between the 2. to be able to create a response in the model in realtime.
Arduino setup:
List of parts:
Bill of Materials: Untitled Sketch.fzz
Untitled Sketch.fzz
Saturday, April 27 2013, 11:14:50
Assembly List
Label | Part Type | Properties |
---|---|---|
Arduino1 | Arduino | processor ATmega; variant Arduino UNO R3 |
R1 | Photocell (LDR) | package THT; resistance@ dark 300 kOhms@ 10 seconds; resistance@ luminance 16 kOhms@ 10 lux |
R2 | 220 Ω Resistor | package THT; tolerance ±5%; bands 4; resistance 220Ω; pin spacing 400 mil |
Shopping List
Amount | Part Type | Properties |
---|---|---|
1 | Arduino | processor ATmega; variant Arduino UNO R3 |
1 | Photocell (LDR) | package THT; resistance@ dark 300 kOhms@ 10 seconds; resistance@ luminance 16 kOhms@ 10 lux |
1 | 220 Ω Resistor | package THT; tolerance ±5%; bands 4; resistance 220Ω; pin spacing 400 mil |
Exported with Fritzing 0.7.12- http://fritzing.org
Arduino sketch written by Rodrigo Medina
Once the sketch is uploaded to your Arduino you will need to set up a read file through firefly plugin in GH
Setup:
1. connect your Arduino first before opening GH and Firefly.
2. Use the Ports available component to check which com port the Arduino is connected too.
3. To begin read from this port you will need the open port componet with a toggle component(false=close , true=open)
4. attach a pad component to see that you get the right message.
4.Connect the read component with a toggle and attach notes to the message and read output. if all is ok you will get a single numerical read.
5. Attach a timer to get a string of value coming in and Save your file.
Creating a grasshopper script with moveable parts.
Paste the Firefly script into it. To get mine to work I had to use some math to convert the incoming value (analog string with a value range between 245- 1028) to something meaningful in degrees .
The GH script with the Firefly code on the top left
The GH script can be downloaded here just change the .jpg extension to .gh