What am I doing wrong?

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
tessue
 
Posts: 9
Joined: Mon Dec 11, 2017 6:06 pm

What am I doing wrong?

Post by tessue »

Hi,
This is regarding my order no. 1592362-2737044897, made on Nov. 13. Here is the details of my order.
Products
------------------------------------------------------
1 x Vibrating Mini Motor Disc[ID:1201] = $1.95
1 x Adafruit DRV2605L Haptic Motor Controller[ID:2305] = $7.95
1 x Adafruit Silicon MEMS Microphone Breakout - SPW2430[ID:2716] = $4.95
1 x Wired Miniature Electret Microphone[ID:1935] = $0.95
1 x Electret Microphone Amplifier - MAX4466 with Adjustable Gain[ID:1063] =
$6.95
------------------------------------------------------
Sub-Total: $22.75
United States Postal Service (0.14lbs) (First-Class Package Service -
Retail<sup>™</sup>): $4.05
Sales Tax: $0.00
Total: $26.80

From the items I ordered above, Adafruit DRV2605L Haptic Motor Controller[ID:2305] and Adafruit Silicon MEMS Microphone Breakout - SPW2430[ID:2716] don't seem to be working. For ID:2305, I downloaded the library from your web-site, and tried every example sketch in there, but vibrator didn't move. I checked and confirmed that the solder point between the module and the vibrator is making a good contact. For ID:2716, I connected it as described in your web-site (Vin to 3.3V, GND to ground, DC to A0) and ran the "AnalogReadSerial" example sketch from the arduino IDE 1.8.5, but only get values very similar (250~256) no matter how loud a sound I exposed to the unit.

They are for school project, and the deadline is approaching rapidly. What should I do?
Last edited by tessue on Tue Dec 12, 2017 7:45 pm, edited 1 time in total.

User avatar
adafruit_support_bill
 
Posts: 88099
Joined: Sat Feb 07, 2009 10:11 am

Re: What am I doing wrong?

Post by adafruit_support_bill »

Please post some photos showing your soldering and connections.
And also please post the code you are using.

User avatar
tessue
 
Posts: 9
Joined: Mon Dec 11, 2017 6:06 pm

Re: What am I doing wrong?

Post by tessue »

Hi,
Attached is pictures of wired circuits for the MEMS microphone and the heptic motor controller, respectively.
As for the sketch, I used "AnalogReadSerial" from the "01. Basics" folder in the "File>examples" menu with longer delay time (1000) for the MEMS microphone test, and and "Basic" from the "Adafruit DRV2605 Library" folder in the "File>examples" menu without any changes. Two sktechs are I used is below.
Hope this information can help you figure out what am I doing wrong.

Best wishes...

-taesung

P.S. I failed to upload the photos. It is too big (~3 MB each). Even with 800x600 setting, they are more than 1 MB. Can you give me your e-mail address so I can e-mail them to you directly? Or, if you prefer some other way, please let me know.

----------------------------------------------------------------------

Code: Select all

/*
  AnalogReadSerial

  Reads an analog input on pin 0, prints the result to the Serial Monitor.
  Graphical representation is available using Serial Plotter (Tools > Serial Plotter menu).
  Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.

  This example code is in the public domain.

  http://www.arduino.cc/en/Tutorial/AnalogReadSerial
*/

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // print out the value you read:
  Serial.println(sensorValue);
  delay(1000);        // delay in between reads for stability
}

------------------------------------------------------------------

#include <Wire.h>
#include "Adafruit_DRV2605.h"

Adafruit_DRV2605 drv;

void setup() {
  Serial.begin(9600);
  Serial.println("DRV test");
  drv.begin();
  
  drv.selectLibrary(1);
  
  // I2C trigger by sending 'go' command 
  // default, internal trigger when sending GO command
  drv.setMode(DRV2605_MODE_INTTRIG); 
}

uint8_t effect = 1;

