Setting up BLE modules - bluetooth-lowenergy

I am using an adafruit BLE SPI friend, an nRF51 series BLE module. Eventually I will have to set it up to work with an STM32 microcontroller. Is it better to program it with a SPI library on an arduino uno to receive BLE data on a bluetooth receiver (iphone), or should I use any kind of Nordic Semiconductors/program IDE to make the device programming more robust. I would also like to add GATT settings, but really this is my first time working with SPI BLE so I'm not sure how to go about it. Any suggestions? (Also, I am not sure the adafruit library for the device is all that helpful, it seems to sacrifice bandwidth and some functionality for compatibility with their bluefruit app and other of their devices)

Related

Arduino multiple serial/hid output

Hello has anyone found a way to use an Arduino as a serial device and hid device at the same time?
I thought of a few solutions but didn't know the best way to go about it.
my goal is I need a serial device so the computer can send info to the Arduino but I also need an hid device.
can I use them both though 1 USB port? probably not
or
can I rig up another usb or serial port on the Arduino and use that as hid?
or
should I connect the Arduino to a teensy and use that for hid?
Thank you just trying to find the safest solution I'm making a custom fixture for my little laser engraver.
I recommend getting an Arduino Leonardo, Arduino Micro, an A-Star 32U4, or any other Arduino-compatible ATmega32U4 board. These devices act as a USB serial port but they can also be an HID at the same time if you use the Keyboard or Mouse libraries that comes with the Arduino IDE.

How to work with ESP13 wifi shield for arduino?

I recently bought a ESP13 wifi shield which has to mount on to Arduino. I think it is much similar to esp8266 modules, but unable to find a proper guidelines/libraries relevant to it. I did not notice any helpful tutorials also. Here, I want to use this module to run as a wifi server.
An ESP13 is an ESP8266. It is version ESP-13.
It is not a WiFi shield for Arduino; although you can connect it to an Arduino via serial pins and use its WiFi capabilities.
The ESP8266 ESP-13 is a stand alone device. It combines a processor with WiFi so you don't need an Arduino for simple jobs (or not that simple; I use mine to receive REST commands and run 60 addressable LEDs in pretty patterns).
There are lots of resources for ESP8266s:
For example: https://tuts.codingo.me/introduction-to-esp8266-module.
Note that the pin locations change between versions so look out for that when making circuits.

Sending Data from Arduino to Android using Bluetooth

I am trying to do a project based on arduino and Android in which I want to use ultrasonic sensors and Bluetooth module hc-05 . I want to detect any obstacle using ultrasonic and send it's distance to Android app using Bluetooth. I am completely new to arduino and have never used it before . How could I connect both the Bluetooth and ultrasonic sensor to arduino uno board without using breadboard? Is it possible to connect both of them without using breadboard and just the jumper wires?
You can connect the Bluetooth Module and Ultrasonic Sensor with jumper wires directly to the Arduino.
Depending upon the Ultrasonic Sensor you are interfacing, there must be a library or a sample code. You can tweak the code to get the distance in your desired format or variable.
As far as the Bluetooth is concerned, you can operate it at 3.3v or 5v depending upon the module you use. Most of the Bluetooth module support both 3.3v and 5v - as they have voltage regulators on their break out. I have used these and they work on 3.3v as well as 5v
For instance, check the Bluetooth HC - 05 Module in the below link :
http://www.amazon.in/Verve-VTA009-Bluetooth-Module-HC-05/dp/B00S15XTG8?tag=googinhydr18418-21&tag=googinkenshoo-21&ascsubtag=7a58e842-4c10-40bf-a48f-339edef372a7
For implementing the Bluetooth communication, prefer using the Software Serial. If you connect the Bluetooth HC 05's Rx and Tx to the Arduino's Hardware UART Pins, there can be unpredictable results. I have experienced that using HC05 with Software Serial is reliable. Additionally, you can use the Serial Monitor to debug your code at the same time. I mean, you can send the same data on Software Serial and the Serial port and check if things are as desired.
You can implement, the HC-05 Software Serial at 9600 baudrate. 9600 is the default baudrate on most HC 05 Modules.
For developing the Arduino code and testing it, you can use a terminal client like PuTTY on you computer. You need to establish a bluetooth connection between your computer and HC 05.
HC-05 runs at 3.3V, make sure you do level conversion from 5V to 3.3V using a zener diode. Or buy a level converter if you are new to electronics. If you don't, there is a good chance you will blow up the HC-05. If you could add a photo we can see if its already done on the Bluetooth module, then you need not worry about level conversion
HC-05 is basically a wireless serial port over bluetooh. On arduino create a software serial post using the library SoftwareSerial and send the sensor data to that serial port
There are libraries available for popular HC-SR04 ultrasonic sensor, if that is the sensor you are using.
For testing on android many app are availables like Bluetooh Terminal, you can receive the data sent from arduino.
Yes the whole project can be done without breadboard using connecting wires.

