Show Posts
Pages: 1 [2] 3 4 ... 71
16  Using Arduino / General Electronics / Re: Reading PWM signal from RC Receiver on: July 16, 2014, 04:45:31 pm
Maybe this will be of interest:

http://rcarduino.blogspot.ae/2012/01/how-to-read-rc-receiver-with.html

Could you show your sketch. When I use puseIn() on a single channel I get pretty precise results .
17  Using Arduino / Programming Questions / Re: runShellCommand on Arduino Yun on: July 15, 2014, 09:11:25 am
Try this, works for me

Code:
p.runShellCommand("lua /usr/bin/test.lua 2>&1");

This:
Code:
2>&1

redirects the error messages, so you can see it in serial monitor.

andaAs Mark says : use the Yun subforun
18  Using Arduino / Project Guidance / Re: mah fuel gauge on: July 10, 2014, 03:54:25 pm

I have been very pleased with my Taranis so far. I just bought it a couple of month ago.

I have a Futaba FF9, and a Spektrum DX7.

The Gimbals I think is as good as my old Futaba (I am not too critical so not the right person to ask  smiley-grin), but the switches are more like Spektrum, they got that cheap feel and sound.
I bought it because I wanted the telemetry. So far I have a vario sensor, and the voltage sensor is included in the receiver. I use it to monotor the battery voltage (remember I am a fix wing pilot).
It can be used to monitor receiver voltage instead, but that is not very interesting as I always use BEC.

Good luck with your sensor project.
19  Using Arduino / Project Guidance / Re: mah fuel gauge on: July 10, 2014, 03:14:12 pm
Hi maarset,

In my simple test sketch I do a reading every millisec. aprox.
The interval is not imporatnt in my sketch because I use the total time per loop to determin the time I have used the measured current.

So if I do 1000 readings in 1.23 seconds I can compute the average milliamp/sec used in that period.
I have converted the mAH to mA/seconds to make the calculations easyer (I think)

I can see your problem with your High Amp sensor, not very high resolution.

My radio is a FrSky Taranis, so I will go after a FrSky current sensor, and by the way, as far as I can see it is plug & play:
The current reading gets send back to my Taranis, and all calculation will be performed in the firmware.


Code:
long elapsed_time=0;
float total_mas=0;
float total_used;
unsigned long capacity=1800000; //0.5AH = 500*60*60 =1800000 milliAmpere/sec
int x;
unsigned long mas; //milliAmp/sec
int sensorValue;
long now_time;

void setup() {
  Serial.begin(9600);
  now_time=millis();
}

void loop() {
  mas=0;

  for(x=0;x<1000;x++){
    sensorValue = analogRead(A0);
    mas+=sensorValue;
    delay(1);
  }//for

  elapsed_time=millis()-now_time;
  total_mas=total_mas+((elapsed_time*39.74*mas/1000)/x);
  float total_pct=(100*total_mas)/capacity;

  Serial.print("mAs used ");
  Serial.println(total_mas);
  Serial.print("Capacity used ");
  Serial.println(total_pct,2);
  Serial.println("================");
  now_time=millis();
}

20  Using Arduino / Microcontrollers / Re: Programming an ATtiny85 w/ Arduino 1.0 on: July 03, 2014, 03:49:33 pm
I have no problem using the Nano as programmer.
I use the usual 10uF capacitor from reset to ground.
Maybe it is because I use Coding Badly's TinyISP, you could try that.
21  Using Arduino / Project Guidance / Re: mah fuel gauge on: July 03, 2014, 03:04:30 pm
Interesting project.
I have thought about something like that on and off for some time, so I thought I would give it ab try.

I don't fly heli only fixed wing, so I use the battery voltage as a guide, but why not a mah gauge

I did a test with a 500 mAH 2 cell LIPO, and the sketch below.

As a current sensor I used a homemade resistor of about 0.5 ohm, and a light bulb to simulate the motor

With the battery fully charged the current was 1.55A and gave a reading of 39, thats why I used the mystic number 39.74.

I stopped the experiment when the sketch showed 20% used, and then I charged the batery.
I could charge 94 mA so not totally off.
I am sure it can be improved, f.ex.

