Show Posts
Pages: [1] 2 3 ... 10
1  Using Arduino / LEDs and Multiplexing / Attiny85 controlling 5V digital RGB LED strip - Voltage reg. is getting hot! on: June 23, 2014, 11:28:26 am
I'm trying to use a 12v plug to drive my ATtiny circuit. I have a voltage regulator and 2x 10uf capacitors supplying 5V to the LED strip and the Attiny. on pin 4 i have a 100 ohm resistor which controls the Din of the strip. I'm using the NEopixel Lib.

Everything is working fine, but the VR is getting untouchably hot. The RGB strip is 1M with 60 LEDs. it has a 3 pin "connector" for 5v gnu and Din AND an additional 5V GND wire. I have both 5V and GND wires on the 5V rail.

The project is a lamp. I'm going to 3d print a case and house the electronics inside.

Any suggestions on how to reduce the heat produced by the VR. I'm scared to enclose it.

Thanks.
Keith
2  Using Arduino / General Electronics / Re: 12V 2n2222 switching problems. on: June 12, 2014, 07:17:07 am
i didn't put 12v to the base. it was attached to the tiny.
3  Using Arduino / General Electronics / Re: 12V 2n2222 switching problems. on: June 11, 2014, 09:28:19 pm
Aren't these NPN i which case collector needs to be to the LEDs and the other side of the LEDs is 12V
emitter is to GND
Base goes to Arduino via resistor

https://en.wikipedia.org/wiki/2N2222


i just changed the emitter collector leads around and its still on...i also changed one of the other's resistor to 1.2k and its still on.
4  Using Arduino / General Electronics / Re: 12V 2n2222 switching problems. on: June 11, 2014, 08:58:58 pm
I don't fully understand your circuit.  The transistor may not be in saturation.  You need more base drive.  Change the base resistor (10k) to 1k.

I can try that. thanks
5  Using Arduino / General Electronics / Re: 12V 2n2222 switching problems. on: June 11, 2014, 08:29:54 pm
Lets check you have the 2N2222 in the right place:

emitter to ground (shared ground between 12V supply and Arduino).

base via 150 ohm resistor to Arduino pin (should be 0V when off, 0.7V or
so when on).

collector to negative terminal of the strip,

positive terminal of the strip to +12V.

And then only expect to switch 0.5A per 2N2222 (and you need a separate
Arduino pin per 2N2222 to supply its base current).