Arduino ESP8266 Library

I am new to arduino and just picked up myself an UNO and an ESP8266 module. I've managed to wire them all up properly and connected to my home network using the AT commands.
But now im trying to follow tutorials on the internet but the problem is every example includes a library
#include <ESP8266WiFi.h>
such as this example tutorial https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/example-sketch-ap-web-server
So I have tried googling for it but can't find anything. I'm assuming thats because its really simple and Im missing something quite obvious.
help?
If you wish to use the Arduino as the main part of your ESP8266 project, there are several ways to go.
Use the Arduino to issue AT commands to the ESP8266.
Create your own protocol or messaging system by programming up the
ESP8266 with (for example) nodemcu or the Arduino/ESP8266 project or
Espressif or others, then program up your Arduino with the same
protocol or messaging system so the two may talk.
Alternatively, just program your ESP8266 directly. No Arduino required. Doing so, you can turn the tables and get the ESP8266 to issue messages to the Arduino if for example if you wanted the many GPIO and sense pins of the Arduino to do something. If you only need a couple of extra GPIO pins, look at the ESP8266 range to get more GPIO pins, such as the ESP8266-12
Which to choose?
nodemcu will give you a good idea of the capabilities of the ESP8266
and may be a good starter, easy to flash, easy to program, but it is a poor finisher except for the most basic of programs.
espressif has a large toolchain, not pleasant to flash,
you'll be at the cutting edge, however the community support is
minimal
The Arduino/ESP8266 project is awesome, easy to flash, very fast,
very stable, and unlike nodemcu you can create a large project. As you noticed, any arduino project starting with #include <ESP8266WiFi.h> is not for the arduino, but for the ESP8266 using the arduino IDE https://github.com/esp8266/Arduino
The Sparkfun example, it's for the ESP8266 Thing and it's using the Arduino ESP8266 Core, to flash the module.
It's not Arduino code that communicates with the module over serial. You need to upload this code to ESP module and with the Arduino ESP8266 Core, it's possible to program the ESP directly from the Arduino IDE.

Is it possible to use both external power jack and USB port with Arduino?

I have the Arduino UNO board and I want to know if it is possible to use both the USB connection (for exchanging data) and the external jack to power supply it.
I will use the following cable: http://ecx.images-amazon.com/images/I/41OMXaj5cPL.SY355.jpg with a AC-DC 5V adaptor in order to power supply the Arduino. However, I want to use also the USB connection in order to send some data from the computer.
Both will be connected at the same time.
In short, I want the Arduino to be able to run even if the computer is OFF and whenever I open the computer to send data to Arduino from USB connection.
Is this possible? Will the Arduino Uno board support it?
Yes. From the official Arduino website:
Power
The Arduino Uno can be powered via the USB connection or with an external power supply. The power source is selected automatically.
External DC power will override USB power if the Arduino detects it. [Source]
as other said, it is absolutely possible to have both usb and power jack plugged in.
but be aware that if you shut down your computer and turn it on after, when reading the usb port you'll restart the Arduino and might loose important data.
yeah both of them can be used. If you want to upload the code in arduino then simply use the usb cable otherwise keep it on adapter. it wont harm the device.
What I personally do is, I keep on plugging the adapter and remove the usb once I am done with uploading and then test it as normally the usb cable is quite small and I normally work on robots so I need long wires.
if you want just plugs it in, it's ok but Arduino board will chose one and usb has priority to other power source.
********* Very important :*****
if you are controlling other circuits, that are connected to an external power supply, with your Arduino and connecting it to your PC's usb, Arduino will have potential difference and it will cause current flow that will damage your PC and Arduino board. if you want to do such thing, you have to shield your Arduino board from your other circuits that you want to control and they have external power source. this could happen with optocouplers for digital ports, non signal analog ports with shield relays, and complex analog circuits for analog signals

Resources