Arduino not working the same when powered with battery, not usb - arduino

So, I'm building an Arduino toy car. It runs with 4 motors and has 2 color sensors and 8 IR sensors. It must work on battery because i don't want it to be hooked to USB all the time and motors require much more current than USB can provide. So here's the problem...
When I have my arduino powered with USB cable or USB cable and battery, it works perfectly, but when I have it powered only on battery (7.2V), 4 LED's in the left color sensor glow dimmer, and the right one doesn't even work.
I should point out that some of the pins of color sensor that should be plugged in 5V or GND are plugged in digital output pins set on HIGH or LOW.
The arduino i'm working on is Arduino Mega 2560 and color sensors are TCS230.

I think you should measure supply current of the board and then check if your battery is able to provide such value. Also try to feed the board from external supply through wall adapter connector (or Arduino's Vin terminal). The idea is that you may need higher voltage and(or) current, then 7,2V.

Check to make sure you have the correct resisters values in place to drive the LEDs. You can sometimes get away without doing so but it is iffy and you can sink a lot of current you don't really need to. I found this link, "Driving LEDs with an Arduino".

Related

Arduino UNO clone not showing up in Device Manager cant see it at all

For 2 days I was using Arduino clone with only UNO has written on it (MEGA328P) I uploaded my ir controlled servo cod and it was working powered only by USB connection. And when I tried powering it through 5v dc power supply it won't work at all. So after that window is not even reacting with windows plugged in beep when I plug it in my PC, can't see it at all in Device Manager and it normally blinks ON when I plug it in PC (even the L named LED blinks, I don't know what it is). When I press reset button the RX and TX LEDs are lighting up.
To add it all up i tried some fix from the internet to plugged in 19 V in dc power supply and my PC cable in (I used to do that but with some components on it) and my PC turned of instantly Arduino started smoking and now there is now a smudge on CH340G chip left (Maybe I have burnt it) but led ON and L still lights up when I plug it via USB.
If you have smoke then a smudge on the CH340G, then the USB chip on the board is destroyed and there is nothing you can do short of replacing it ( where 'it' is either the chip, if you are skilled and patient enough, or the board if not ). A chip can fail either open or closed circuit, so having some LEDs light ( but not blink ) doesn't mean much.
If the AVR chip also smoked, then I suspect you may have put the 19V on the 5V rail in which case both the AVR and the USB chips will be destroyed.

how to connect ledstrip to arduino

On Adafruit there was an example on how to connect a ledstrip to an arduino, but it said "For longer strips requiring more than 1A, wire power directly to the strip, then run power and ground wires back to the Arduino." I didn't fully understand it so i made a sketch on circuits.io . Since there isn't a normal ledstrip in there i used a RGB to show my sketch, but i can't test it. So before i fry my arduino or ledstrip can someone explain if this is correct or if it needs to be changed? Also can i connect everything on a breadboard or not, since the higher voltage and amp.
https://i.gyazo.com/27e9a6527805b6e4e898a8f32f66de61.png
That would work.
I believe this is the same as this https://learn.adafruit.com/rgb-led-strips/usage
about the breadboard it really depends on the breadboard they can vary from cheap ones 0.5A to 2A is usually the maximum current rating for a good solderless breadboard
Here are what you need:
Your Arduino.
An external power supply. Get something like this for your external power suply.
You led strip.
Connect:
PWM pulse of Arduino -> Data IN of led strip
All GND togheters
5V output of external power supply-> VCC of led strip
Computer -> USB -> Arduino
External power supplies give you high current levels, perfect for many leds. Dont worry about your breadboard melting, it should be able to handle it.

4 Relay Shield rebooting Arduino

I am using a four relay shield to power solenoids, however every time a solenoid is used the Arduino reboots immediately.
We have done this for two different projects with the same type of shield and both cause the same problem.
I am having some trouble figuring out what is causing the system reboot. Any ideas?
The shield is the Catalex relay Shield.
It sounds like driving a relay coil is causing the voltage to drop. After the voltage recovers, the Arduino reboots like it was just turned on.
What happens when you disconnect the solenoids? Does the same behavior happen? These are relays, so the circuit on the relay side should be isolated.
Are you powering the Arduino from a power supply, or the USB port?
Oddly, if you look up the data sheet for the HLS8L-DC5V-S-C:
http://www.dipmicro.com/?datasheet=HLS8L.pdf
it says a 5V relay (L type) should have a coil resistance of 70 Ohms , for 0.35 W, so you should need 70 mA to drive it; I think there is a small transistor that drives that from the pins, but you still need the 70 mA from somewhere to close each relay.
Which version of the board do you have?
http://seeedstudio.com/wiki/Relay_Shield
My search on the Catalex Relay Shield pointed to the Seeedstudio version, but it could be that your board needs to be externally powered.

How many sensors will work at a time in an Arduino for Home automation?

As I am thinking to do a Home automation using Arduino, using Light sensor, temperature control , motion sensor , gas leakage sensor , fire detection sensor , hall effect sensor for Light on/off , fan on/off and fan speed control , motion detection , alarm for gas / fire detection , door open/close respectively.
But my question is how many sensors will work at a time in at an Arduino board?
And is it possible to control Arduino by using PIC or i.MX6 Dual Lite/Solo?
If the sensors use I2C then the limit is 128 devices on the bus, but they each have to have a unique address which are sometimes "hard-coded" on the device by the manufacturer. The Arduino Wired library is used to read/write I2C and it only takes two pins. I2C is also sometimes called TWI (Two Wire Interface). The PIC can do I2C, not so sure about the i.MX6 but I've controlled an Arduino over I2C using a Raspberry Pi.
For the Arduino Uno go here to find the specifications of the open source design:
http://arduino.cc/en/Main/arduinoBoardUno
There you will read that the Arduino Uno has 14 digital and 6 analog I/O pins.
Note, you are not limited to the number of sensors based on the number of I/O pins.
Example:
Any processor has a limited number of I/O pins. You can add hardware to multiplex external signals before they get to these I/O pins. For example, say the processor has 4 I/O pins. You can devote 3 to control a multiplexer selecting 1 of 8 signals to route to the 4th processor I/O pin. Thereby doubling the number of inputs you can sample.
You can use many number of sensors as you wish. But your board need to have that much I/O pins. Try to get mega Arduino board. Arduino Mega 2560 has 54 pins totally. So in the mega board you can connect many sensors.
You can also control the board by PIC, Arduino sketch and so on.

Relay Module and Arduino

I am using a 1 channel relay module for arduino uno r3 like this(the picture shows 2 relay module but i only use one relay for one bulb), http://www.geeetech.com/wiki/index.php/2-Channel_Relay_module.
The bulb is 220V.I connected my arduino pins, D13,Ground,and VCC to relay module's pin; Input,Ground,and 5v.I also cut my bulb's wire to connect it on my relay's pin: NC,NO,COM.One cut end of the bulb was attached to the COM and The other is to NO.The other wire of the bulb leaved uncut.The source of the bulb is Direct current.
I uploaded the Blinking codes in arduino uno r3.
After uploading the code, Relay module followed the arduino's code which is blinking.The thing was, The bulb wont follow.I also tried dis arranging some wires but nothing happens.
I read some of the articles that would possibly solve my problems.I found out that they are using SSR.Is this really needed?and what could I do to make the bulb follow the arduino's codes.
I need Help. Please..help me
If your relay is being energized then that side of the wiring is good, it's something on the other side that is wrong.
The output of a relay does not provide power, it is just a switch. You need to create a circuit that goes from power, through the relay, through your lamp, and back to power. If you connect to COM & NO then the lamp lights when the relay is energized; if you connect instead to COM and NC then the lamp lights when the relay is not energized.
The diagram on that relay site is a little misleading. For your purpose, try running the light bulb from the +5V pin on the Arduino, to the NO relay contact terminal on the relay board, and then grounding the COM relay contact terminal. This should work assuming:
1.) Your wiring TO the relay board is correct AND sufficient enough to operate the relay, specifically, you can hear it "click" every time the Pin 13 goes LOW/HIGH from the Blink sketch.
2.) The 220V rated bulb can actually operate at 5V.
If the bulb needs more than 5V, simply replace the wire going from the bulb to the +5V pin, with a higher voltage battery (make sure you attach the negative terminal of that battery to one of the Arduino Gnd pins).
The wiring diagram contains a lot more information than you need.
The relay module has a TTL interface - VCC, GND and one signal per relay to switch it on/off. These you should connect to the coresponding pins on your arduino(as you probably did).
Each of the relays have three screw terminals
When you switch the relay ON, two of those terminals will be connected through the relay NO-COM
When you switch it off, the relay will disconnect the other pair and connect COM-NC
The relay works as a switch, the lightbulb will be connected to the power as normal, but one of its wires(NOT the ground for safety reasons!) will be interrupted and the ends connected to the relay terminals.
BTW:
Both the relay and lightbulb are limited in how fast they react to switching, the relay takes time to switch(cca 3 - 20 ms) and the lightbulb has a large thermal inertia. If you are trying to blink really fast(more than lets say twice per second, you might have problem with that.
SSR are useful mainly for fast switching(normal relays have a limited speed) and should have longer lifetime, you can use it(it usualy has a 5V control input), but it seems pointless for a lightbulb.
220V light bulb will not operate on 5V
Could you explain
The source of the bulb is Direct current.
Power plug 220V is actualy AC.
What is actualy happening? Is the lightbulb ON or OFF permanently? Is it blinking in some wrong way?

Resources