Got this board cheap from Banggood, but there are minimal details on how to use it.
There is a manual here https://www.gitbook.com/book/smartarduino/user-manual-for-2-way-motor-16-way-servos-shield/details , but it is a long way from detailed, and what I need are some details on how to drive the I2C PWM servos.
After some poking around, I have a partial answer.
The Adafruit libraries seem to work fine for the servos.
https://learn.adafruit.com/16-channel-pwm-servo-driver/using-the-adafruit-library
Motors on this version of the board have the following controls:
D6 PWMB - speed channel B
D7 DIRB - Direction Channel B
D8 PWMA - Speed Channel A
D9 DIRA - Direction Channel A
... which may explain why the speed control is working on channel B but not A, since pin 8 is not PWM on a UNO. (May also explain why it is cheap)
Also note that you need to supply a separate 5V to 18V power to the VS connector to drive the servos. I used a 6v battery pack.
Also note that the on-board power switch did not appear to affect power to servo, so a power switch for the servo power is probably also useful.
External power source is required only at VM & GND terminals if jumpers are shorted both at VM+VIN and VS+5V, VM will have the same voltage as input power and VS (servo voltage) will be 5V derived from VM input, not from UNO board. That is what the user manual means by single power source, which input is at VM terminal. OPEN all the jumpers will need individual power source for VM and VS separately.
Related
I had an ESP32cam working for a few days then started getting that message at boot up. Reloaded the program and still no camera.disappointed
Error:
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6364
entry 0x400806b8
Brownout detector was triggered
Serial monitor
Camera label:
HW-297
OV2640
In program:
#define CAMERA_MODEL_AI_THINKER
Board selection:
ESP32 Wrover Module
Board selections
Brownout detection is a hardware feature that shuts down the processor if the system voltage is below a threshold, also known as the "brownout voltage". This is to preserve memory contents and avoid corruption.
You are getting this message because your board is not correctly powered. The underlying reason could be one of many things:
The USB cable is of poor quality, or too long.
Your computer's USB port cannot supply enough power to the board.
The ESP32Cam is defective
Other components in your circuit are not correctly wired up, affecting the power supply.
I would try to power the ESP32Cam with another USB cable, a different computer, or an external 5V power supply. If all of that doesn't help, it could be that your board is broken.
Another option is to disable the brownout detector.
#include "soc/soc.h"
#include "soc/rtc_cntl_reg.h"
// in setup()
WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0);
I had this issue as well. I solved it by taking the following steps:
I originally had the ESP32-CAM powered off the 3.3V supply from my FTDI, but I then found it works better when supplied by 5V.
I had to jumper together the two pins marked in magenta to program the ESP32-CAM and then remove the jumper when I wanted the board to actually run:
I had to select the "AI Thinker ESP32-CAM" in the Board Manager:
i had terrible brownout issues. struggled for days - tried everything on the forums.
Solution - just connect the desktop power to the esp32-cam and all my troubles disapeared.
seems the esp32-cam runs so close to the 5v power limit, that 5v from a desktop power supply is required when connected to the computer's usb port. not quite enough power and that makes all the difference.
TLDR; Atfer programming, power the camera module from a good quality external 5v power supply, plugged into the 5v pin on the module. You should try to remember to disconnect the pwr from the programmer once programming is complete - the serial monitor will still work.
I had a similar experience to Clive, lots of problems when booting but in my case, the BROWN OUT message didn't always appear and often just the camera init failed.
In the end I powered the 5v pin on the module from a 5v supply and tried to remember disconnect the pwr pin from my 'FTDI' programmer. I forgot often and no damage appears to have occurred.
Every online guide I saw has pwr from the programmer going to the 5V pin on the module even though when jumpered for 3v3, the programmer VCC is at 3v3. I connected it to 3v3 on the module instead though this didn't fix the brownout issues.
I'm currently trying to burn the pinguino bootloader in a pic32mx250f128b which is 5V tolerant with an arduino uno. I'd want to try pic32 chips, but I haven't a pickit3 now, I can only access to pickit2.
So to burn the bootloader I'm using an arduino uno, and use the bitbang sketch from pic32prog to try to burn it.
For the wiring I did this :
All VDD and the VUSB3V3BUS pins are wired to the 3V3 regulator of the arduino uno.
All VSS pins are connected to the ground of the arduino uno.
Arduino D2 (PGC) is directly connected to PGEC1
Arduino D3 (PGD) is directly connected to PGED1
Arduino D4 (MCLR) is directly connected to MCLR
But actually, when I launch pic32prog I always have this output :
Programmer for Microchip PIC32 microcontrollers, Version 2.0.218
Copyright: (C) 2011-2015 Serge Vakulenko
(ascii ICSP coded by Robert Rozee)
Adapter: ... OK1 OK2 - ascii ICSP v1E
No target found.
I tried also with the couples PGEC2/PGED2 and PGEC3/PGED3.
I haven't tried to use a crystal yet, but I think from what I read it's not needed for ICSP programming.
For now here is what I've done on my breadboard :
photo of the pic on the breadboard
I don't know what could cause this detection problem,
Thank you very much for your help :)
Edit : I tried several things and here is where I am :
I added the pull-up on MCLR, capacitors on VDD pins, and others recommended : Still the error No target found.
I saw that pic32prog add compatibility with pickit2 so I tried it : this time the pic is detected but I get this error : Unknown CPUID : ffffffff. I tried also with a new pic32mx250 on the pickit2 to be sure it wasn't the first which was damaged.
Finally to recheck my connections I found another version of the datasheet. In this one it seems that PGECx and PGEDx pins aren't 5V compatible... -> So I'll test with 3.3v compatible circuit this time
you need 3k3 pullups to the 3v3 supply rail on both PGC and PGD. these two outputs are 'open collector' (simulated) and the 3k3 resistors define the logic '1' voltage fed to the PGC and PGD pins of the target PIC32.
as mentioned by others, you also need a 10k pullup on MCLR. in addition, you need to ensure that all Vcc pins (13 and 28) are connected together, all ground pins (8, 19 and 27) are connected together, and that there is a 10uF low ESR ceramic capacitor from pin 20 to ground (a 22uF tantalum will do).
see the "ascii ICSP construction guide" article here:
http://www.thebackshed.com/docregister/Browse.asp
the article includes a schematic of what is required.
cheers,
rob :-)
the 10uF low ESR ceramic capacitor on pin 20 is crucial. pin 20 connects ONLY to this capacitor, nothing else. without it, the core of the PIC32 will not run and programming will be impossible.
the reason for this is that the core of the PIC32 runs at 1.8 volts, and the capacitor on pin 20 is part of the circuitry that generates this supply. in your photo it looks like pin 20 is not connected to anything.
cheers,
rob :-)
I am working in a project which requires me to read the velocity of a DC motor with a quadrature encoder. I am using the Arduino UNO board and for some weird reason the motor just works if it is connected to the pins 2 and 3. However this pins are reserved for the interruption (where I intended to connect the encoder). How could I solve this problem?
Assuming the arduino can provide enough current, you should be able to run the motor from any output pin, check out this diagram for reference. You should also make sure you have the necessary protection circuits in place. This is a good starting point: https://create.arduino.cc/projecthub/licensedGeek/controlling-a-dc-motor-from-an-arduino-101-board-f4954b
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.
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".