Offline
Newbie
Karma: 0
Posts: 12
|
 |
« on: February 17, 2013, 02:10:46 pm » |
Good evening!!! I try to make a program about arduino mega 2560 and sensor 1104.... i try something simple....just make a vibration ...but i can't find some material about this... Could anyone help me ?????? 
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Online
Tesla Member
Karma: 87
Posts: 9370
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #1 on: February 17, 2013, 02:45:14 pm » |
can you post a link to the datasheet of that 1104, I get 156.000.000 hits in Google on the number 1104
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Netherlands
Online
Tesla Member
Karma: 87
Posts: 9370
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #3 on: February 17, 2013, 03:02:50 pm » |
it is an analog device so you should connect one pin to +5V one to GND and the third to Analog pin A0 for example some loop like this should work. void setup() { Serial.begin(9600); }
void loop() { int x = analogRead(A0); float voltage = x * 5.0 / 1023; Serial.println(voltage); }
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 12
|
 |
« Reply #4 on: February 17, 2013, 03:07:35 pm » |
ok ...something like this i have done ..but i need something to put into my code to make the vibration.......how is it work ???
for the temperature sensor and the light sensor i have a formula..but for this ???????
|
|
|
|
|
Logged
|
|
|
|
|
Johannesburg UTC+2
Offline
Edison Member
Karma: 34
Posts: 1705
|
 |
« Reply #5 on: February 17, 2013, 03:15:53 pm » |
i need something to put into my code to make the vibration It doesn't make a vibration: it's a sensor not an actuator. When it feels vibration it will output a voltage based on the intensity of the vibration, eg 0V for "still" and 5V for a "earthquake"; you read that analog input as Rob suggested and your program acts based on the level of vibration.
|
|
|
|
|
Logged
|
IT Crowd: Roy... "Have you tried turning it off and on again?" Moss.. "Have you tried forcing an unexpected reboot?"
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 12
|
 |
« Reply #6 on: February 17, 2013, 03:20:52 pm » |
thanku !!!!!!!!...i thought something else..... now i can explain this sensor into my project
|
|
|
|
|
Logged
|
|
|
|
|
Johannesburg UTC+2
Offline
Edison Member
Karma: 34
Posts: 1705
|
 |
« Reply #7 on: February 17, 2013, 03:24:27 pm » |
now i can explain this sensor into my project Maybe have 3 LEDs.... green for still, yellow for minor vibration and red for a big shake, based on the analog reading?
|
|
|
|
|
Logged
|
IT Crowd: Roy... "Have you tried turning it off and on again?" Moss.. "Have you tried forcing an unexpected reboot?"
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 12
|
 |
« Reply #8 on: February 17, 2013, 03:33:43 pm » |
you mean the pienzo?????????
my pienzo which is attached on the sensor has a green
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 12
|
 |
« Reply #9 on: February 17, 2013, 03:34:59 pm » |
ooops!!!!no i am wrong!!!!! i have not any leds..... 
|
|
|
|
|
Logged
|
|
|
|
|
Johannesburg UTC+2
Offline
Edison Member
Karma: 34
Posts: 1705
|
 |
« Reply #10 on: February 17, 2013, 03:35:52 pm » |
No, I meant maybe you could add coloured LEDs to your project and have them light up depending on how big a shake the sensor registers.
|
|
|
|
|
Logged
|
IT Crowd: Roy... "Have you tried turning it off and on again?" Moss.. "Have you tried forcing an unexpected reboot?"
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 12
|
 |
« Reply #11 on: February 17, 2013, 03:41:12 pm » |
No, I meant maybe you could add coloured LEDs to your project and have them light up depending on how big a shake the sensor registers.
my university can't give me any led.....i must do something with these matereals(sensor+arduino only) i have my mobile phone near the sensor and when it is vibrating the output voltage is the same like before.. 
|
|
|
|
|
Logged
|
|
|
|
|
Johannesburg UTC+2
Offline
Edison Member
Karma: 34
Posts: 1705
|
 |
« Reply #12 on: February 17, 2013, 03:54:11 pm » |
i must do something with these matereals(sensor+arduino only) Well, sensors by their very nature don't "do" anything, they "sense".... then you need an actuator to be the "do-er" based on what you sense. For example, you have a temperature sensor you say: well there's no point measuring the temperature if you don't act on that reading, eg switch the fan on if it's too hot. But remember the Arduino has a built-in LED on pin 13- perhaps you could make that do something based on the readings
|
|
|
|
|
Logged
|
IT Crowd: Roy... "Have you tried turning it off and on again?" Moss.. "Have you tried forcing an unexpected reboot?"
|
|
|
|
|