Show Posts
Pages: 1 [2] 3 4 ... 287
16  Using Arduino / Networking, Protocols, and Devices / Re: Problem in Xbee Communication on: August 12, 2014, 10:38:45 am
Here is a demo I recently did, it uses a potentiometer attached to one Arduino to control a servo on another Arduino. It uses XBee ZB (S2) modules, but in API mode.
17  Using Arduino / General Electronics / Re: Wiring Arduino Micro with Xbee Radio on: August 12, 2014, 07:54:53 am
AVR HW serial idle; RX is INPUT and TX is HIGH
AVR SW serial idle; RX is PULLUP and TX is HIGH

Yeah I found that too, software serial got me to wondering. I don't use it much, haven't had a problem with it, but I've never used it with XBees (I use API mode and that just sounds like a bad combination). Not sure why SWS wouldn't mimic HWS in that regard though.

Quote
I wonder if a PNP transistor with the XBEE and a resistor to the grid switching the PULLUP to ground or not.....?  
Would be cheaper and a bit more static resistant.

PNP should work, meh.

Quote
Quote
7407s are old school, I'd bet it's hard to even find one. Use 74HC4050, 74HC125, etc.

How much current can I safely level with those? It looks like 10mA or less.
For signal, fine I guess but I won't be powering an SD on that. Maybe the choice there is a divider.

The IC is a much better choice. It's fine for the SD signals, everything is CMOS so very low current. Not used for the supply voltage of course.
18  Using Arduino / General Electronics / Re: Wiring Arduino Micro with Xbee Radio on: August 11, 2014, 08:52:56 pm
Oh my LULZ! I went back to make sure and this is The Thread where I first saw the diode trick!
See reply #3.

Yes? Is there a question here?

Quote
Question to me is can calling the constructor with inverse_logic as 1 work or would that mess up TX?
I am definitely going to buy a couple dozen 2N7000's and a dozen SN7407's (and some more resistors).

