Show Posts
Pages: [1] 2 3 ... 5
1  Using Arduino / General Electronics / Re: connected the wires wrong power pins on: February 09, 2014, 05:45:27 pm
Is your objective to power your Arduino using a 9 volt battery?  

A way to safely power your Arduino with a 9 volt battery would be use use a 9 volt battery snap that plugs into the barrel connector of your Arduino.
http://www.ebay.com/itm/2pcs-90-DC-9V-Battery-button-power-plug-for-Arduino-Mega-2560-1280-UNO-R3-132-/171065364307

On a side note, you should have a resistor in series with your LED.
Tool for calculating resistor for LEDs:
http://led.linear1.org/1led.wiz
2  Using Arduino / General Electronics / Re: questions about using ULN2803A darlington array on: February 09, 2014, 02:42:42 pm
Thanks.
3  Using Arduino / General Electronics / questions about using ULN2803A darlington array on: February 09, 2014, 10:47:16 am
From schematics that people have posted online for using the ULN2803A, power should be supplied the pin labeled "COM".  If an external power supply is used to power the loads, should that power supply be used to supply the "COM" pin?

From what I have seen online, it seems that there is no need to calculate the current that needs to be supplied to the base pin as one would normally do when using  individual bipolar transistors (noticed that there is an internal resistor connected to the base in the datasheet schematic.)

http://www.ti.com/lit/ds/symlink/uln2803a.pdf
4  Using Arduino / General Electronics / Re: LTC1605 obtaining accurate voltage value on: October 22, 2013, 03:41:00 pm
Where do you take into account the sign of the converted voltage (D15)?
This converter is designed for +/- 10V input, so for 10V input, you would expect to read 32767 and for 5V, 16383.
I didn't take into account the sign of the converted voltage as I don't have any negative voltages in my application(should have just took the part of reading D15 out of my sketch) .  Thanks for the answer.
5  Using Arduino / General Electronics / LTC1605 obtaining accurate voltage value on: October 22, 2013, 09:30:47 am
I've been playing with the LTC1605 and a mcp9701 temperature sensor with my 2560 mega (just ordered the MCP3208, way less pins to deal with.) In order to get an accurate voltage value, I have to use 5.0*adcvalue/16384 to get an accurate voltage value.  From the datasheet the data is two's complement, so the MSP is used to tell if the number is negative or not so the number of possibilities should be 2^15, but for some reason I have to base my calculation on 2^14 to get an accurate voltage value. What am I doing wrong?  This is my first time with working with an external ADC.

Datasheet:
http://cds.linear.com/docs/en/datasheet/1605fc.pdf

Pin 22 is connected to D15
Pin 37 is connected to D0
The BYTE pin is held LOW
Code:
float adc;

int cs=51; //pin number connected to the CS pin
int rc=52; //pin number connected to the RC pin
//temp to voltage
//volts per step = 5/16384

void setup() {
Serial.begin(9600);
pinMode(cs,OUTPUT);
pinMode(rc,OUTPUT);
digitalWrite(cs,HIGH);
digitalWrite(rc,HIGH);
}
void loop() {
  // put your main code here, to run repeatedly:
  adc=0;
  inital();
  readdata();
  Serial.println(adc);
  temps();
  delay(3000);
}



void inital(){
digitalWrite(cs,LOW);
digitalWrite(rc,LOW);

//delayMicroseconds(1);
//
digitalWrite(rc,HIGH);
digitalWrite(cs,HIGH);  
}

void readdata(){

 int count=22;
 float  val2=65536;
 while((count)<=37){
   val2=val2/2;
  if (digitalRead(count)==HIGH){
   adc=adc+val2;
   }
   count++;
 }
}
 void temps(){
  float temp=5.0*adc/16384;
 temp= (temp-.5)/.010;
 temp = 9/5.0*temp + 32.0;
 Serial.println(temp);
 }
6  Using Arduino / Motors, Mechanics, and Power / Re: Using PWM with the L293D to get around issue posed by minimum supply voltage on: October 20, 2013, 08:20:37 pm
http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/CD00000059.pdf

