Show Posts
Pages: [1] 2 3 ... 71
1  Using Arduino / General Electronics / Re: -First build- Am I Buying the right stuff? on: July 22, 2014, 03:03:23 pm
A danish dealer selling pro mini for dkk 60,-

http://softgenie.dk/produkter/40-arduino-pro-mini-atmega328.html

But I agree with  Jiggy-Ninja - it's a lot more fun and satisfaction to build your own

2  Using Arduino / Interfacing w/ Software on the Computer / Re: Transmiting PPM with Firmata to exmpl HK-T6A 2.4ghz trainer input ? on: July 22, 2014, 02:34:13 pm
Quote
thanx for helping me out ,

You are wlcome.

3  Using Arduino / Interfacing w/ Software on the Computer / Re: Transmiting PPM with Firmata to exmpl HK-T6A 2.4ghz trainer input ? on: July 22, 2014, 08:35:27 am
You could send the numbers with delimiters, and start and stop marker.
Nick Gammon has made a great writeup here:

http://www.gammon.com.au/forum/?id=11425
4  Using Arduino / Interfacing w/ Software on the Computer / Re: Transmiting PPM with Firmata to exmpl HK-T6A 2.4ghz trainer input ? on: July 21, 2014, 03:53:40 pm
This might help:

http://www.rcgroups.com/forums/showthread.php?t=2037080
5  Using Arduino / Microcontrollers / Re: Help with using a 433mhz tx and attiny85 on: July 21, 2014, 12:53:46 pm
Take a look at the Manchester library

http://mchr3k.github.io/arduino-libs-manchester/
6  Using Arduino / General Electronics / Re: Reading PWM signal from RC Receiver on: July 18, 2014, 03:14:54 am
Did you try DuaneB's sketch?

It gives a more stable reading:


Code:
// First Example in a series of posts illustrating reading an RC Receiver with
// micro controller interrupts.
//
// Subsequent posts will provide enhancements required for real world operation
// in high speed applications with multiple inputs.
//
// http://rcarduino.blogspot.com/
//
// Posts in the series will be titled - How To Read an RC Receiver With A Microcontroller

// See also http://rcarduino.blogspot.co.uk/2012/04/how-to-read-multiple-rc-channels-draft.html 

#define THROTTLE_SIGNAL_IN 0 // INTERRUPT 0 = DIGITAL PIN 2 - use the interrupt number in attachInterrupt
#define THROTTLE_SIGNAL_IN_PIN 2 // INTERRUPT 0 = DIGITAL PIN 2 - use the PIN number in digitalRead

#define NEUTRAL_THROTTLE 1500 // this is the duration in microseconds of neutral throttle on an electric RC Car

volatile int nThrottleIn = NEUTRAL_THROTTLE; // volatile, we set this in the Interrupt and read it in loop so it must be declared volatile
volatile unsigned long ulStartPeriod = 0; // set in the interrupt
volatile boolean bNewThrottleSignal = false; // set in the interrupt and read in the loop
// we could use nThrottleIn = 0 in loop instead of a separate variable, but using bNewThrottleSignal to indicate we have a new signal
// is clearer for this first example

void setup()
{
  // tell the Arduino we want the function calcInput to be called whenever INT0 (digital pin 2) changes from HIGH to LOW or LOW to HIGH
  // catching these changes will allow us to calculate how long the input pulse is
  attachInterrupt(THROTTLE_SIGNAL_IN,calcInput,CHANGE);

  Serial.begin(9600);
}

void loop()
{
 // if a new throttle signal has been measured, lets print the value to serial, if not our code could carry on with some other processing
 if(bNewThrottleSignal)
 {

   Serial.println(nThrottleIn); 

   // set this back to false when we have finished
   // with nThrottleIn, while true, calcInput will not update
   // nThrottleIn
   bNewThrottleSignal = false;
 }

 // other processing ...
}

void calcInput()
{
  // if the pin is high, its the start of an interrupt
  if(digitalRead(THROTTLE_SIGNAL_IN_PIN) == HIGH)
  {
    // get the time using micros - when our code gets really busy this will become inaccurate, but for the current application its
    // easy to understand and works very well
    ulStartPeriod = micros();
  }
  else
  {
    // if the pin is low, its the falling edge of the pulse so now we can calculate the pulse duration by subtracting the
    // start time ulStartPeriod from the current time returned by micros()
    if(ulStartPeriod && (bNewThrottleSignal == false))
    {
      nThrottleIn = (int)(micros() - ulStartPeriod);
      ulStartPeriod = 0;

      // tell loop we have a new signal on the throttle channel
      // we will not update nThrottleIn until loop sets
      // bNewThrottleSignal back to false
      bNewThrottleSignal = true;
    }
  }
}
7  Using Arduino / General Electronics / Re: Reading PWM signal from RC Receiver on: July 17, 2014, 12:30:42 pm
Update

If I use DuaneB interrupt method from the link in previous post, the measurement is almost spot on.

I get 1500 microseconds for neutral and a few 1504.
8  Using Arduino / General Electronics / Re: Reading PWM signal from RC Receiver on: July 17, 2014, 12:15:34 pm
I had never thought about that, so i tried:

- Analog solution: Futaba 35MHz ppm tx and rx
- Digital solution:  FrSky Taranis -> X8R 2.4 GHz

But the variation was much the same: 7 microseconds.
I used pulseIn()
9  Using Arduino / General Electronics / Re: Reading PWM signal from RC Receiver on: July 17, 2014, 08:31:01 am
I would suggest you start with a simple example like the one on the reference page:

http://arduino.cc/en/Reference/PulseIn
10  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 .
11  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
12  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.
13  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();
}

14  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.
15  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
Pages: [1] 2 3 ... 71