Neither turning the pullup off nor inverting the logic will fix the overvoltage situation. Inverting the logic will definitely mess up communication unless the XBee can also be inverted (I haven't checked), or an inverter is placed in the line.

Quote
The 7407's look like just the thing for leveling hand-rolled SD adapters... there are 6 lines needing leveled, IIRC.

7407s are old school, I'd bet it's hard to even find one. Use 74HC4050, 74HC125, etc.
19  Using Arduino / General Electronics / Re: Edging your DIY PCBs on: August 11, 2014, 07:37:00 pm
Don't breathe this!
20  Using Arduino / General Electronics / Re: Op Amp Hilarity on: August 11, 2014, 07:35:33 pm
And then there is (or rather, was)

21  Using Arduino / Project Guidance / Re: reading 1000ths of a seconds from a pcf8583 rtc on: August 11, 2014, 05:18:49 pm
you have lost me am reading about prescaler but all double dutch will need to improve my knowledge further.

Timers are pretty neat, and even fairly straightforward once you get them figured out a bit.

There's a tutorial here that really helped me get started:
http://www.fourwalledcubicle.com/AVRArticles.php

And of course Nick Gammon's site:
http://www.gammon.com.au/forum/?id=11504
22  Using Arduino / Project Guidance / Re: reading 1000ths of a seconds from a pcf8583 rtc on: August 11, 2014, 04:53:38 pm
so am I right in thinking the best timing a arduino can do is 4 microseconds then.

Given a 16MHz system clock (Uno, et al.), one clock cycle is then 62.5 ns. The internal hardware timers can be configured to count at this rate. Of course there are tradeoffs (e.g. the counter will overflow rather quickly, being only 8 or 16 bits). The input capture unit can be a nice approach in many applications. Basically an external signal causes the current timer count to be captured in another register, and this event can trigger an interrupt, etc.
23  Using Arduino / Project Guidance / Re: reading 1000ths of a seconds from a pcf8583 rtc on: August 11, 2014, 03:57:42 pm
this is the code I am using it flops over at 60000000micro's later but it flops at 60000004micro's later??

can anyone explain it?

Sure can, read this, third sentence:
http://arduino.cc/en/Reference/Micros

PS: Also note that micros() returns an unsigned long, so variables like starttime, timeout, exittime should also be unsigned long.
24  Using Arduino / Motors, Mechanics, and Power / Re: Wiring Arduino Micro with Xbee Radio on: August 11, 2014, 03:48:35 pm
Hello,
I will like to know if there is a way to lift a person with arduino. If there is which arduino & which motor should I use? Would I need a battery? What RPM will I need to reach?

Thanks,
David

Hi David,

You should probably create a new post, and probably in a different forum section. As a reply in this thread, it is way off-topic. First, please have a look at this for some tips. Take special note that a post should not be made in more than one section of the forum.

I'm sure that what you want to do is possible, but your inquiry is too broad to say much more so I might either narrow it down, or explain more about what exactly it is you are trying to do. For example, probably pretty much any RPM will work, depending on how much of a hurry you are in and what gear reduction is available.

Welcome to the forum.
25  Using Arduino / General Electronics / Re: Wiring Arduino Micro with Xbee Radio on: August 11, 2014, 01:40:34 pm
Smart thing is to add (a) function(s) to the library that doesn't turn the pullup on then and use that?

The pin will still be at 5V when driven high by comms. I'd go with the MOSFET if it were me.
26  Using Arduino / General Electronics / Re: Wiring Arduino Micro with Xbee Radio on: August 11, 2014, 01:13:30 pm
My thinking is that AVR INPUT_PULLUP current is through 20k-50k ohms, the 3.3V device should be able to take that below 1V without much problem. Maybe the .7V drop through the diode helps?

That's what my gut tells me too, but not so. It's about the voltage when the pin is high, not current when it's low. They're slicing things so thin these days (in a figurative sense, there's no slicing going on, but the transistor structures are extremely thin) that 5V can cause a breakdown when 3.3V won't. Electric field strengths (measured in volts/meter) can get pretty impressive when the size of the structure is measured in nanometers.
27  Using Arduino / General Electronics / Re: Wiring Arduino Micro with Xbee Radio on: August 11, 2014, 10:15:31 am
Can't use a diode like on the MCU-to-XBee line, because the XBee will still have to pull down the 5V. I'd go with a MOSFET level shifter like this.
28  Using Arduino / General Electronics / Re: Wiring Arduino Micro with Xbee Radio on: August 11, 2014, 08:52:01 am
Well it looks like SoftwareSerial enables the pullup resistor on the RX line:
https://github.com/arduino/Arduino/blob/master/libraries/SoftwareSerial/SoftwareSerial.cpp#L368
29  Using Arduino / General Electronics / Re: Wiring Arduino Micro with Xbee Radio on: August 11, 2014, 06:29:59 am
3) I can send data from Arduino to Xbee#2 connected to laptop. The voltage at pin DOUT (pin 2) of Xbee#1 (connected to Arduino) is around 4.8V. Is it ok?

Not OK. XBee is a 3.3V device and is not 5V tolerant. How is it being powered? Not sure how the DOUT pin could be that high if it's connected to an input pin on the Arduino unless the XBee is being powered by more than 3.3V.
30  Using Arduino / Programming Questions / Re: Timer 2 - Clear counter without adding delay to the count on: August 10, 2014, 03:35:53 pm
This generally means measuring the period between two consecutive pulses. For example at 1Hz I have a 1Hz refresh rate, but as the frequency increases so does my refresh rate. Technically speaking anything with less than 10 samples a second is useless and I aim at having about 100 samples per second.

Understood, but "generally" is a bit fuzzy. With a 1Hz input, we can't do 10 samples/second. At lower frequencies, I assume it must be OK to just do the best we can, i.e. time one cycle. At the other end of the spec (2048Hz) timing one cycle will generate a lot more than 100 samples/sec. So there's another requirement here for the sampling frequency, has that been codified? If 100 SPS is OK at 2048Hz, the code could sample 20 cycles of the input. Or it could sample one cycle, report that, and skip 19 cycles. Maybe the sampling interval is always 100ms except at input frequencies below 100Hz, then it's one cycle. So a hybrid approach. Sounds now like this is not a frequency counter at all, i.e. it doesn't count cycles, but it measures the period and reports the inverse (frequency). Still looks like a frequency counter on the outside but the measurement technique is different.

I'm not writing code yet, still trying to understand the requirements smiley-wink
Pages: 1 [2] 3 4 ... 287