Show Posts
Pages: [1] 2 3 ... 746
1  Using Arduino / Project Guidance / Re: Help choosing the right board and peripherals to make a quad copter on: Today at 11:52:51 am
I would suggest looking at the various open source autopilot projects that are available on the internet. It's a complicated problem and solving it yourself from scratch would be an enormous challenge, but by adopting one of the open source projects and the hardware that it is based on, the hardest part has been done for you. Mind you, what's left will still be difficult, and I suggest you join the DIY drones forums for advice about doing that.
2  Using Arduino / Project Guidance / Re: Advice on Tower Stacking Game using 8x8 LED Matrix on: Today at 11:49:56 am
I'm not going to bother learning how to play the game just so I can advise you how to write it.

In general, I suggest you think about what data you need to represent the state of the game, how you generate the display from that data, and how you need to modify that data in response to user actions and game actions.
3  Using Arduino / Project Guidance / Re: Vision System Program Architecture - Fio V3 on: Today at 11:47:05 am
How does connecting them to a common node simplify the pulse generation?

It means that you only need to generate the 30KHz signal on a single pin, which makes the logic to do that simpler. Since you now only need to modulate a single pin, it also opens up the possibility of doing it entirely in hardware.
4  Using Arduino / Project Guidance / Re: Vision System Program Architecture - Fio V3 on: Today at 09:38:24 am
Until now I've been thinking of the project as needing to output the 30KHz pin on multiple pins (one pin at a time). It occurs to me that since you will only be using one at a time, you could connect one side of all the emitters to a common pin which you modulate  at 30KHz. You would enable or disable each emitter by connecting the other leg to a separate pin which was configured as an input to disable the emitter, or an output to enable it. That simplifies the requirements for the 30KHz pulse generation.
5  Using Arduino / Programming Questions / Re: Reading and generating square waves at the same time. on: Today at 08:29:31 am
Is the jitter caused on the input side or the output side? If it's an input problem, obviously you'd be wasting your time trying to improve the output mechanism.
6  Using Arduino / Programming Questions / Re: multi analog data from 1 arduino to another arduino on: Today at 08:27:07 am
Serial.write() lets you send a byte stream. You can put any data you like on that byte stream - just be aware that the receiver will need to do the same thing in reverse to extract the data from the incoming byte stream so you should choose an encoding scheme that makes this easy for the receiver.
7  Using Arduino / Project Guidance / Re: Quadcopter build on: Today at 08:23:40 am
I am also seeking advise for propellers and battery sizes. Also information on calculating thrust would be nice

I suggest you ask these questions on one of the many forums that specialise in DIY drones.
8  Using Arduino / Project Guidance / Re: A network of Arduinos reporting to a central device or computer? on: Today at 08:20:01 am
TCPIP is already established to the remote sites. Public internet is not needed, and is not an option for security reasons, that was the purpose of establishing private FCC-licensed IP links. The remote sites are subnetted as part of the LAN. Latency is usually less than 10ms. In fact it's fast enough that we use it for streaming audio and VOIP for phones at some sites, with nearly undetectable codec delay.

That's ideal. In that case I would just use an Ethernet-capable Arduino at each remote site and use a TCP/IP client/server architecture for the comms. In the simplest case each remote would acquire the data and make one attempt to transmit it to the central collector, and the collector would just store whatever it received with no resilience, authentication, encryption or access controls. If that's sufficient, the implementation would be straight forward.
9  Using Arduino / Project Guidance / Re: Automatic plant watering system on: Today at 08:13:33 am
I am unsure on what kind of pump should I be using for this project

It needs to provide the water flow rate and pressure tat you want, and there must be a compatible driver circuit that you can use to drive it. If you're talking about watering individual small plants then you don't need much flow or pressure and you can probably get away with a small DC micro pump. These are available running off anything between 3V-12V and only take a couple of hundred mA which makes them convenient to drive using an L293 or L298 based driver circuit. That could be a motor driver shield on a standard Arduino, or a clone such as the Baby Orangutan with the motor driver integrated. If you run it from a 7-12V supply, you can probably use the same supply to power the Arduino.
10  Using Arduino / Programming Questions / Re: How do I move a sequence through an array? on: April 18, 2014, 09:56:38 pm
Or I could just make them like this.

