Go Down

Topic: Android Bluetooth joystick (Read 378733 times) previous topic - next topic

kas

Quote
The deadman works perfect, thanks :)
finally  ;)



Battery monitoring

Please make sure you understand what you are doing, both on the hard and software sides
You may google for  "voltage divider" "arduino"

solder the three 4.7K resistors in series
connect both ends to battery <+> and <->
connect analog input A0 as per drawing

                 4.7K         4.7K          4.7K
<+> ----/\/\/\---/\/\/\-|-/\/\/\---- <->
                                              |
                                            A0

Before actually connecting to Arduino board, check voltage with a DVM
should read 4 to 4.5 Volts (not 8 to 9V  :smiley-eek: )
I don't know your setup, if you have more than one power supply, make sure that grounds are connected

Upload and run AndroTest_Servo_fullspool V1.3
Battery level should be displayed with two decimal digits in DataField #1
Let me have a video including phone screen



odin25

hi... i am new .... i have 1 arduino uno ent 1 motor shield adafruit motor / stepper /servo shield... ent 1 adafruit servo shield...
   how to conect the shield adafruit whith rover 5  robot platform? sory for the bad english i am greek ent i don know veri good english... pliz foto how conect the shield whith rover  ent how conect the ultra sonic sensor whith arduino?


imail:
pantelis4ever1@hotmail.com

kas

Sorry odin25, I have no experience with those shields.
May be somebody will jump in for additional information
I suggest to raise the question on the Adafruit website

fullspool

finally  ;)



Battery monitoring

Please make sure you understand what you are doing, both on the hard and software sides
You may google for  "voltage divider" "arduino"

solder the three 4.7K resistors in series
connect both ends to battery <+> and <->
connect analog input A0 as per drawing

                 4.7K         4.7K          4.7K
<+> ----/\/\/\---/\/\/\-|-/\/\/\---- <->
                                              |
                                            A0

Before actually connecting to Arduino board, check voltage with a DVM
should read 4 to 4.5 Volts (not 8 to 9V  :smiley-eek: )
I don't know your setup, if you have more than one power supply, make sure that grounds are connected

Upload and run AndroTest_Servo_fullspool V1.3
Battery level should be displayed with two decimal digits in DataField #1
Let me have a video including phone screen



Thank you for the suggestions, I understand the hardware side no problem it's the software side that confuses me. :)

I built the circuit and at 11.7 Vin I get 3.8Vout , on full charge lipo I get 12.3 Vin and 4.1 Vout so we are with in range for a 3S Lipo battery. I will load the sketch and make a video tomorrow but in the mean time can you explain to me how it's working in the program? I don't understand the formula.

kas

Quote
but in the mean time can you explain to me how it's working in the program? I don't understand the formula.
for 0 Volt, analogRead(Vpin) value is 0
for 5 Volts,  analogRead(Vpin) value is 1024
If you measure a 0 to 5V voltage (no Voltage divider)

voltage = 5 * analogRead(Vpin)/1024



for 12V, Voltage divider divides value by 3   (4.7/9.4+4.7)
so we need to adjust back the value (multiply by 3) to obtain real voltage

voltage = analogRead(Vpin) * (5.0/1024) *3 = analogRead(Vpin) * 0.0146484375


Google will explain it in better English than I can do  ;)



fullspool

Thank you I will continue my research . :)

On a side note , I made a new video showing the real time voltage display. I will do further testing tonight and tomorrow but everything looks good so far .

Excuse the wiring mess .

 https://youtu.be/F8BKWDSwAM4


kas

Quote
https://youtu.be/F8BKWDSwAM4
Looks prefect  :)


Don't forget you can customize buttons and datafields captions in the option menu
You can also hide unsused buttons for a cleaner screen


What about using button #2 for
 - Normal: half speed
 - Turbo: full speed


Let me know when you receive the current sensor




fullspool

#592
Feb 15, 2016, 12:41 am Last Edit: Feb 15, 2016, 12:50 am by fullspool
That sounds like an excellent idea for button #2 ! I will adjust the app to remove buttons soon, Im spending more time reading then seeing what the app is capable of :)

Is the app open source ? I didnt see an apk posted anywhere. It would cool if we could adjust background graphics and move the data fields around.

Thank you for helping me kas, I am very grateful and have learned so much.

fullspool

This is very crude but something like this . I can make a better one in photoshop if needed . :)


kas

Quote
That sounds like an excellent idea for button #2 !
// V1.4  added Turbo function (Button #2)

fullspool, I sent you a PM


kas

#595
Feb 15, 2016, 07:00 pm Last Edit: Feb 15, 2016, 07:01 pm by kas
Quote
Is the app open source ?
Joystick BT Commander (free App) is the base of Total RC Commander (paid App)
The App is not open source for the moment


fullspool

Joystick BT Commander (free App) is the base of Total RC Commander (paid App)
The App is not open source for the moment


Please let me know when you make it open source as I'd love to learn from it .

I noticed when I power up the ardiuno board the AUX servo twitches 1 time . Do you know what causes this ?


kas

Quote
I noticed when I power up the arduino board the AUX servo twitches 1 time . Do you know what causes this ?
Most hobby servo's have this problem
Have a look here
Quote
Well it's not because of anything your are doing or not doing. Here is the problem, typical hobby servos are designed such that anytime they are powered up they need to be receiving a continuous and valid position control pulse. A servo that has DC power on but no position control pulse being received, is in a undefined state and no assumptions can or should be made as to what behavior the servo should exhibit while you either hold down reset switch. Once you send a valid servo.write command to the servo, the servo library code automatically keeps sending that same position output command at a standard servo update rate, around every 20ms ...
 If it important to try and eliminate this behavior then you need to think about about possible solutions. One possible method might be to have the power wired to your servo be controlled on and off by your sketch via an output pin controlling a relay which would then route power on or off to the servo. That way your servo can be set-up in software first and then turn on the digital output to switch power to the servo.
In setup, try moving myservoA.write(90); just below myservoA.attach(pinServo_A);
You may also drop myservoA.write(90);, but it may not be safe


fullspool

Most hobby servo's have this problem
Have a look here
In setup, try moving myservoA.write(90); just below myservoA.attach(pinServo_A);
You may also drop myservoA.write(90);, but it may not be safe


I tried moving the coding around and also deleting myservoA.write(90) , none of the options worked . :(
I also tried the turbo button but when I hit button 2 the rover just takes off by its self with no stick movement. Is this how you design the program? or should I be expecting something different? I am learning more and more everyday. I am glad there are people like you to help out us dreamers. :)

Thank you for the suggestions.

kas

#599
Feb 24, 2016, 08:11 pm Last Edit: Feb 24, 2016, 08:16 pm by kas
Quote
I tried moving the coding around and also deleting myservoA.write(90) , none of the options worked
no surprise, please remove modifications


Quote
I also tried the turbo button but when I hit button 2 the rover just takes off by its self with no stick movement. Is this how you design the program? or should I be expecting something different?
:o  :o  :o  (surprised)
No, rover shouldn't move when stick is 0.0
I double checked code, everything seems OK

Please check again on your side
also confirm that datafield #3 does display "Turbo <ON>" when pressing button #2
EDIT: also check ESC calibration (zero fine tuning)


Quote
I am glad there are people like you to help out us dreamers. :)
Thanks  8)



Go Up