Hello. I just bought my first arduino uno last summer and I am now trying get acquainted with my new device. I am currently working with a microphone that outputs sound levels via LEDs (got the program and idea from here: Arduino Microphone Tutorial - YouTube) and a bluetooth module HC-05 (6pin). My project is simple, print the information that the microphone sends to the LEDs on an android via the bluetooth module. My real problem is, I have no idea what code to use. I currently have this code for the microphone and led function:
As mentioned before, I want to be able to print the data via bluetooth on an android phone. I would appreciate if someone could provide me with the code necessary for such function.
Note: It is my first project with arduino uno. I have no expertise with arduino programming.
Thanks in advance.
you appear to have an analogue read in the range of 30 > 50, variable name sound, which is used to light the LEDs.
If you use any pin other than D0,D1 for the input, you can use D0,D1 for connection to bluetooth in the normal manner.
You can then simply Serial.println(sound) to Bluetooth, which may then be sent to phone. If you use Bluetooth Graphics Terminal, you can show the output on a live graph.
The code looks junky and incomplete, there is surely a better way than this. For bluetooth,
you might find the following background notes useful
My project is simple, print the information that the microphone sends to the LEDs on an android via the bluetooth module.
This does not make sense.
The "information that the microphone sends to the LEDs" is nonsense. The microphone does not send any data anywhere. The Arduino pulls data from the microphone.
Based on the value read from the microphone, it turns zero or more LEDs on.
You could send that value to the Android.
I would appreciate if someone could provide me with the code necessary for such function.
If the bluetooth device is connected to the hardware serial port, the code is already there. If it is connected to other pins, you need to create an instance of SoftwareSerial, and use that instance's print() or println() method to send the data to the bluetooth device.
you appear to have an analogue read in the range of 30 > 50, variable name sound, which is used to light the LEDs.
If you use any pin other than D0,D1 for the input, you can use D0,D1 for connection to bluetooth in the normal manner.
You can then simply Serial.println(sound) to Bluetooth, which may then be sent to phone. If you use Bluetooth Graphics Terminal, you can show the output on a live graph.
The code looks junky and incomplete, there is surely a better way than this. For bluetooth,
you might find the following background notes useful
Thank you for the quick response. Yes, the code works (even though junky) and lights up the correct led when needed. The D0 and D1 are available for the BT connection. I was using those notes to understand a bit the arduino and bluetooth, but I still have some problems. My idea was to be able to recieve the range data as a spreadsheet on the celphone via bluetooth. As stated before, my knowledge on the matter is very limited, hence I requested help. If you could see the video link posted on the top, you can see all the connections made on the arduino.
PaulS:
This does not make sense.
The "information that the microphone sends to the LEDs" is nonsense. The microphone does not send any data anywhere. The Arduino pulls data from the microphone.
Based on the value read from the microphone, it turns zero or more LEDs on.
You could send that value to the Android.
If the bluetooth device is connected to the hardware serial port, the code is already there. If it is connected to other pins, you need to create an instance of SoftwareSerial, and use that instance's print() or println() method to send the data to the bluetooth device.
I am sorry for the vague and incomplete explanation. My knowledge is limited on the matter. The Bluetooth turns on but the leds immediately light up andstead of reading the microphone. I am sure there may be a faulty connection on the 5v side. Any help on the matter is welcomed