No, that isn't a good approach. The length and the highest index are different things, and trying to pretend they are the same is a bad idea. Just stick to the length being the number of elements and using an inequality for the upper bound in the for loop and it works fine.
11  Using Arduino / Programming Questions / Re: getting else without previous if error on: April 18, 2014, 09:53:19 pm
Everything after 'else' is probably spurious:

else ((value = 0) && (value >= 251));
12  Using Arduino / Programming Questions / Re: data transmission nrf24l01 + need help! on: April 18, 2014, 09:12:17 pm
Your sending sketch doesn't receive any radio messages so it is not necessary to start and stop listening.

Your serial port handling code looks wrong. I haven't look at the message format you're trying to use but it looks as if you expect to receive multiple bytes from the serial port and that there will always be a complete message available. That isn't right - the message will come in slowly one byte at a time and if you want to process a complete message you will have to buffer the bytes as they arrive and work out when you have received a complete message.

On the receiving side you only process the first byte in the payload although there may be up to 32 bytes of useful data there.

For the purpose of testing the radio part, I suggest you disable all the serial port handling and just send a fixed hardcoded message and confirm it is received OK. Then you can check how fast and how reliable that is before you design the rest of your solution around it. Depending how fast you receive input on the serial port, you could easily find that the RF24 can't keep up when it is transmitting a message per byte.

The code to work out what number you have received is very repetitive and you could avoid the repetition by converting the character to a number and doing a range check on it.

  byte value = data[0] - '0';
  if(value == 0)
    digitalWrite(pins[value-1], HIGH);
  // unexpected character ignored

If I were you I would connect the receiver to a PC and use the serial port to tell you what it is doing. (Even if there won't be a PC available in the final system, use one for testing.) In that case you must avoid using digital pin 1 in your sketch since the hardware serial port uses it.
13  Using Arduino / Programming Questions / Re: Reading and generating square waves at the same time. on: April 18, 2014, 08:50:47 pm
I'm not familiar with that FreqPeriodCounter library, so I don't know whether you're using it correctly. Is it actually producing an accurate and consistent measurement? Is the FreqPeriodCounter object designed to be used in an interrupt context? I'd expect it to need some care to deal with volatile data and disabling interrupts around access to them. If it doesn't do that correctly, you can end up with spurious behaviour. If you get garbage in, nothing else is going to work.

Since the loop() function looks pretty fast, you could probably just poll the input pin state and from the name I guess that the poll() method was designed to do that. That's a hint it might not be designed to be used in an interrupt context.

There is no need to make period volatile since it is never accessed in an interrupt context.

There's a minor bug in your output timing code which could cause the output to slip slightly - I don't think this is causing your problem but I suggest you correct it anyway by changing line 32 to:

   previoustime += interval;
14  Using Arduino / Project Guidance / Re: Vision System Program Architecture - Fio V3 on: April 18, 2014, 08:37:30 pm
Fundamentally I struggle with how to emit a 30KHz pulse while at the same time scanning for it?

Have you got an IR receiver which will detect the 30KHz signal for you and tell you whether it's present? This isn't something you really want to do for yourself.
15  Using Arduino / Project Guidance / Re: Log FuelFlow -Reading 4 frequency inputs (digital on/off) and logging to SD card on: April 18, 2014, 01:24:19 pm
In this new version I changed the pgenPreviousMicros to static unsigned long as you suggested, but to no effect, apparently. pgen is still not working.

I don't see that change in the version you attached.

The basic use of nowMicros in pulseMeasure() looks OK, but I think there is a problem due to the fact you're using it in a FOR loop. It would probably work by mistake. I would expect it to detect (nowMicros - previousMicros > 1000000) is true for the first element in the loop, write the entry to the log and then update previousMicros so that the condition is no longer true for the subsequent loop iterations. The SD output shouldn't be inside the FOR loop, should it?

unsigned long nowMicros = micros();
for (int i = 0; i < qty; i++)
    digital read, change detection, pulse length calculation, flow rate calculation, update cumulative total
if (nowMicros - previousMicros > 1000000UL)
    previousMicros += 1000000UL;
    write stats to SD
Pages: [1] 2 3 ... 746