Arduino bluetooth controller app
2:12arduino – control de 2 motores dc vía bluetooth (tutorial)rui santosyoutube – 25 sep 2013
He estado jugando con el Bean de Punch Through Design y hace poco me enteré de esta aplicación. Es un gran accesorio para el bean y fue rápido y fácil de poner en marcha. Me gustaría ver controles adicionales como deslizadores e interruptores de palanca. Tal vez en una futura versión 🙂
He tenido algunas judías y no he dedicado tiempo a programarlas completamente, pero con esta aplicación puedo hacer mucho con muy poco esfuerzo. Realmente genial para hacer que mis judías sean utilizables con el mínimo esfuerzo e impresionar a la gente.
Control de arduino desde android
Este es el método que inicializa la aplicación y todo el UI, comenzamos obteniendo nuestras referencias de los botones y textview desde el layout. Luego añadimos algo de lógica a nuestros dos botones. Por ejemplo, en el caso del switchLight, el click listener determinará primero si hay una conexión bluetooth con el módulo, y si la hay, entonces se envía un mensaje para apagar o encender la luz. Lo mismo ocurre con el botón switchRelay, pero en este caso también hemos incluido un pequeño temporizador después de realizar una operación que desactiva el botón de relé durante 4 segundos. Esta es una medida de seguridad ya que no queremos empezar a trastear con el aparato encendiendo y apagando rápidamente el botón de forma precipitada. Luego, con toda la lógica del botón completada, tratamos de hacer una conexión con un módulo bluetooth inmediatamente en la inicialización. Primero comprobamos si el bluetooth está ON en el smartphone, si no lo está entonces debemos pedir al usuario que lo apague creando una intent de tipo BluetoothAdapter.ACTION_REQUEST_ENABLE. Esto lanzará una ventana de diálogo para confirmar la activación del bluetooth. Luego establecemos un onActivityResult para recibir la confirmación del usuario así:@Override
Arduino bluetooth controller – all in one
– In three tutorials we are going to see how we can control a stroller with two stepless motors, from the mobile using Arduino and Bluetooth. – Arduino + Bluetooth + Motor controller + Motorcitos + App inventor.
(There are more updated IDE, you can have in your computer several versions of IDE, for now install IDE 1.0.6 that loads faster, at any time you can install other IDE more updated, but for now try with IDE 1.0.6)
The first thing is to connect our Bluetooth module to the Arduino. We must be very careful not to swap the power supply Vcc (+) and Gnd (-), if we make a mistake and connect it in the wrong place the module will break down immediately.
In the photo above I show how I have connected the Bluetooty module to the Arduino. The cable supplied has a female connection, the Arduino also has female connections, so I have used four intermediate colored wires to connect it.
It is important to follow a color code, red for positive, black for negative, this way we will be more careful when connecting the + and -, because if we change it, the module will break down. During the process of loading the program we will remove and put several times these cables, to be able to load the program to the Arduino, because if the BT power supply is connected, sometimes it does not load the program, so we remove the red power cable, load the program and put the red cable back.
Feedback
This module is used so that our Arduino and the cell phone can communicate via Bluetooth. For this application we can use any of the two modules because we will work in slave mode.
If you use a HC-06 it would be ready to use, if you use a HC-05 you must verify that it is configured as a slave. The speed we are going to work with is 9600baud, which is the default speed in both the HC-06 and the HC-05.
Among the most common H-bridge we have the L298N, L293D, TB6612FNG and L9110S , Some modules apart from the pins to control the direction have a pin (Enable) where we can send PWM and control the speed, but for this tutorial we can use any because we will only control direction.
The voltage will depend on the battery, for example if you have a 6V or 3.7V battery you can work with the yellow motor, if you have a 12V or 9V battery you can work with the micro motors. If we feed a motor with a lower voltage than nominal, its speed decreases, on the other hand if we feed with a higher voltage we can damage the motor, so we must take into account the technical specifications of the motor.