Show Posts
Pages: [1] 2 3
1  Using Arduino / General Electronics / Re: How to power Arduino Uno with AC-DC converter + backup battery on: October 27, 2011, 08:40:58 am
Hi,

What comes to mind for me is to not power the arduino with the mains - but power the batteries - and then have the batteries power the arduino.

You "simply" need to design a battery charger circuit such as this:
http://www.brighthub.com/engineering/electrical/articles/75834.aspx

And from the battery connect to your arduino / extra parts. That way when the arduino reaches a low voltage you' ve defined the charger kicks in and stops when it reaches its high voltage.
2  Using Arduino / General Electronics / Re: Charging LiPo Battery with Solar Panel on: October 24, 2011, 04:24:14 am
hi,

I'm an absolute newbie in electronics so pls take my post with a fair bit of caution.

To start you'll probably want to have a diode between your solar panels and batteries to avoid the batteries leaking into the solar panel! A diode will eat between 0.5 to 0.7V so your method 1 seems compromised as V solar panel after going thru the diode is going to be < V batteries.

Your method 2, just reading your own comments seems crazy - you're feeding the batteries way too much voltage.

As such the only method I see working is method 2 with a voltage regulator. A simple voltage divider (see wikipedia) will not work as the voltage output will depend on the sun (I believe) so that you'll need an actual chip to do the regulator. In this scenario you have plenty of voltage to play with, and 7 to 8V feeding the arduino is perfect.
3  Using Arduino / General Electronics / Re: How to create LED turn on immediately but fade out slowly effect with Capacitor on: October 24, 2011, 03:43:27 am
Pekkaa - excellent design. Thanks for sharing!

A question however: why is it that you were able to do without R3? From the initial discussions there was the trouble of the capacitor drawing too much current from the Arduino. Is it because it's sharing the current with the LED that's it's not drawing too much current?
4  Using Arduino / Programming Questions / Display a value on the Nokia 5110 LCD Module on: October 16, 2011, 08:40:03 am
Hi,

I'm able to display text on the Nokia 5110 Module, but not values.

For instance
LcdString("123") displays 123

But
int a=123;
LcdString(a);
returns the following error when compiling:

v3_with_LCD:308: error: invalid conversion from 'int' to 'char*'
v3_with_LCD:308: error: initializing argument 1 of 'void LcdString(char*)'

This is LCD String:
Code:
void LcdString(char *characters)
{
  while (*characters)
  {
    LcdCharacter(*characters++);
  }
}

and this is LcdCharater:
Code:
void LcdCharacter(char character)
{
  LcdWrite(LCD_D, 0x00);//Blank vertical line padding
  for (int index = 0; index < 5; index++)
  {
    LcdWrite(LCD_D, ASCII[character - 0x20][index]);//0x20 is the ASCII character for Space (' '). The font table starts with this character
  }
  LcdWrite(LCD_D, 0x00);
}


So I tried to convert the integer into a string - with no success:
Code:
int a=123;
  String astring=String(a);
  LcdString(astring);

Error message:
v3_with_LCD.cpp: In function 'void setup()':
v3_with_LCD:310: error: cannot convert 'String' to 'char*' for argument '1' to 'void LcdString(char*)'

Any help most welcome!
5  Using Arduino / General Electronics / Re: Please help me understand this PNP transistor on: October 09, 2011, 12:19:40 pm
The trick is to remember that when there is a difference between the emitter and base voltage greater than 0.7V the transistor turns on.

Grumpy - thank you! Yes - the word DIFFERENCE is indeed the trick. Thanks so much for the answer!
6  Using Arduino / General Electronics / Re: Please help me understand this PNP transistor on: October 07, 2011, 05:07:24 pm
Looking for the million-th time to this diagram something new stroke me. When solar-powered (ie - left battery at 4.5V), current reaches 3 points: the battery, the emitter AND the base. That's of course the difference then when it's only battery powered. But... why is having current both on the emitter and base not moving any of it to the collector and LED?

confused smiley
7  Using Arduino / General Electronics / Re: How much voltage and mA do i need? on: October 07, 2011, 04:36:38 pm
Seriously - you're not supposed to read battery voltage by simply connecting the plus and the minus with the multimeter? Wow - i've been doing this for years... Gives me a good indication of how full the batteries are...
8  Using Arduino / General Electronics / Please help me understand this PNP transistor on: October 07, 2011, 04:31:55 pm
Hi,

Here's a great circuit from Evil Mad Scientist - I've built it and it works: it's to create a garden solar lamp.



When there's sunlight it charges the battery and the LED is off. When there's no sunlight the LED is powered by the batteries. Brilliant. But I can simply not understand how the PNP transistor works.

Here's my reasoning - stop me when I'm wrong.

When there's sun V solar panel > V batteries so the current goes thru the batteries but also thru the emitter (top), back in the base, thru the 5K and back again for another round.

When V solar  panel < V batteries, current leaves the batteries, and reaches the emitter. What's different at this point then when the "solar" current reached the emitter? What's the "trick" that makes at this point the current take the path to the collector and onto the LED?