On an older thread somebody mentioned a total of 2.6 volts drop, not sure what it would be listed as if they added the drop.
7  Using Arduino / Microcontrollers / Re: Bootloading error on: October 19, 2013, 09:31:32 pm
Take a look at this thread:
http://forum.arduino.cc//index.php?topic=129459.0
8  Using Arduino / Microcontrollers / Re: problems with burning bootloader on: October 19, 2013, 04:07:42 pm
I'm glad that worked. The sketch works as written however you probably did not have the serial monitor set to send a newline. So when you pressed <enter> it just send LOW (without a line terminator). Next time, set up the monitor to send newlines when you hit Send and the original sketch will work. After all, LOW, and HIGH have different letter counts, and it would be tedious to have to recompile every time just for that.
Ah, thanks. I just checked, and I didn't have it set to send a newline.
9  Using Arduino / Microcontrollers / Re: problems with burning bootloader on: October 19, 2013, 09:08:42 am
After making the fuse value change I tried the to upload the bootloader and was successful. Thanks!
10  Using Arduino / Microcontrollers / Re: problems with burning bootloader on: October 19, 2013, 08:25:51 am
Thanks for the help, when I upload that sketch and get to the part about "choose fuse" I type in LOW but nothing happens so I type it in again and this is all I get:

UPDATE: I had to change the following line in the sketch from this:
UPDATE2: I had to modify a few other similar lines to get the sketch to work. It appears that it wanted a certain number of characters before the program would process it so I had to change the character array sizes to match the sizes of my responses.
Code:
// get which fuse
  char response [6];
to this:

Code:
// get which fuse
  char response [4];
Code:
Atmega hex file uploader.
Written by Nick Gammon.
Version 1.19
Reading SD card ...
Can't access SD card. Do not reformat.
No card, wrong chip select pin, or SPI problem?
SD errorCode: 0X1,0X0

--------- Starting ---------

Attempting to enter programming mode ...
Entered programming mode OK.
Signature = 0x1E 0x95 0x0F
Processor = ATmega328P
Flash memory size = 32768 bytes.
LFuse = 0x62
HFuse = 0xD9
EFuse = 0xFF
Lock byte = 0xFF
Clock calibration = 0xA1
Actions:
 [E] erase flash
 [F] modify fuses
Enter action:
Programming mode off.
F
Attempting to enter programming mode ...
Entered programming mode OK.
LFuse = 0x62
HFuse = 0xD9
EFuse = 0xFF
Lock byte = 0xFF
Clock calibration = 0xA1
Choose fuse (LOW/HIGH/EXT/LOCK) ...
LOWLO
Unknown fuse name.
11  Using Arduino / Microcontrollers / problems with burning bootloader on: October 18, 2013, 09:01:39 pm
I've been burning bootloaders on the chips that I got a few days ago.  I had a few failed attempts that were remedied by either re-seating the chip or replugging the jumpers but one particular chip just keeps failing on me. I'm using Nick Gammon's burnbootloader sketch.  below is what I keep getting (using my UNO as the programmer for a atmega328p-pn). Did I simply get a bad chip?

