{"id":810,"date":"2009-11-22T22:52:37","date_gmt":"2009-11-23T04:52:37","guid":{"rendered":"http:\/\/alliwalk.com\/blog\/?p=810"},"modified":"2009-12-13T17:02:08","modified_gmt":"2009-12-13T23:02:08","slug":"phys-comp-final-vibratingpurring-the-plant","status":"publish","type":"post","link":"https:\/\/alliwalk.com\/blog\/2009\/11\/phys-comp-final-vibratingpurring-the-plant\/","title":{"rendered":"Using FSRs to turn on vibration motorsor"},"content":{"rendered":"<p>Tonight I was working on putting together some of the pieces for my Android Pet Plant.<\/p>\n<p>To make the plant vibrate, I plan to use the 1&#8243; FSRs around the flower pot which will trigger at least 2 vibration motors. To test this out, I cut open a cardboard Diamond Crystal salt container and stuck a piece of foam in the bottom of the container. Then I poked holes through the foam and through them I shoved some leaves that I got from someone&#8217;s fruit and the two motors, which I taped to the leaves with electrical tape.<\/p>\n<p>On the outside of the container, I attached the FSRs with masking tape and then covered them in this fake leather stuff, which I flipped over so the soft part faced out. I wrote <em>Pet Me<\/em> on them, too. All of that went into the Arduino and, when I switched it on, I got vibration when I &#8220;petted&#8221; the pot.<\/p>\n<p><a href=\"http:\/\/alliwalk.com\/blog\/wp-content\/uploads\/2009\/11\/img_2837.jpg\"><img loading=\"lazy\" class=\"alignleft size-medium wp-image-813\" title=\"motors\" src=\"http:\/\/alliwalk.com\/blog\/wp-content\/uploads\/2009\/11\/img_2837-300x225.jpg\" alt=\"motors\" width=\"300\" height=\"225\" srcset=\"https:\/\/alliwalk.com\/blog\/wp-content\/uploads\/2009\/11\/img_2837-300x225.jpg 300w, https:\/\/alliwalk.com\/blog\/wp-content\/uploads\/2009\/11\/img_2837.jpg 640w\" sizes=\"(max-width: 300px) 85vw, 300px\" \/><\/a><br \/>\n<a href=\"http:\/\/alliwalk.com\/blog\/wp-content\/uploads\/2009\/11\/img_2834.jpg\"><img loading=\"lazy\" class=\"alignleft size-medium wp-image-812\" title=\"motors\" src=\"http:\/\/alliwalk.com\/blog\/wp-content\/uploads\/2009\/11\/img_2834-300x225.jpg\" alt=\"motors\" width=\"300\" height=\"225\" srcset=\"https:\/\/alliwalk.com\/blog\/wp-content\/uploads\/2009\/11\/img_2834-300x225.jpg 300w, https:\/\/alliwalk.com\/blog\/wp-content\/uploads\/2009\/11\/img_2834.jpg 640w\" sizes=\"(max-width: 300px) 85vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/farm3.static.flickr.com\/2511\/4127345542_91cc984863.jpg\"><img loading=\"lazy\" class=\"alignnone\" title=\"Pet me\" src=\"http:\/\/farm3.static.flickr.com\/2511\/4127345542_91cc984863.jpg\" alt=\"\" width=\"500\" height=\"375\" \/><\/a><br \/>\n<a href=\"http:\/\/farm3.static.flickr.com\/2538\/4126574203_661c3804c3.jpg\"><img loading=\"lazy\" class=\"alignnone\" title=\"Pet me!\" src=\"http:\/\/farm3.static.flickr.com\/2538\/4126574203_661c3804c3.jpg\" alt=\"\" width=\"500\" height=\"375\" \/><\/a><\/p>\n<p>The code was fairly simple. I simply reused something I&#8217;d written before. I suppose I should change the code from LEDs to motors, but I&#8217;m just trying to make it work for now.<\/p>\n<pre>int analogFSR = 4; \/\/ FSR analog input\r\nint motorpin = 10; \/\/ Motor pin\r\nint FSRValue = 1; \/\/ Value of the FSR\r\n\r\nvoid setup() {\r\n  \/\/ initialize serial communications at 9600 bps:\r\n  Serial.begin(9600);\r\n}\r\n\r\nvoid loop() {\r\n  FSRValue = analogRead(analogFSR); \/\/ read the left FSR value\r\n  analogWrite(motorpin, FSRValue\/4);\r\n  Serial.println(FSRValue); \/\/ print the FSR value back to the\r\n\r\n  delay(500); \/\/ gives a 10 millisecond delay\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Tonight I was working on putting together some of the pieces for my Android Pet Plant. To make the plant vibrate, I plan to use the 1&#8243; FSRs around the flower pot which will trigger at least 2 vibration motors. To test this out, I cut open a cardboard Diamond Crystal salt container and stuck &hellip; <a href=\"https:\/\/alliwalk.com\/blog\/2009\/11\/phys-comp-final-vibratingpurring-the-plant\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Using FSRs to turn on vibration motorsor&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,4,77,76,8,3],"tags":[157,162],"_links":{"self":[{"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/posts\/810"}],"collection":[{"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/comments?post=810"}],"version-history":[{"count":12,"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/posts\/810\/revisions"}],"predecessor-version":[{"id":835,"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/posts\/810\/revisions\/835"}],"wp:attachment":[{"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/media?parent=810"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/categories?post=810"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/tags?post=810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}