void loop() {
  Serial.print("Effect #"); Serial.println(effect);

  // set the effect to play
  drv.setWaveform(0, effect);  // play effect 
  drv.setWaveform(1, 0);       // end waveform

  // play the effect!
  drv.go();

  // wait a bit
  delay(500);

  effect++;
  if (effect > 117) effect = 1;
}
Last edited by adafruit_support_bill on Wed Dec 13, 2017 12:42 pm, edited 1 time in total.
Reason: Please use [code] tags when submitting code to the forums

User avatar
adafruit_support_bill
 
Posts: 88099
Joined: Sat Feb 07, 2009 10:11 am

Re: What am I doing wrong?

Post by adafruit_support_bill »

There are many on-line photo re-sizing applications. An 800x600 JPG should be well under 1Meg.

User avatar
tessue
 
Posts: 9
Joined: Mon Dec 11, 2017 6:06 pm

Re: What am I doing wrong?

Post by tessue »

Thanks. Here are the pictures...
Attachments
rsz_memsmicrophone.jpg
rsz_memsmicrophone.jpg (487.25 KiB) Viewed 1507 times
rsz_hepticdriver.jpg
rsz_hepticdriver.jpg (425.11 KiB) Viewed 1507 times

User avatar
adafruit_support_bill
 
Posts: 88099
Joined: Sat Feb 07, 2009 10:11 am

Re: What am I doing wrong?

Post by adafruit_support_bill »

The soldering looks good and the connections we can see look correct. We cannot see the actual connections to the motor.

Please post the Serial Monitor output from the analogReadSerial using the microphone.

Also please post the Serial Monitor output from the basic.ino example for the DRV2605 module.

User avatar
tessue
 
Posts: 9
Joined: Mon Dec 11, 2017 6:06 pm

Re: What am I doing wrong?

Post by tessue »

Connection to the motor is also good. Please let me know if you want me to send another picture.
Attached is the screen shot you wanted.
Thanks...

-taesung
Attachments
Screenshot from 2017-12-13 17-42-05.png
Screenshot from 2017-12-13 17-42-05.png (177.91 KiB) Viewed 1493 times
Screenshot from 2017-12-13 17-36-40.png
Screenshot from 2017-12-13 17-36-40.png (345.6 KiB) Viewed 1493 times

User avatar
tessue
 
Posts: 9
Joined: Mon Dec 11, 2017 6:06 pm

Re: What am I doing wrong?

Post by tessue »

Oh, I forgot to mention that while I took the screen shot of MEMS microphone, I was regularly shouting into the mic.

User avatar
adafruit_support_bill
 
Posts: 88099
Joined: Sat Feb 07, 2009 10:11 am

Re: What am I doing wrong?

Post by adafruit_support_bill »

Your mems microphone output looks within reason for the program you are running and the way you have it configured. The signal from this device is typically about 100mVpp with a DC bias of around .7v. Using a 5v analog reference, your readings should be mostly within 10 or 20 counts of 150. Using the AnalogReadSerial example, your sample rate is going to be relatively low (< 1Hz), so you are not guaranteed to even catch the peaks.

Changing to a 3.3v - or even 1.1v reference would give you higher resolution: https://www.arduino.cc/reference/en/lan ... reference/
But you will need to sample at a much higher rate to capture the peaks and calculate sound levels. : https://learn.adafruit.com/adafruit-mic ... und-levels

The DRV2605 test seems to be hanging up when initiating connection to the device. This is usually due to a problem with the i2c connection. Try re-wiring the connections between the UNO and the DRV2605. It could be a bad jumper, or a bad connection on the breadboard. Tug gently on each of the jumper puns to make sure they are securely gripped by the spring contacts.

User avatar
tessue
 
Posts: 9
Joined: Mon Dec 11, 2017 6:06 pm

Re: What am I doing wrong?

Post by tessue »

