![]() Similary at 50% duty cycle (127) I am receiving 1.8Volts. Wanted to know the voltage drop across the diode. Since I'm using a 5V pin, does this imply the diode within the lilypad vibe board is giving a 1.4V drop? Where did my lost voltage go? I don't have any resistors or diodes connected between the pin and lilypad vibe board as the schemetic shows them installed. I had a question about the lilypad vibe motor:Īt maximum 255 analog value, I receive a voltage reading across the motor of 3.6Volts. Interestingly it's running without a transistor, but I have ordered some transistors and schottky diodes that are coming in, but for now its running straight from the PWM pins on the Arduino mega. Yes im currently sampling the accelerometer at 2.22 ms per reading or 450Hz i believe I also modulated my code to up the PWM frequency to about 950Hz to be safe. To calculate vibration, first part would be setting the sampling rate, about 450 Hz, twice max freq. Hope, you are using transistor to control this motor? I wouldn't connect it directly to arduino, 85/75 mA is too much. Serial.print((((float)z - zero_GZ)/scale)) Serial.print(((float)y - zero_GY)/scale) Serial.print(((float)x - zero_GX)/scale) Divide the shifted sensor reading by scale to get acceleration in Gs. change when the acceleration along an axis changes by 1G. scale is the number of units we expect the sensor reading to Subtract this value from the sensor reading to zero_G is the reading we expect from the sensor when it detects do this but haven't tested the importance add a small delay between pin readings. Make sure the analog-to-digital converter takes its reference voltage fromĪnalogWrite(vibe,127) //set value of motor PWM from 0-255 PinMode(vibe, OUTPUT) //sets the digital pin as output Int sampleDelay = 2.22 //number of milliseconds between readings They won't change:Ĭonst int xpin = A1 // x-axis of the accelerometerĬonst int zpin = A3 // z-axis (only on 3-axis models) This is my Arudino code right now: /* Code for Running a single vibratory motor and accelerometer */ ![]() I also have a Lilypad accelerometer that I figured I could use to measure the amplitude, but I am not exactly sure how to go about doing this. I'm testing out some Lilypad Vibe Boards ( ), and wanted to know how I could figure out what frequency the motors were vibrating at, and possibly even the amplitude (in G's) of the motor. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |