Show Posts
Pages: 1 [2] 3 4 ... 44
16  Using Arduino / General Electronics / Re: running traces under the crystal on: June 17, 2014, 09:57:02 pm
Quote
4.6 PCB layout
Finally, the importance of the physical location of the resonator in relation to the AVR should be stressed. Always place the resonator as close to the AVR as possible and shield the resonator by surrounding it with a ground plane.
...I found this in that pdf you mentioned.  Thanks, that's a nice little PDF file.  It's not quite as intimidating as the data sheet on the ATmega328P!
17  Using Arduino / General Electronics / running traces under the crystal on: June 17, 2014, 09:38:59 pm
Does it hurt to run a trace under my SMD crystal, for my Atmega328P-AU?  See the photo, the trace that is highlighted is the reset signal that the FTDI header uses to program the Arduino.
Thanks
18  Using Arduino / General Electronics / Re: Interference of 2 Bluetooth Modules, top and bottom of PCB on: June 17, 2014, 07:32:11 pm
Thanks, good to know.  I don't have 2 yet, so I couldn't test it out, but I figured it'd work okay.
19  Using Arduino / General Electronics / Interference of 2 Bluetooth Modules, top and bottom of PCB on: June 15, 2014, 08:36:28 pm
If I have 2 bluetooth mates that SPARKFUN sells, one on the top of my custom PCB, the other on the bottom side, so that their chip antennas are located opposite one another, will they still function fairly well?  I only need about 15 feet of distance from both of them.

https://www.sparkfun.com/products/12576
20  Using Arduino / Motors, Mechanics, and Power / Adding PID to my Segway on: April 04, 2014, 11:41:04 am
this 20 second video clip shows my trouble:
My segway code uses an IMU (the MPU-6050) and comes up with the angle of the platform.  It then just maps the angle from about plus or minus 20 degrees to plus or minus 0-100 percent motor speed.  It works well with a rider, but when it's empty it is way to sensitive.  I don't have any kind of PID control, but the PID library looks very hopeful!
    Right now, I only use the IMU to figure out the angle, and that's it.  But I think I also need to use the raw gyro reading as the key number in the PID.  If the gyro reading is very high (or very low for the backward movement), than I could use it to tell the PID not to react as fast/severe.  Does this sound good?  I see the PID library has the setTunings() function to change the 3 values as it's running.  Kp, Ki, & Kd.  I'm not sure which of these I need work my gyro reading into:
Quote
Kp: Determines how aggressively the PID reacts to the current amount of error (Proportional) (double >=0)
Ki: Determines how aggressively the PID reacts to error over time (Integral) (double>=0)
Kd: Determines how aggressively the PID reacts to the change in error (Derivative) (double>=0)

Does anyone have any help on this.  I've search quite extensively on the web, but haven't come up with anything.
thanks.
21  Using Arduino / Motors, Mechanics, and Power / Fly back diode for small relay on: March 29, 2014, 09:42:33 pm
I have this tiny SMD relay:
http://www.digikey.com/product-detail/en/IM03DGR/PB1172CT-ND/1828462


Would this diode work well to put across the coil for the fly back voltage?
http://www.digikey.com/product-detail/en/BAT54KFILM/497-5561-1-ND/1207053

I've been using a much larger SMD one, it's more like the typical  1N4001, but if I could find one in a smaller package that'd be great. This one I found it a schottky, which I've read is good for fly back voltage?
Thanks.
22  Using Arduino / Motors, Mechanics, and Power / Re: Motor fly back or something else? on: March 28, 2014, 02:24:49 pm
The 47uF cap for the 2N3904 transistors -- does it just go from 5V to Gnd, near the 2N3904?
23  Using Arduino / Motors, Mechanics, and Power / Re: Motor fly back or something else? on: March 27, 2014, 12:16:49 am
Add something like 47uF electrolytic decoupling close to the relay switching transistors -
the current pulses from turning on/off the relays is probably triggering reset.  The
ATmega should have 0.1uF caps on each supply pin, not just one of them.

Any wiring connected to the reset pin needs to be routed away from all the high-current
paths to the relays and motors, or perhaps change the 10k pull-up on it to 1k.

I just discovered I don't even have pin 6 (Vcc) of the Atmega328P-AU connected to anything! That could be causing a problem?  Pins 4 & 6 are Vcc, pins 3 & 5 are GND.  One cap in there would be as close to one Vcc as the other, but maybe that's what you meant-that you saw I didn't even have the one pin connected?  What about pins 18 & 21? They are AVcc & AGnd.  I have them tied to Vcc & Gnd, respectively.  Should I add a 0.1uF cap by them?