Thanks for your prompt answer.
With the "Example Sound Level Sketch for the Adafruit Microphone Amplifier" you sent, I was able to get very promising result. But there are couple of things I need to clarify. First, I am still a bit mystified by the reference thing. Do I need to set it with analogReference() explicitly? For example, if I connect 3.3V from uno to the Vin pin on the microphone, would it automatically make the analog reference to 3.3V. If I use want to use some other voltage value, say 1.1V as you recommended, should "analogReference(EXTERNAL);" be in setup() or loop(). Secondly, you said that I should get 0.7V DC bias and 100mVpp. But the above sound level sketch I saw 0.01V bias and signal went up to 0.30V for rather loud sound with 3.3V Vin, and 0.02V bias and signal up to 1.73V with 1.1V reference. Does it make sense to you? Would you mind teach me how to find the output signal voltage range given analog reference value?
As for the DRV2605, I try to reconnect the wires and even check the connections with the multimeter (from the solder ball on the module to the jumper tip that goes into the uno connector), but still got the same serial monitor output. What should I try next? Is there any other sketch I can try?

User avatar
adafruit_support_bill
 
Posts: 88099
Joined: Sat Feb 07, 2009 10:11 am

Re: What am I doing wrong?

Post by adafruit_support_bill »

Do I need to set it with analogReference() explicitly?
To use the 1.1v internal reference, you just need to call "analogReference(INTERNAL);" in your setup().

To use the 3.3v pin as a reference, you need to do 2 things:
1) Call "analogReference(EXTERNAL);" in your setup().
2) Connect a jumper wire from the 3.3v pin to the AREF pin.
But the above sound level sketch I saw 0.01V bias and signal went up to 0.30V for rather loud sound with 3.3V Vin, and 0.02V bias and signal up to 1.73V with 1.1V reference. Does it make sense to you?
That code is printing the peak-to-peak voltage. It is also assuming a 5v reference.

For the DRV2605, try running the i2c scanner to see if the board is responding to the i2c address:
https://playground.arduino.cc/Main/I2cScanner

User avatar
tessue
 
Posts: 9
Joined: Mon Dec 11, 2017 6:06 pm

Re: What am I doing wrong?

Post by tessue »

Thanks. I think I understand the MEMS mic better now.
I run the I2C scanner sketch (reproduced below), and attached is what I got on the serial monitor. Basically nothing happened. The sketch mention something about Leonardo. I am using Uno, so do I need to change anything from the sketch I got on the link you sent?

Code: Select all

 -----------------------------------------------
// I2C Scanner
// Written by Nick Gammon
// Date: 20th April 2011

#include <Wire.h>

void setup() {
  Serial.begin (115200);

  // Leonardo: wait for serial port to connect
  while (!Serial) 
    {
    }

  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;
  
  Wire.begin();
  for (byte i = 8; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
      {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
      } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop() {}
----------------------------------------------------- 
Attachments
Screenshot from 2017-12-14 12-32-42.png
Screenshot from 2017-12-14 12-32-42.png (185.25 KiB) Viewed 1419 times
Last edited by Franklin97355 on Fri Dec 15, 2017 10:37 pm, edited 1 time in total.
Reason: Added code tags.

User avatar
adafruit_support_bill
 
Posts: 88099
Joined: Sat Feb 07, 2009 10:11 am

Re: What am I doing wrong?

Post by adafruit_support_bill »

Your sketch is communicating at 19200 baud, but your Serial monitor is set to 9600 baud. You need to change either the Serial.begin() in the setup() or the baud rate setting of your serial monitor so that they match.

User avatar
tessue
 
Posts: 9
Joined: Mon Dec 11, 2017 6:06 pm

Re: What am I doing wrong?

Post by tessue »

I changed baud rate in Serial.begin( ) to 9600. As you can see in the attached screen shot, it stuck at "Scanning...". I waited 5 minute before disconnect the uno, but nothing happened after initial message (I2C scanner. Scanning...).
Attachments
Screenshot from 2017-12-14 16-44-52.png
Screenshot from 2017-12-14 16-44-52.png (398.46 KiB) Viewed 1405 times

User avatar
adafruit_support_bill
 
Posts: 88099
Joined: Sat Feb 07, 2009 10:11 am

Re: What am I doing wrong?

Post by adafruit_support_bill »

OK. So it is not detecting the motor driver on the bus. We can try replacing the motor driver. If you contact [email protected] with a link to this thread we can get a replacement out to you.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”