Show Posts
Pages: 1 2 3 [4]
46  Using Arduino / General Electronics / In-situ charging LT1505 on: February 05, 2012, 06:27:02 am

I want to be able to charge the batteries while the system is running. The only charging circuit I've found that isn't to tiny for soldering is the LT1505 and as such it's purchased, however something has struck me. Where it says to system power, will that be at the level of the adapter when connected?

lt1505 datasheet:

One of the components I will be using needs 12V (a psu) - if it is as I suspect the voltage will range from 10V to 18.5V, any way to make that be 12V?

47  Using Arduino / Project Guidance / Re: Fast ADC on: February 03, 2012, 05:22:40 pm
Btw, just tested, with the mcp3208 I was able to do 46k samplings pr second.

unsigned int start = millis();
   unsigned int j = 0;
   while (millis() - start < 1000) {
     val = readAdc(1);

readAdc might be optimized slightly, but probably not much..

edit: mr. typo
48  Using Arduino / Project Guidance / Re: OpenCV and Arduino Serial Communications via USB. on: February 03, 2012, 05:00:47 pm
Did you try google? I program in java, so don't know much about .not, but I'm pretty sure there's some serial communication libraries for .net.. (serial communication .net or whatever language you're writing in...)
49  Using Arduino / Project Guidance / Re: Fast ADC on: February 03, 2012, 04:55:20 pm
IIRC there are some ADCs with interrupts, sounds like that might fit the bill (and would be easy).  Remember to check for SPI as well, other stuff might be to slow..
50  Using Arduino / Project Guidance / Re: Hooking up an electric car to transmit battery current wirelessly to a laptop on: February 03, 2012, 04:49:24 pm
The problem is we have to order ALL of the parts at one time, so I can tackle things one at a time, but I need to know exactly everything I will need beforehand.

Well, good luck, but like Peter says it's unlikely you'll be able to order everything right the first time, nor do I see why any project would need you to order everything at once... At any rate, minimum if you're going with the xbee route would probably be:

2 * xbee
2 * arduino (with usb cables)
cables (you know what cables you want/need?) - might only need for connecting the xbees and powering arduino on the RV side, on the other hand you get lot's of cheap cables for $5-10
soldering stuff (iron, wick, solder, flux)
current sensor

As a programmer you should know that you should start with the basics or prototyping and test stuff out when you don't know anything about it. And electronics isn't like programming, if something doesn't fit quite right or missing some part you can't just change some lines and it's okay..

Also remember that the current sensor needs to intercept the entire battery circuit.. And is xbee what you want? You want to try other technologies? I've ordered some nrf24l01+, also not tested, but cheaper.. Resistors, inductors, capacitors, diodes needed anywhere?
51  Using Arduino / Project Guidance / Re: Hooking up an electric car to transmit battery current wirelessly to a laptop on: February 02, 2012, 03:02:11 pm
I would recommend you start with a current sensor and arduino connected to the pc via usb. Tackle that, then do the wireless part.. Check sparkfun for current sensor or they sell some cheap ones on aliexpress at least (bought one, but not tested yet).

Unless you're planning to just plot the data in excel or something you'd probably have to write some app to display the data yourself..

Things will probably be a lot clearer once you've gotten the basics smiley
52  Using Arduino / Project Guidance / Re: SPI Servo PWM IC on: January 26, 2012, 02:18:59 pm
Probably about 4-6 servos per chip. Had hoped to find something I didn't need to program, will be enough programming with this project. But suspect I will have to settle for some microchip.. I guess that would be ok, can use it to measure stuff too.. More pins saved smiley
53  Using Arduino / Project Guidance / SPI Servo PWM IC on: January 26, 2012, 01:30:57 pm

I've been searching the net but don't seem to be able to find any IC with SPI that can control servo motors.. Anybody have some suggestions? Preferably without too much external requirements like resistors or crystals etc..

Help? smiley
54  Using Arduino / Programming Questions / Re: Help with shift bits... on: January 24, 2012, 12:33:58 pm
I used the same stuff on Sunday, didn't quite work out for me.. Here's what I ended up with:

It's not quite correct, but close enough (can resend IR signals from remote 95% of the time..)