I have the collector connected to GND (where both the 12v and 5v sources share,
I have the base connected to a 10Kohm resister going to the output of the attiny85 (4,1,2)
then the emitter is going to the RGB strip (to the corresponding color - common anode).
6  Using Arduino / General Electronics / Re: 12V 2n2222 switching problems. on: June 11, 2014, 06:01:47 pm
I'm using the attiny85 the LEDs.  The problem is the LEDs stay on even when all the pins are HIGH (common anode). My goal is to turn off the 12v analog rgb led strip (control it as a normal led)

My second problem is there is only a max of 8.3 volts getting to the LED strip. Not nearly bright enough.

I'm not too familiar with transistors and have only recently been inter grating them into my circuits. They work great on a 5v circuit, but this is my first attempt at a 12v circuit and a 5v (4.8v) base.


Noob
7  Using Arduino / General Electronics / 12V 2n2222 switching problems. on: June 11, 2014, 03:53:55 pm
I made a circuit that controls a regular 5mm RGB led and it works perfectly - but i wanted to add more LEDs (simply). So, I had an analog RGB strip laying around and decided to use that....

The problem is I already had the circuit made and have limited board real estate to "add things" and didn't have room for the recommended MOFSETs (the voltage regulator was already pushing it!) So I added 3x 2n2222 transistors and 3x 10K resistors to the base...then things got funky. I couldnt figure out why the strip was a different color than the 5mm led...tested them both separately on a different breadboard and they work just fine...

I came up with the transistors weren't killing the strip. (see pictures)

does anyone have a solution for this? (sitting here staring at the screen waiting for an answer)

THanks
Keith
8  Topics / Interactive Art / Analog RGB LED Strip 12v using 2n2222 transistor and ATtiny85? on: June 10, 2014, 08:31:40 am
Ive built a circuit where I can control an 5mm RGB LED using the attiny85. I have a 12V power source going through a voltage regulator to power the chip and led. But I now want to add a 12v analog led strip in parallel. I have 3x 220ohm resistors regulating the 5mm led. can i use those in conduction with the transistors- tapping into the 12v power source.

can anyone show me how to incorporate the transistors and the led strip into my circuit? maybe a quick diagram?
I've added a few pictures. I can change the color using a phototransistor (as a switch) i got from a mini rc helicopter.

Thanks
Keith
9  Using Arduino / Networking, Protocols, and Devices / Re: Attiny85 Peculiar I2C Problem on: March 10, 2014, 03:22:27 pm
Im also trying to get an attiny to read from the mpu6050; there is example code on the playground you use with the larger arduinos and it uses Wire.h, does anyone know how to transcribe the read write and error functions to match the TinyWire Libraries?

This is a link to my other question with the sample code. thanks

http://forum.arduino.cc/index.php?topic=224702
10  Using Arduino / Microcontrollers / Re: Attiny85 and MPU-6050 on: March 10, 2014, 09:44:52 am
yes, the example sketch was written for the full size arduinos and I was trying to get the sensor to work on my attiny85. There are memory limitations as i understand it and not all the methods from the two libraries are the same, yet they accomplish the same thing. I was wondering if someone could transcribe these functions to work with the tiny85.

Thanks
11  Using Arduino / Microcontrollers / Re: Attiny85 and MPU-6050 on: March 10, 2014, 08:41:00 am
What exactly is the problem?

Error messages...?


Wire.h doesnt compile for the ATTiny85.
12  Using Arduino / Microcontrollers / Re: Attiny85 and MPU-6050 on: March 09, 2014, 09:10:05 pm
The example sketch is using Wire and I need to use TinyWireM/TinyWireS.
13  Using Arduino / Microcontrollers / Attiny85 and MPU-6050 on: March 09, 2014, 07:48:43 pm
I have some code working on my ...milenove, and wanted to "transcribe" the project to an 85.

I got an 20x4 lcd working on the i2c bus, and I wanted to add the MPU. The problem I'm having is translating the MPU-read and write functions from the Wire Library to TinyWireM/TinyWireS

Here is the code:
Code:
// --------------------------------------------------------
// MPU6050_read
//
// This is a common function to read multiple bytes
// from an I2C device.
//
// It uses the boolean parameter for Wire.endTransMission()
// to be able to hold or release the I2C-bus.
// This is implemented in Arduino 1.0.1.
//
// Only this function is used to read.
// There is no function for a single byte.
//
int MPU6050_read(int start, uint8_t *buffer, int size)
{
  int i, n, error;

  Wire.beginTransmission(MPU6050_I2C_ADDRESS);
  n = Wire.write(start);
  if (n != 1)
    return (-10);

  n = Wire.endTransmission(false);    // hold the I2C-bus
  if (n != 0)
    return (n);

  // Third parameter is true: relase I2C-bus after data is read.
  Wire.requestFrom(MPU6050_I2C_ADDRESS, size, true);
  i = 0;
  while(Wire.available() && i<size)
  {
    buffer[i++]=Wire.read();
  }
  if ( i != size)
    return (-11);

  return (0);  // return : no error
}


// --------------------------------------------------------
// MPU6050_write
//
// This is a common function to write multiple bytes to an I2C device.
//
// If only a single register is written,
// use the function MPU_6050_write_reg().
//
// Parameters:
//   start : Start address, use a define for the register
//   pData : A pointer to the data to write.
//   size  : The number of bytes to write.
//
// If only a single register is written, a pointer
// to the data has to be used, and the size is
// a single byte:
//   int data = 0;        // the data to write
//   MPU6050_write (MPU6050_PWR_MGMT_1, &c, 1);
//
int MPU6050_write(int start, const uint8_t *pData, int size)
{
  int n, error;

  Wire.beginTransmission(MPU6050_I2C_ADDRESS);
  n = Wire.write(start);        // write the start address
  if (n != 1)
    return (-20);

  n = Wire.write(pData, size);  // write data bytes
  if (n != size)
    return (-21);

  error = Wire.endTransmission(true); // release the I2C-bus
  if (error != 0)
    return (error);

  return (0);         // return : no error
}

// --------------------------------------------------------
// MPU6050_write_reg
//
// An extra function to write a single register.
// It is just a wrapper around the MPU_6050_write()
// function, and it is only a convenient function
// to make it easier to write a single register.
//
int MPU6050_write_reg(int reg, uint8_t data)
{
  int error;

  error = MPU6050_write(reg, &data, 1);

  return (error);
}


I had to cut some of my added code out, to achieve the char limit of the post
Thanks in advance for your help.-Keith
14  Using Arduino / Microcontrollers / Re: LCD 20x4 on ATTiny85 I2C problems on: March 09, 2014, 07:32:17 pm
Guys, I got my new 20x4 LCD working on the attiny85 (see attachment). I first had to burn the bootloader to the chip and use the 1Mhz core, Then used the  example code  from this Library (changed my address after using the i2c_scanner and my row count):

http://playground.arduino.cc/uploads/Code/LiquidCrystal_I2C_85V1.zip

@Smithy I'll try that soon (I have a feeling that it wont work - I think the LCD might be damaged in some way).

Thanks for all your help
Keith
15  Using Arduino / Microcontrollers / Re: LCD 20x4 on ATTiny85 I2C problems on: March 07, 2014, 09:32:58 am
Did you use external pullup resistors? The internal are too weak on the ATtiny. Some I2C LCD adapter modules do not have them at all and require external.

Please see https://github.com/mikaelpatel/Cosa/issues/86


More info on http://cosa-arduino.blogspot.se/2013/07/object-oriented-lcd-management.html

Cheers!


Thanks for the info!
 do you have a simple sample sketch?
When working with the 85 do you call pin 5 or Pin 0?

Thanks again for your help
Pages: [1] 2 3 ... 10