Arduino nano, sound detection - audio

I got an Arduino nano V3.0, connected via USB to my computer, and powered with the USB.
I want to use the nano to send a signal over the USB to the computer when it detects a sound of some amplitude.
Anybody knows how to connect a sound sensor to nano as easily as possible?
thanks
rough

I found this link useful http://arduinobasics.blogspot.com/2013/05/sound-sensor.html. Just connect sensor to arduino and adopt code for your needs (you don't need leds, just sensor). To send sensor status over USB use Serial class on Arduino and terminal application on PC.

You have 2 options, one of them is to buy a microphone which outputs a pulse when sound exceeds the threshold you've set on the potentiometer on the board, for example this one: Microphone Detector
The other option is to buy a microphone which outputs an analog stream which can be read by the A0 port on the Arduino Nano.
This Adafruit link can help you understand the code. As you can see, the analogRead(0); reads the A0 port of the arduino.

Related

no audio data from PC send to STM32F4 audio class USB

I'm working in an audio project. We use stm32f407 like a USB audio device to get audio data from PC then send out by I2S module. We are using stm32f4 Discovery kit and STM32cubeMX. After generate code by following this video, i change nothing and flash to Kit; my PC identifies that STM Audio device but there isn't any data send to my kit when play music, except MuteCMD . My question is:
i don't know which function is callback when data stream from PC to Kit.
why PC identifies that my kit is an audio output device but the callback of volume control isn't called when I config volume on PC and there isn't any data of music send to my device. The only one mute control callback function is called when i mute the PC.
this is my config in STM32cubeMX
pinout config figure
USB device config figure 1
USB device config figure 2
USB device config figure 3
PC identifies AUDIO device figure
choosing PC's audio output device figure
fail to play test tone figure
You should set USBD_AUDIO_FREQ to 22050 (or 44100, or 11025). Your value is 22100 and it seems like Windows or built-in audio drivers can't use that frequency.
I had exact same problem.
My project is generated from STM32Cube.
Windows recognizes the F7-DISCO board as sound card but failed to play test sounds.
I changed USBD_AUDIO_FREQ to 48000 and PID to 0x5730 (22320 in decimal).
And then everything works fine.

Raspbian - Read data from HID device

I got a measuring instrument which can measure light intensity and this instrument can be connected to a PC via USB.
I now want to be able to read the values from the device via a Raspberry.
When the instrument is connected to the Pi, it shows up when entering 'lsusb' to the terminal and it is also listed under '/dev/usb' as hiddev1
But how can i actually grab the data from the device?
When i enter 'sudo cat /dev/usb/hiddev1' nothing happens.
Thanks in advance for your help
Try using HIDAPI, a cross-platform library for accessing Human Interface Devices.

cylon.js & arduino uno: execute program without cable connection to PC

I am new to this field, so this might be an odd question.
We can write a code(say blinking lights) in the aduino IDE and upload it to arduino and we can disconnect from the pc and the program will run. (blinking will happen).
Now when we are using cylon.js and write the program and execute say
$ node blinking.js
then as long as the arduino is connected to the pc(or laptop) the blinking happens and when I kill node js or disconnect arduino from pc the blinking stops. (this is how its suppose to happen, right?)
So my question is,
if I have a arduino with a temperature sensor some where outdoor and I have a cylon.js program to use those sensor data and do some things (say print them), then how can I achieve this ? Do I have to have two arduinos which are connected via wireless or gsm shields (one outdor and one connected to the pc where the cylon.js is running)?
or is there a simple way of doing this? Any insight on this is much appreciated.
Thank you
then as long as the arduino is connected to the pc(or laptop) the
blinking happens and when I kill node js or disconnect arduino from pc
the blinking stops. (this is how its suppose to happen, right?)
Correct. This is true for any Node.js program controlling an Arduino, whether with Cylon.js or Johnny-Five.
if I have a arduino with a temperature sensor some where outdoor and
I have a cylon.js program to use those sensor data and do some things
(say print them), then how can I achieve this ?
It's not possible with just an Arduino board. You can use a pair of Xbee modules, which will allow your Arduino to communicate with the host machine, or just use a board that has wifi or bluetooth capabilities, such as:
Spark Core
Electric Imp
Intel Galileo
Intel Edison
Raspberry Pi
BeagleBone
pcDuino

How to get audio from or to an FM tuner shield for Arduino

I have an Arduino Uno and a radio receiver shield (Si4735). I am trying to get another audio source to either play through the currently attached 1/8th jack on the shield or have the audio from the shield piped into the Arduino, where I can redirect it to some other source.
I don't have much experience with Arduino or hardware, however I am very experienced as a software developer. Any suggestions as to where to start, or if this shield even supports either of these functionalities?
Per the schematic, the audio output of the Si4735 chip is wired directly to the headphone jack -- there is no way to send the output elsewhere, or to send other audio to it.

Firmata over Bluetooth on Arduino?

I have Firmata working fine on an Arduino Uno, communicating over cable USB to Processing.
I want to get rid of the cable, and run the connection over Bluetooth transport (with a BlueSMIRF module). I am unclear on what I need to do to Firmata to tell it to use the BT module rather than the (unconnected) USB cable interface. In particular, do I need to hack Firmata itself to add initialization code which is
specific to the BT module I'm using, or
more generally, needed to tell Firmata to use a port other than the cabled USB?
Thanks
D
I am NOT very good in Firmata, but as i know, Firmata (on arduino) uses 'Serial' (pin 0 and 1, also aka as TX,RX) to communication with the Host. So, if u want to use a BT module to replace your USB cable on the arduino, hack the Firmata to use other pins, other connect the BT to pin 0 and 1.
You have to upload standard firmata with baud rate changed to 9600 inside the ino file (or test with other speed rate) and then connect BTooth TX>Rx(uno RX) and the bt RX>Tx(uno TX) as said in the previous post ,testing it with arduinoCommander worked like a charm!Arduino uno rx tx are pin0 and pin 1.also have it powered not from usb pc but external source cause having the BT ontop while on usb could mess up thing (in general disconnect the ground from BT module while uploading sketches).
All you have to do is make sure the USB is connected only when you are uploading your sketches to the arduino and then have the BlueSMIRF connected when you are ready to actually run the Arduino code. This way they will both use the default hardware serial port and you should not have to modify any code.
You could try and use SoftwareSerial.h in the Arduino to emulate another serial port but I have found that to be problematic.
Just connect Bluetooth to the Rx Tx pin and upload same standard firmata. Then pass command over bluetooth which you were passing over usb cable....it wil work.

Resources