Code:
Atmega chip programmer.
Written by Nick Gammon.
Entered programming mode OK.
Signature = 0x1E 0x95 0x0F
Processor = ATmega328P
Flash memory size = 32768 bytes.
LFuse = 0x62
HFuse = 0xD9
EFuse = 0xFF
Lock byte = 0x00
Clock calibration = 0xA1
Bootloader address = 0x7E00
Bootloader length = 512 bytes.
Type 'L' to use Lilypad (8 MHz) loader, or 'U' for Uno (16 MHz) loader ...
Using Uno Optiboot 16 MHz loader.
Type 'V' to verify, or 'G' to program the chip with the bootloader ...
Erasing chip ...
Writing bootloader ...
Committing page starting at 0x7E00
Committing page starting at 0x7E80
Committing page starting at 0x7F00
Committing page starting at 0x7F80
Written.
Verifying ...
Verification error at address 7E00. Got: 0x00  Expected: 0x11
Verification error at address 7E01. Got: 0x20  Expected: 0x24
Verification error at address 7E04. Got: 0x00  Expected: 0x14
Verification error at address 7E05. Got: 0x92  Expected: 0xBE
Verification error at address 7E08. Got: 0x80  Expected: 0xF0
Verification error at address 7E0D. Got: 0x13  Expected: 0x93
Verification error at address 7E0F. Got: 0x33  Expected: 0x00
Verification error at address 7E10. Got: 0xFF  Expected: 0x82
Verification error at address 7E11. Got: 0xFF  Expected: 0xE0
Verification error at address 7E13. Got: 0x83  Expected: 0x93
Verification error at address 7E16. Got: 0xC0  Expected: 0x88
Verification error at address 7E17. Got: 0x02  Expected: 0xE1
Verification error at address 7E1B. Got: 0x83  Expected: 0x00
Verification error at address 7E22. Got: 0x84  Expected: 0x80
Verification error at address 7E24. Got: 0xFF  Expected: 0x80
Verification error at address 7E25. Got: 0xFF  Expected: 0x93
Verification error at address 7E2C. Got: 0xC9  Expected: 0x25
Verification error at address 7E2D. Got: 0x38  Expected: 0x9A
Verification error at address 7E2E. Got: 0x96  Expected: 0x86
Verification error at address 7E36. Got: 0x00  Expected: 0x30
Verification error at address 7E37. Got: 0x61  Expected: 0x93
Verification error at address 7E3B. Got: 0x1D  Expected: 0x93
Verification error at address 7E40. Got: 0xFF  Expected: 0xB0
Verification error at address 7E41. Got: 0x20  Expected: 0x9B
Verification error at address 7E45. Got: 0xFF  Expected: 0x9A
Verification error at address 7E46. Got: 0xFF  Expected: 0xA8
Verification error at address 7E47. Got: 0xFF  Expected: 0x95
Verification error at address 7E49. Got: 0xD0  Expected: 0x50
Verification error at address 7E4A. Got: 0x25  Expected: 0xA9
Verification error at address 7E4B. Got: 0xFF  Expected: 0xF7
Verification error at address 7E4C. Got: 0x26  Expected: 0xCC
Verification error at address 7E50. Got: 0xFF  Expected: 0x88
Verification error at address 7E51. Got: 0xFF  Expected: 0x24
Verification error at address 7E52. Got: 0x01  Expected: 0x83
Verification error at address 7E54. Got: 0x84  Expected: 0xB5
Verification error at address 7E5A. Got: 0xC1  Expected: 0x9A
Verification error at address 7E5B. Got: 0x2D  Expected: 0x2E
Verification error at address 7E5C. Got: 0x2E  Expected: 0xF3
Verification error at address 7E5D. Got: 0xFF  Expected: 0xE0
Verification error at address 7E5E. Got: 0xFF  Expected: 0xBF
Verification error at address 7E5F. Got: 0xFF  Expected: 0x2E
Verification error at address 7E64. Got: 0xFF  Expected: 0x61
Verification error at address 7E65. Got: 0xFF  Expected: 0xF4
Verification error at address 7E66. Got: 0xFF  Expected: 0x9F
Verification error at address 7E6A. Got: 0x08  Expected: 0xAF
Verification error at address 7E6C. Got: 0x00  Expected: 0x02
Verification error at address 7E6D. Got: 0x04  Expected: 0x38
Verification error at address 7E70. Got: 0xFF  Expected: 0x01
Verification error at address 7E71. Got: 0xFF  Expected: 0x38
Verification error at address 7E72. Got: 0x01  Expected: 0x11
Verification error at address 7E73. Got: 0xF5  Expected: 0xF4
Verification error at address 7E7C. Got: 0xF3  Expected: 0x89
Verification error at address 7E7D. Got: 0xE0  Expected: 0xC0
Verification error at address 7E7E. Got: 0x89  Expected: 0x82
Verification error at address 7E80. Got: 0xFF  Expected: 0x11
Verification error at address 7E81. Got: 0xFF  Expected: 0xF4
Verification error at address 7E82. Got: 0xFF  Expected: 0x84
Verification error at address 7E83. Got: 0xFF  Expected: 0xE1
Verification error at address 7E84. Got: 0xFF  Expected: 0x03
Verification error at address 7E85. Got: 0xFF  Expected: 0xC0
Verification error at address 7E86. Got: 0xFF  Expected: 0x85
Verification error at address 7E87. Got: 0xFF  Expected: 0x34
Verification error at address 7E88. Got: 0xFF  Expected: 0x19
Verification error at address 7E89. Got: 0xFF  Expected: 0xF4
Verification error at address 7E8A. Got: 0xFF  Expected: 0x85
Verification error at address 7E8B. Got: 0xFF  Expected: 0xE0
Verification error at address 7E8C. Got: 0xFF  Expected: 0xA6
Verification error at address 7E8D. Got: 0xFF  Expected: 0xD0
Verification error at address 7E8E. Got: 0x81  Expected: 0x80
Verification error at address 7E8F. Got: 0xFF  Expected: 0xC0
Verification error at address 7E90. Got: 0xFE  Expected: 0x85
Verification error at address 7E91. Got: 0x48  Expected: 0x35
Verification error at address 7E92. Got: 0xFF  Expected: 0x79
Verification error at address 7E93. Got: 0xFF  Expected: 0xF4
Verification error at address 7E94. Got: 0xFF  Expected: 0x88
Verification error at address 7E95. Got: 0xFF  Expected: 0xD0
Verification error at address 7E96. Got: 0xFF  Expected: 0xE8
Verification error at address 7E97. Got: 0xFF  Expected: 0x2E
Verification error at address 7E99. Got: 0xFF  Expected: 0x24
Verification error at address 7E9A. Got: 0xFF  Expected: 0x85
Verification error at address 7E9B. Got: 0xFF  Expected: 0xD0
Verification error at address 7E9C. Got: 0xFF  Expected: 0x08
Verification error at address 7E9D. Got: 0xFF  Expected: 0x2F
Verification error at address 7E9E. Got: 0xFF  Expected: 0x10
Verification error at address 7E9F. Got: 0xFF  Expected: 0xE0
Verification error at address 7EA0. Got: 0xFF  Expected: 0x10
Verification error at address 7EA1. Got: 0xFE  Expected: 0x2F
Verification error at address 7EA2. Got: 0xFF  Expected: 0x00
Verification error at address 7EA3. Got: 0xFF  Expected: 0x27
Verification error at address 7EA4. Got: 0xFF  Expected: 0x0E
Verification error at address 7EA5. Got: 0xFF  Expected: 0x29
Verification error at address 7EA6. Got: 0xFF  Expected: 0x1F
Verification error at address 7EA7. Got: 0xFF  Expected: 0x29
Verification error at address 7EA8. Got: 0xFF  Expected: 0x00
Verification error at address 7EA9. Got: 0xFF  Expected: 0x0F
Verification error at address 7EAA. Got: 0xFF  Expected: 0x11
Verification error at address 7EAB. Got: 0xFF  Expected: 0x1F
Verification error at address 7EAC. Got: 0xFF  Expected: 0x8E
Verification error at address 7EAD. Got: 0xFF  Expected: 0xD0
Verification error at address 7EAE. Got: 0xFF  Expected: 0x68
Verification error at address 7EAF. Got: 0xFF  Expected: 0x01
369 verification error(s).
First 100 shown.
Type 'C' when ready to continue with another chip ...
12  Using Arduino / Motors, Mechanics, and Power / Re: Using PWM with the L293D to get around issue posed by minimum supply voltage on: October 18, 2013, 05:52:50 pm
Sorry about that, it sounded great when I wrote the OP, but after stepping back and after seeing your reply, I saw that it wasn't clear enough.