Bonus question: is the 5K resistor the result of a calculation, or simply a "high enough resistor"?

In advance - thank you!
9  Using Arduino / General Electronics / Re: Holes too small on my PCB - now what? on: October 03, 2011, 02:21:29 pm
Thank you all for the friendly replies - much appreciated.

Yes - it's a double sided PCB. I'm try with a small tool to make them bigger - not much risk as the place where I ordered sent me 10 PCB and I only need 1, so great to experiment.

Terry - is through-hole plating that important for connectivity, as opposed to just the copper ring around the hole?

thanks,

XBerg
10  Using Arduino / General Electronics / Holes too small on my PCB - now what? on: October 03, 2011, 03:45:39 am
Hi,

I proudly just received my 1st self-designed PCB, but alas, some holes are too small. I had 6x 3.5mm stereo jacks on the PCB (they have 5 pins each) but did not notice that the pins are larger than the typical resistor or IC - no matter how hard I push I can't get all 5 pins in (and have already broke 2 components in trying!).

Is there a cheap tool I could use to make the holes just that bit larger? I have 30 holes to work on so hopefully something that won't take an hour her hole!

thanks,

XBerg
11  Using Arduino / General Electronics / Re: Creating a digital potentiometer from basic parts on: September 26, 2011, 03:41:48 pm

Couple R,LED to digital output, run in 'analog out' mode. Point it at a Photoconductor like (http://arduino-direct.com/sunshop/index.php?l=product_detail&p=135).

Put filter cap across the photoconductor if the ripple is too much.  Sketch to calibrate it.. 

OK - I now had the chance to test this. I'm running into a bug: the PWM, too fast for the eye to see, keeps turning the LED on and off. The photoresistor on the other hand sees mostly "0", particularly at low brightness levels. Maybe 75%+ of values are 0. I use the analogWrite and analogRead functions.

Code:
int led=11;
int sensorPin = A0;
int pause=100;

int sensorValue = 0;         // the sensor value


void setup()
{
  pinMode(led, OUTPUT);
  Serial.begin(9600);
 
 
}

void loop()
{
     for (int brightness = 0; brightness < 130; brightness++)
     {
      analogWrite(led, brightness);
      sensorValue = analogRead(sensorPin);
      Serial.println(sensorValue,DEC);
      delay(pause);
     }

for (int brightness = 130; brightness >= 0; brightness--) {
      analogWrite(led, brightness);
      sensorValue = analogRead(sensorPin);
      Serial.println(sensorValue,DEC);
      delay(pause);
     }
 
 
}
So I don't think this is quite usable quite so easily.Or I missed something...
12  Using Arduino / General Electronics / Re: Creating a digital potentiometer from basic parts on: September 26, 2011, 05:04:59 am
Terryking: That's pure genius!!! Thank you so much. I don't need any response speed at all - this is to control an already slow motor to make it even slower - set once and forget. So your solution is super.

Magician - thanks for the sketch - now it's all clear. I'll go the Terryking route though as it saves quite a few pins.

Brilliant smiley
13  Using Arduino / General Electronics / Using an optoisolator to control a 12V 5A DC Power supply? on: September 26, 2011, 04:59:10 am
Hi,

Can I use a 4N25 optoisolator to control on/off of a 12V 5A DC Power Supply? I'm thinking of cutting in 2 the wire of  the +12V of the power supply and connecting both bits to the emitter and collector of the opto and having a parallel connection of the ground to the arduino's ground.

Problem is that I have doubts that the opto can stand such current (5A). The data sheet (http://www.vishay.com/docs/83725/4n25.pdf ) says: Absolute Max Collector Current 50 mA / 100 mA - so I'm nowhere near the 5A.

Further down in the datasheet I also read:
CURRENT TRANSFER RATIO
DC current transfer ratio VCE = 10 V, IF = 10 mA
4N25 CTRDC 20 50 %

So does that mean that the opto reduces the current by 50%???

Should I forget about the opto and go the relay route?

thanks!
14  Using Arduino / General Electronics / Re: Creating a digital potentiometer from basic parts on: September 23, 2011, 10:42:40 am
Magician,

I can't get my head around what you're recommending:
If you connect one resistor (20k) to common input/output, and 4 resistor ( 0, 5, 10, 20 ) to other inputs/outputs you 'd create a digitally controllable voltage divider

could you please be more specific?

Gadget999: salvaging a component from a printer? I would not recognize a digital pot if it were starring at me in the eye !!! So no - not a chance I open a printer for spares smiley
15  Using Arduino / General Electronics / Creating a digital potentiometer from basic parts on: September 21, 2011, 11:24:24 am
Hi,

In France I can not find a 20K digipot for less than $15 delivered, so I would like to know whether I could replicate the effect of a digipot with simple transistors and resitors. I need a simple 4 step digipot: 0 ohm, 5K ohm, 10K ohm and 20K ohm, controlled by the arduino pins. I just don't know where to get started...

thanks!

XBerg
Pages: [1] 2 3