- Better calibrating
- Using Internal Aref
- A dedicated current sensor
22  Using Arduino / Microcontrollers / Re: HOW CAN I MAKE VOLTAGE TESTER WITHOUT USING ATMEL CHIP ??? on: July 01, 2014, 07:15:48 am
Maybe something like this:

http://www.hobbyking.com/hobbyking/store/__18588__Hobbyking_2_8S_Cell_Checker_with_Low_Voltage_Alarm.html
23  Community / Exhibition / Gallery / Re: Futaba SBUS reverse engineered to work with Arduino on: June 25, 2014, 04:24:53 am
@nique

I have used the library with a FrSky X8R.

It works very well, see the test sketch below for an example I use on a Mini Pro.
The only problem with that is that I can't get any debug output, so I used a 1284 board to test as it has two hardware serial ports.

Quote
FrSky works already inverted.

Yes, and therefor you need an inverter I have tried a 74hc14 or just a transistor with two resistors
Ans I use 3.3V on the Pro Mini to avoid logic level converter
Code:
// for using mini with one serial
// change SBUS.h line 12 for normal Arduino
// #define port Serial1 --for  Arduino with more than one Serial port
// #define port Serial --for normal Arduino with one Serial port

#include <FUTABA_SBUS.h>
#include <Servo.h>

FUTABA_SBUS sBus;
Servo myservo;

void setup(){
  sBus.begin();
  myservo.attach(14);
}

void loop(){
  sBus.FeedLine();
  if (sBus.toChannels == 1){
    sBus.UpdateServos();
    sBus.UpdateChannels();
    sBus.toChannels = 0;
    myservo.writeMicroseconds(sBus.channels[6]+800);
  }
}

24  Using Arduino / Microcontrollers / Re: ATTiny87 core? on: June 11, 2014, 09:04:19 am
Maybe you could use ATtiny861 .
It comes in DIP and is supported by Tom Carpenters core
25  Using Arduino / Microcontrollers / Re: PWM Controller on: June 11, 2014, 09:02:11 am
You could try this library for pwm freqence

http://forum.arduino.cc/index.php?topic=117425.0
26  Using Arduino / Microcontrollers / Re: ATTiny87 core? on: June 10, 2014, 03:01:39 pm
Take a look at this:

Quote
Currently the following processors are supported:

ATtiny84,44,24
ATtiny85,45,25
ATtiny861
ATtiny87/167
ATtiny2313

https://github.com/TCWORLD/ATTinyCore
27  Using Arduino / Microcontrollers / Re: Arduino IDE and ATTiny45 on: June 10, 2014, 01:36:16 pm
If you use this core for the tiny:

https://code.google.com/p/arduino-tiny/

You can choose between ARduino 1.xx and 1.5XX
28  Using Arduino / Microcontrollers / Re: ATTiny84 and software serial problems on: June 10, 2014, 01:33:36 pm
If you use the tiny core you mention, the output from TinyDebugSerial will be PA1 (physical pin 12)
on the ATtiny84.

If you connect that pin to your Arduino pin TX->1 (and put a wire from reset to ground on your Arduino)
you should see the output.
29  Using Arduino / Microcontrollers / Re: analog read on attiny13 on: March 20, 2014, 07:00:01 am
Which core are you using ?

If you are using  smeezekitty core, and you connect the potmeter wiper to pin PB4, you are using ADC2.

So this line

Code:
int potPin = 4;

should be

Code:
int potPin = 2;
30  Using Arduino / Microcontrollers / Re: Attiny85 voltage issie on: March 16, 2014, 10:47:33 am
What I would do when debugging a problem like this is to isolate the problem.
In this case I would make a sketch that only read the ADC pins to see if it was only pin PB3 that was acting strange.
(try PB2 and PB4 aswll)

Quote
Thanks! Is there an error in there though?

  // int reading = analogRead(PIN_TEMP);
  reading=5;
The code example was meant to test the pwm pins only, as I thought you had a problem with them.
Sorry for the confusion (in the future I will promise myself not to confuse people in here )
Pages: 1 [2] 3 4 ... 71