/* Raw IR decoder sketch!
 This sketch/program uses the Arduno and a PNA4602 to
 decode IR received. This can be used to make a IR receiver
 (by looking for a particular code)
 or transmitter (by pulsing an IR LED at ~38KHz for the
 durations detected
#define IRpin          2

#define irLed          9
// the maximum pulse we'll listen for - 65 milliseconds is a long time
#define MAXPULSE 65000
// we will store up to 100 pulse pairs (this is -a lot-)
unsigned long pulses[100][2];  // pair is high and low pulse
int currentpulse = 0; // index for pulses we're storing

unsigned long time;
unsigned long timeCmp;

void setup(void) {
  pinMode(irLed, OUTPUT);
  digitalWrite(irLed, LOW);

void loop() {
 if (currentpulse >= 100) {
 //Serial.println("Waiting for data!");
 // wait for data..
  while (currentpulse == 0 && digitalRead(IRpin) ) {
  time = micros();
  while (!digitalRead(IRpin)) {
    // If the pulse is too long, we 'timed out' - either nothing
     // was received or the code is finished, so print what
     // we've grabbed so far, and then reset
     timeCmp = micros() - time;
     if (timeCmp > MAXPULSE) {
  // we didn't time out so lets stash the reading
  pulses[currentpulse][0] = timeCmp;
  // same as above
  time = micros();
  while (digitalRead(IRpin)) {
     timeCmp = micros() - time;
     if (timeCmp > MAXPULSE) {
  pulses[currentpulse][1] = timeCmp;
  // we read one high-low pulse successfully, continue!

void stopReading() {
  if (currentpulse != 0) {

void printpulses(void) {

  // print it in a 'array' format
  Serial.print("int IRsignal[] = {");
  for (int i = 0; i <= currentpulse; i++) {

    Serial.print(", ");
    Serial.print(", ");
  unsigned long now = micros();
  for (int i = 0; i < currentpulse; i++) {
     delayMicroseconds(pulses[i][1] - 10);
   now = (micros() - now);

  Serial.print("Sent stuff, took in ms ");
  Serial.println(now / 1000);
  unsigned long shouldTake = 0;
   for (int i = 0; i < currentpulse; i++) {
    shouldTake += (pulses[i][0] / 10);
    shouldTake += (pulses[i][1] / 10);
   Serial.print("Should take in ms ");
  Serial.println(shouldTake / 100);

void pulseIR(unsigned long microsecs) {
   if (!microsecs) { return; }
   unsigned long start = micros();
   digitalWrite(irLed, HIGH);  
      // 38 kHz is about 13 microseconds high and 13 microseconds low
   unsigned long cdiff = 0;
  while (micros() - start < microsecs) {
     digitalWrite(irLed, HIGH);
     cdiff += 13;
     while (micros() - start < cdiff);
     digitalWrite(irLed, LOW);  
      cdiff += 13;
     while (micros() - start < cdiff);

void sendPulses(const int pulses[]) {
   int i = 0;
   while (pulses[i] > 0) {
    delayMicroseconds(pulses[i++] - 50);
55  Development / Suggestions for the Arduino Project / Re: SHIFT + Backspace should not act like Delete on: January 23, 2012, 06:38:30 pm
I second this! Has annoyed me quite a bit..

Thanks for the info tho smiley

edit: to be less unclear, should be an option in ui
56  Using Arduino / Programming Questions / Re: Wire.Read not advancing bytes on: January 23, 2012, 05:52:26 pm
From the datasheet:

In order to read multiple bytes, it is necessary to assert the most significant bit of the sub- address field. In other words, SUB(7) must be equal to 1, while SUB(6-0) represents the address of the first register to be read.

You don't seem to be doing that.

bah, I wanted to say that smiley-razz
57  International / Scandinavia / CDRH127-150 on: January 23, 2012, 04:10:17 pm

Jeg skal prøve å få satt sammen en LT1505 til noe fungerende, -- vet den er noe "gammel" men de nyere jeg har funnet som kan lade 3s li-ion og gi system power er alt for små til at jeg klarer å lodde.

Skal opp på elfa i løpet av noen dager og tenkte derfor jeg kunne plukke med meg de delene jeg har glemt å bestille. Inkludert en 15µH inductor, eller som wikipedia vil oversette til spole. Fint, gå til og finn spoler...?

De ser ut til å ha masse forskjellige inductorer, for det første trodde jeg det var dette capacitors gjorde, men la gå.. Uansett, hva i all verden er forskjellen på alle disse forskjellige?

Og hvem tilsvarer en CDRH127-150?

Alternativt hvis noen vet om et li-ion breakout board man kan kjøpe i stedet kan jeg la de $40 i deler jeg allerede har bestilt ligge og heller kjøpe et ferdig brett..

Btw, fant dette brettet på elfa også:
~200NOK 80MHz, 42 I/O 16K ram -- bestilt!

58  Using Arduino / Programming Questions / Re: Code Problems: 12 Servos With Arduino Mega on: January 22, 2012, 03:23:44 am
Any particular reason you're not using the servo library?

What might cause some problems though is that you are sleeping for 1-2 ms while telling the servo where it sould be. With 12 that's between 12-24 ms. That might throw your timings off..ß

Also you are reading the setting lastUpdate after waiting, probably not critical but should be before.

Would recommend you clean up your code a bit by using arrays and the servo library. ( )
Pages: 1 2 3 [4]