From what I have been reading it's the Vce value that's the voltage drop and there is two Vce values listed on the datasheet 1.4 volts and 1.2 volts which would make the total voltage drop 2.6 volts.  so 5-2.6= 2.4 volts.  I was confused when I took a voltage reading and got 4.89 volts but I noticed that the Vce value mentions the drop when collector current is .6A so I'm guessing it will only come close to that voltage when I put an actual load on the circuit. So I actually need to supply 5.6 volts on the voltage supply pin (5.6-2.6=3 volts).
13  Using Arduino / Motors, Mechanics, and Power / Re: Using PWM with the L293D to get around minimum supply voltage limitation on: October 18, 2013, 04:50:28 pm
For my power supply I'm using a battery connected to a buck converter.

I'm new to motor drivers, so hopefully I interpreted the datasheet correctly.
Feel free to explain any consequences of driving motors with an IC that uses transistors.
I got the value of a minimum motor supply voltage for the pin that supplies power to the voltage as 4.5 volts from the Vs minimum value (it pointed to Vss which listed 4.5 volts as a minimum) I should also mention that since the Arduino UNO (what I'm using) uses 5 volts for the main VCC pin, my minimum Vs value is actually 5 volts if I interpreted that correctly, so that's what I've set the buck converter to.

I should clarify that I"m providing the minimum required voltage on the voltage supply pin for driving motors, I'm supplying a PWM signal to the Enable pin to get the average voltage to around 3 volts on the output pins that connect to the leads of the motor.
14  Using Arduino / Motors, Mechanics, and Power / Using PWM with the L293D to get around issue posed by minimum supply voltage on: October 18, 2013, 03:49:39 pm
My samples of the L293D motor controller arrived today.  After looking around the house to find a small motor and failing,  I found a few cheap 3 volt motors on Ebay. Today I looked at the datasheet and noticed that the minimum supply voltage input for powering the motors was 4.5 volts (facepalms self) but I figured I would just sent a PWM signal to the Enable pin to get the right average voltage and hooked my multimeter to the outputs and adjusted the PWM value to obtain an average voltage of around 3 volts.  Are there any potential issues with this solution? Just wanted to make sure.
15  Using Arduino / General Electronics / Re: Buzzer questions on: October 12, 2013, 02:36:51 pm
No diode needed. The Active Buzzer is just the Passive Buzzer with an oscillator built-in.
Thanks.
Pages: [1] 2 3 ... 5