The 47uF cap for the 2N3904 transistors --I'm not sure where to put them.  Check out my picture, They are C7 & C8.  I'm guessing C7 is the right way to do it, but I don't understand transistors well enough to visualize how they work.
24  Using Arduino / Motors, Mechanics, and Power / Re: Motor fly back or something else? on: March 25, 2014, 09:41:02 pm
https://www.dropbox.com/s/m3ykh9c3pykipqj/Version%204.0.pdf
Here a PDF file of my schematic.   I can't seem to get a photo uploaded tonight.
25  Using Arduino / Motors, Mechanics, and Power / Re: Motor fly back or something else? on: March 25, 2014, 08:19:32 pm
Sorry about the poor photo. I'll upload a better one when I get home. The grounds are connected because they are the same. I have two 3 D cell battery packs wired in series. 4.5 + 4.5 volts. The Arduino is powered off one, the motor off both for 9 volts.   I wouldn't put a diode across the terminals, but rather 4 of them, 2 tying each motor terminal to gnd and 9 volts, to take care of fly back voltage, but I'm not sure that's the problem. Fly back should be affecting the 4.5 volt should it? It seems more like when the motor starts it drops the voltage for a split second. I didn't put any polarized caps in the system like I do when using a voltage regulator, I thought battery voltage would be constant, but I wonder if it's dropping out sometime when the little motor starts.
26  Using Arduino / Motors, Mechanics, and Power / Motor fly back or something else? on: March 25, 2014, 05:41:38 pm
My Atmega controls my motor via 2 double throw relays, to give me forward and reverse. The whole thing is battery powered, no voltage regulators.  (6) C batteries. The atmega runs on 4.5 volt, the motor on 9 volt. When the motor cuts on and off sometimes it resets my Atmega. I have a fly back diode on the relays' coil, but that is all. Do I need it on the motor, too?  I put a 0.1 uF cap across the motor terminals like someone suggests to help noise, and now my Atmega resets every time the motor turns on. I put a 1000uF cap across gnd and 9 volts, and that fixed my issue.  I'm just wondering if that's the appropriate fix?  Would the motor diodes fix this problem, or would I still need a large cap in the picture?
27  Using Arduino / General Electronics / Re: DS3234; Deactivating an alarm on: March 21, 2014, 09:35:19 am
Thanks!  I see how that works again.  I've tried wrapping my brain around it but it doesn't stick.  After rereading the arduino reference page on bitwise, I see that you are just adding the binary digits together.  I couldn't figure out how it knew what those things were, like DS3234_INTCN, and  DS3234_A2IE , but I found in the library's .h file that their defined, as 1, 2 4, etc, representing binary numbers.  So just putting in the INTCN will 'take out' the alarm values.  Kinda neat when you understand it!  Thanks again.
28  Using Arduino / General Electronics / DS3234; Deactivating an alarm on: March 20, 2014, 11:59:05 pm

I'm using the library for the DS3234 found here:https://github.com/rodan/ds3234

I've got alarms to work, but now I need to deactivate one.  This line is what activates, but I don't understand bits and stuff enough to figure out how to turn off Alarm 1.
Code:
// activate Alarm1
    DS3234_set_creg(cs, DS3234_INTCN | DS3234_A1IE);
Quote
Bit 1: Alarm 2 Interrupt Enable (A2IE). When set to logic 1, this bit permits the alarm 2 flag (A2F) bit in the status register to assert INT/SQW (when INTCN = 1). When the A2IE bit is set to logic 0 or INTCN is set to logic 0, the A2F bit does not initiate an interrupt signal. The A2IE bit is disabled (logic 0) when power is first applied.
Bit 0: Alarm 1 Interrupt Enable (A1IE). When set to logic 1, this bit permits the alarm 1 flag (A1F) bit in the status register to assert INT/SQW (when INTCN = 1). When the A1IE bit is set to logic 0 or INTCN is set to logic 0, the A1F bit does not initiate the INT/SQW sig- nal. The A1IE bit is disabled (logic 0) when power is first applied.
taken from the data sheet:
https://www.sparkfun.com/datasheets/BreakoutBoards/DS3234.pdf

When I activate alarm 1, I need to deactivate alarm 2, because it could fire off prematurely.  And vise versa--when I activate alarm 2, I need to deactivate alarm 1.  I know it must be simpleā€¦
thanks
29  Using Arduino / Microcontrollers / Re: Using a cheap USBasp with a TQFP programmer on: March 13, 2014, 05:20:01 pm
Sorry, I've only ever used the Arduino IDE to load sketches or burn bootloader to Atmega chips. I guess avrdude is a program?  It sounds like it might just be easier to use jumpers from my UNO's pins to my TFQP adapter when I want to program the Atmega328P -AU chips.
I thought this usbasp. Thing would just show up as a serial port that I'd select when I want to burn a bootloader.
30  Using Arduino / Microcontrollers / Using a cheap USBasp with a TQFP programmer on: March 13, 2014, 10:33:04 am
I got this TQFP32 programmer and have used it to boatload ATmega328P-AU chips by connecting the pinout to the appropriate pins on my UNO, and using my UNO as the ISP.  Since these USBasp's from china were so cheap, I thought I'd try one.  I just figured I could plug my TQFP adapter into it and viola!  But maybe not.  Is there a trick to using these on a macbook 10.7, or is it more trouble than it's worth?
See the photo of what I have, and also a couple links of the items:
http://www.ebay.com/itm/171201827956?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

https://www.hobbyking.com/hobbyking/store/__27195__Atmel_Atmega_Socket_Firmware_Flashing_Tool.html

Pages: 1 [2] 3 4 ... 44