4 Relay Shield rebooting Arduino - 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.

Related

Error in Arduino with Espressif ESP32-CAM [duplicate]

I've just recieved my very first esp32cam (AI THINKER) today and I was excited to test it, but I'm unable to upload any code to it. I'm always getting the following error:
Failed to connect to ESP32: Timed out waiting for packet header
So, the FTDI I'm using is the FT232r with the following wiring scheme
FTDI Wiring
How I reproduce this error:
Plug everything
Order IDE to upload the sketch
Wait for the "connecting" text
Press the RST button
Also:
Plug everything
Press the RST button
Order IDE to upload the sketch
I've already tried:
Switching to 3.3v (plugged on 3.3v pin)
Using external 5v power supply (plugged on 5v pin)
Using another computer
Swapping RX TX
Trying in different upload speeds
Holding RST button
Switching board between ESP32 Wrover Module and AI Thinker ESP32
I'm I doing something wrong or there's just something faulty?
I have delved for a solution in this regard for weeks and it seems I have a solution.
Findings-
FTDI module is probably faulty or not supported for each instance.
Aithinker Board is not compatible with esspressif (use ESP32Wrover, more details below )
I have an esp32cam from Esspressif, not Aithinker.
I was trying with FT232rl , No matter what Voltage/jumpers/USB cable I used, it didn't work. Always stuck with fatal timed out error.
After many futile attempts with FTDI breakout, I gave my Arduino UNO a try (please note my UNO has mega16u2 chip as USB serial chip (top right corner just beside the oscillator) and fortunately it worked.
I have read that CP2102 is also working.
**Here are the steps to follow-**
Arduino ESP32Cam connections
3.3 Arduino --------- 3v Esp32CAM
GND Arduino ------------ GND Esp32CAM
RESET Arduino to Ardunio GND
RX Arduino -------------- VOR Esp32CAM (this is not a mistake RX to rx & TX to tx)
TX Arduino -------------- VOT Esp32CAM
GPIO 0(zero)(written as IO0) Esp32CAM to GND Esp32CAM
I didn't have any need to press the reset button in any part of the operation before & during uploading.
I am assuming You have pre-installed the esp32 board manager.
Now select the correct COM port where your Uno (in this case) is
plugged in.
Select the correct board as mentioned
Tools>Board>ESP32 Arduino > select ESP32 Wrover Module
Some uploading setups are to be Done (Under Tools, these will only appear when the Wrover module is selected )
Upload speed -- 115200
Flash Frequency -- 40Mhz
Flash Mode -- QIO
Partition Scheme --- Huge App
Port ---- select the right com port for your breakout or UNO
JUST press upload and relax
After a while, you will be able to see this message
Leaving...
Hard resetting via RTS pin...
Disconnect the Esp32Cam GPIO 0 and GND
Power the ESP32Cam with 5/3v with external power supply (Arduino or other breakouts may not be able unless you are connected with a Powered USB Hub)
keep TX, RX, & GND of the 2 boards connected, don't disconnect Arduino Reset and GND.
Press Reset on ESPCAM and open Serial monitor and you will be able to see the IP address of the cam if it was configured with your wifi correctly.OR get any network scanner App on android or windows.
I hope it helped.
Pre-requisites for flashing:
ArduinoIDE 1.8.12
Core ESP32 1.04 (at time of writing)
Select board AI Thinker Cam
uplooad speed 921600
freq 240Mhz
flashfreq 80Mhz
mode QIO if not working try DIO
partition scheme default
Serial monitor is closed
NO hardware connected to the pins of the ESPcam
Make sure the USB cable is a data cable and NO loading cable only
check Windows device manager if programmer is shown and has max speed / 8n1 hardware
Connections
FTDI - ESP32
GND GND
5V 5V
TXD UOR
RXD UOT
If you use an AIThinker Cam clone you have to ground GIPO 0:
connect GPIO 0 with a dupont wire connected to GND
press reset
compile and upload (use AI THINKER CAM)
optional:
press reset
upload filesystem data (SPIFFS)
disconnect GPIO 0 and GND
press reset
code should execute
And yes you have to do it every upload, on my dev board I soldered a little switch with proper isolationSome more solutions from experience:
If there is still a problem use a 10K (or so) pull-down resistor between RX0 and GND (test on breadboard before soldering)
Pressing and holding (!) the boot-button while uploading on some "bad" boards
Happened with a "normal" ESP32 board to me - just to be sure - I got an ESP8266 in an ESP32 packaging. Configuring for the ESP8266 solved the issue of uploading.
In my case I forgot to remove the SD card. Other users recommended removing unnecessary connections to the pins-- and the SD card technically uses some of those :)
This was solved by using other jumpers. It seems one of the jumpers used in the wiring was faulty.
If you're having the same issue and tried everything in this post, try checking your cables!
Another solution here. Just to add, I tried everything on this QA, as well as many other things suggested online. e.g. tested by powering from 3.3V then 5V, various permutations of holding the reset button down and disconnecting IO00 from GND at the point of flashing. Changing various settings in Arduino IDE/
I was unable to flash a single one of the 5 ESP32-CAM boards I bought. Spent a good two hours on it. I even continuity tested every pin on the board to its ESP32 chip pad, and all the hookup wires were tested too. The board seemed fine.
Then I soldered a 100uF capacitor between 5V and GND, and used my USB-UART 5V power... tested and worked straight away. No need to pull out the IO00->GND connection and no need to press RST button on the board during flashing. (Of course, pull out IO00->GND after flashing complete.
So - it was a power problem.
I can only guess that the cheapo regulator they used on the copy of board that I got was not quite efficient enough, but basically that capacitor resolved the issue.
p.s. the ESP on board was marked "ESP32-S". I selected "AI Thinker ESP32-CAM" in Arduino IDE as suggested by most people online, and this worked.
There are 3 pins marked GND on the ESP32-CAM board. Buuuuut (!) the one marked GND/R just by the U0T is NOT connected to other grounds or anywhere else I could had find. Check with a multimeter and use a REAL GND. It just worked for me after days of puzzling.
If you try it with arduino it works but its needed to press reset button on esp32 before you upload your code
Basically I was facing the exact same problem fro quite some time. What worked for me was that as the chip was flashing, shifting the power wire from 5V to 3V3 pin. I do not know why but it workes. When esptool starts flashing at 2%, switching the cable just then, despite having 5V from supply into the 3V3 point made the flashing successful. I do realize this is probably a bad answer to your problem since it involves oversupplying voltage to the chip on the wrong point as it is flashing and could damage the chip. However, if anyone is tired of debugging and are at the point where you are considering throwing the chip away, might as well try my method. For other's who value their chip, don't try this method and if you still do, kniw it is at your own risk. But it worked for me after 3 days of just messing around with connections.

Esp32cam Failed to connect to ESP32: Timed out waiting for packet header

I've just recieved my very first esp32cam (AI THINKER) today and I was excited to test it, but I'm unable to upload any code to it. I'm always getting the following error:
Failed to connect to ESP32: Timed out waiting for packet header
So, the FTDI I'm using is the FT232r with the following wiring scheme
FTDI Wiring
How I reproduce this error:
Plug everything
Order IDE to upload the sketch
Wait for the "connecting" text
Press the RST button
Also:
Plug everything
Press the RST button
Order IDE to upload the sketch
I've already tried:
Switching to 3.3v (plugged on 3.3v pin)
Using external 5v power supply (plugged on 5v pin)
Using another computer
Swapping RX TX
Trying in different upload speeds
Holding RST button
Switching board between ESP32 Wrover Module and AI Thinker ESP32
I'm I doing something wrong or there's just something faulty?
I have delved for a solution in this regard for weeks and it seems I have a solution.
Findings-
FTDI module is probably faulty or not supported for each instance.
Aithinker Board is not compatible with esspressif (use ESP32Wrover, more details below )
I have an esp32cam from Esspressif, not Aithinker.
I was trying with FT232rl , No matter what Voltage/jumpers/USB cable I used, it didn't work. Always stuck with fatal timed out error.
After many futile attempts with FTDI breakout, I gave my Arduino UNO a try (please note my UNO has mega16u2 chip as USB serial chip (top right corner just beside the oscillator) and fortunately it worked.
I have read that CP2102 is also working.
**Here are the steps to follow-**
Arduino ESP32Cam connections
3.3 Arduino --------- 3v Esp32CAM
GND Arduino ------------ GND Esp32CAM
RESET Arduino to Ardunio GND
RX Arduino -------------- VOR Esp32CAM (this is not a mistake RX to rx & TX to tx)
TX Arduino -------------- VOT Esp32CAM
GPIO 0(zero)(written as IO0) Esp32CAM to GND Esp32CAM
I didn't have any need to press the reset button in any part of the operation before & during uploading.
I am assuming You have pre-installed the esp32 board manager.
Now select the correct COM port where your Uno (in this case) is
plugged in.
Select the correct board as mentioned
Tools>Board>ESP32 Arduino > select ESP32 Wrover Module
Some uploading setups are to be Done (Under Tools, these will only appear when the Wrover module is selected )
Upload speed -- 115200
Flash Frequency -- 40Mhz
Flash Mode -- QIO
Partition Scheme --- Huge App
Port ---- select the right com port for your breakout or UNO
JUST press upload and relax
After a while, you will be able to see this message
Leaving...
Hard resetting via RTS pin...
Disconnect the Esp32Cam GPIO 0 and GND
Power the ESP32Cam with 5/3v with external power supply (Arduino or other breakouts may not be able unless you are connected with a Powered USB Hub)
keep TX, RX, & GND of the 2 boards connected, don't disconnect Arduino Reset and GND.
Press Reset on ESPCAM and open Serial monitor and you will be able to see the IP address of the cam if it was configured with your wifi correctly.OR get any network scanner App on android or windows.
I hope it helped.
Pre-requisites for flashing:
ArduinoIDE 1.8.12
Core ESP32 1.04 (at time of writing)
Select board AI Thinker Cam
uplooad speed 921600
freq 240Mhz
flashfreq 80Mhz
mode QIO if not working try DIO
partition scheme default
Serial monitor is closed
NO hardware connected to the pins of the ESPcam
Make sure the USB cable is a data cable and NO loading cable only
check Windows device manager if programmer is shown and has max speed / 8n1 hardware
Connections
FTDI - ESP32
GND GND
5V 5V
TXD UOR
RXD UOT
If you use an AIThinker Cam clone you have to ground GIPO 0:
connect GPIO 0 with a dupont wire connected to GND
press reset
compile and upload (use AI THINKER CAM)
optional:
press reset
upload filesystem data (SPIFFS)
disconnect GPIO 0 and GND
press reset
code should execute
And yes you have to do it every upload, on my dev board I soldered a little switch with proper isolationSome more solutions from experience:
If there is still a problem use a 10K (or so) pull-down resistor between RX0 and GND (test on breadboard before soldering)
Pressing and holding (!) the boot-button while uploading on some "bad" boards
Happened with a "normal" ESP32 board to me - just to be sure - I got an ESP8266 in an ESP32 packaging. Configuring for the ESP8266 solved the issue of uploading.
In my case I forgot to remove the SD card. Other users recommended removing unnecessary connections to the pins-- and the SD card technically uses some of those :)
This was solved by using other jumpers. It seems one of the jumpers used in the wiring was faulty.
If you're having the same issue and tried everything in this post, try checking your cables!
Another solution here. Just to add, I tried everything on this QA, as well as many other things suggested online. e.g. tested by powering from 3.3V then 5V, various permutations of holding the reset button down and disconnecting IO00 from GND at the point of flashing. Changing various settings in Arduino IDE/
I was unable to flash a single one of the 5 ESP32-CAM boards I bought. Spent a good two hours on it. I even continuity tested every pin on the board to its ESP32 chip pad, and all the hookup wires were tested too. The board seemed fine.
Then I soldered a 100uF capacitor between 5V and GND, and used my USB-UART 5V power... tested and worked straight away. No need to pull out the IO00->GND connection and no need to press RST button on the board during flashing. (Of course, pull out IO00->GND after flashing complete.
So - it was a power problem.
I can only guess that the cheapo regulator they used on the copy of board that I got was not quite efficient enough, but basically that capacitor resolved the issue.
p.s. the ESP on board was marked "ESP32-S". I selected "AI Thinker ESP32-CAM" in Arduino IDE as suggested by most people online, and this worked.
There are 3 pins marked GND on the ESP32-CAM board. Buuuuut (!) the one marked GND/R just by the U0T is NOT connected to other grounds or anywhere else I could had find. Check with a multimeter and use a REAL GND. It just worked for me after days of puzzling.
If you try it with arduino it works but its needed to press reset button on esp32 before you upload your code
Basically I was facing the exact same problem fro quite some time. What worked for me was that as the chip was flashing, shifting the power wire from 5V to 3V3 pin. I do not know why but it workes. When esptool starts flashing at 2%, switching the cable just then, despite having 5V from supply into the 3V3 point made the flashing successful. I do realize this is probably a bad answer to your problem since it involves oversupplying voltage to the chip on the wrong point as it is flashing and could damage the chip. However, if anyone is tired of debugging and are at the point where you are considering throwing the chip away, might as well try my method. For other's who value their chip, don't try this method and if you still do, kniw it is at your own risk. But it worked for me after 3 days of just messing around with connections.

ESP8266 turns off after some time

I have a ESP8266 wifi module connected to an arduino uno. On the ESP8266 I set up a socket server witch is working fine. And I can communicate with it as I expect.
After having run the ESP8266 some time (like 5-10 minutes) it automatically turns off (or goes into some kind of sleep mode. The LED turns off). I then have to re power the whole thing and reset it using the reset pin.
Why is my ESP8266 turning off and disconnecting from the WIFI?
Maximum current draw from this voltage regulator on the Arduino Uno is 50 mA. It's surely not enough for ESP8266.
You need a power supply with at least 700 mA to make sure it works properly (ESP8266 usually takes about 60 mA but according to my experience the current draw can be very high during the startup).

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

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".

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