A-star 328PB board shorted??

Hi,

Working on a project, to have a servo motor have the arm on 0 degree when a button is pushed, en 180 degree when that same button is not pushed.

Having a A-star 328PB board connected, and a switch with a 10K resistor.
Seems to work fine when I used a separate power source (negative connected together)
Afterwards I connected it all to one power source, and I still worked fine, but after pushing the button for a longer amount of time the lights on the board were going out, and board was hot, and not working anymore.
This happened twice 3,3V and 5V boards)

Did I do something wrong in the code? or is there something what I not have done right?

thanks in advance for your help.

Regards Arjen

code:

#include <Servo.h>
Servo myservo;  // create servo object to control a servo
int angle =90;    // initial angle  for servo
int angleStep = 10;

int RIGHT = 2;  // pin 2 is connected to right button

void setup() {
  Serial.begin(9600);
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
  pinMode(RIGHT,INPUT_PULLUP);// assing pin 2 as input for right button
  myservo.write(angle);// send servo to the middle at 90 degrees
}

void loop() {
  while(digitalRead(RIGHT) == HIGH){
    if (angle > 0 && angle <= 180) {
      angle = angle - angleStep;
       if(angle < 0){
        angle = 0;
       }else{
      myservo.write(angle); // move the servo to desired angle
      Serial.print("Moved to: ");
      Serial.print(angle);   // print the angle
      Serial.println(" degree");
       }
    }
   
  delay(10); // waits for the servo to get there
  }// while

  while(digitalRead(RIGHT) == LOW){
    if (angle >= 0 && angle <= 180) {
      angle = angle + angleStep;
      if(angle >180){
        angle =180;
       }else{
      myservo.write(angle); // move the servo to desired angle
      Serial.print("Moved to: ");
      Serial.print(angle);   // print the angle
      Serial.println(" degree");
       }
    }
   
  delay(10); // waits for the servo to get there
  }
}

Hi,
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom... :slight_smile:

This is my Setup

Okay, we know that code can't make your board run hot. So please post a schematic drawing instead of trying to describe the circuit verbally. It sometimes helps to also post images of the actual hardware.

Edit - That shows the circuit. It appears correct, although the A-star pins are not labeled. I have to assume that you constructed it differently, so please post clear close up images of your actual hardware.

Hopes this helps.




Great, how about a link to the board you're using. It's not very common. I would like to know what the pin out is.

aarg:
Great, how about a link to the board you're using. It's not very common. I would like to know what the pin out is.

Using pin 2 and Pin 9

You seem to be powering from the BAT pin. Is that correct? What voltage are you applying there? According to Polulu, it has to be at least 5.5V.

aarg:
You seem to be powering from the BAT pin. Is that correct? What voltage are you applying there? According to Polulu, it has to be at least 5.5V.

For the 3,3V its "regulator that can be powered from 3.8 V to 15 V supplies"
for the 5V its "regulator that can be powered from 5.5 V to 15 V supplies."

Yes I used a battery, but also used a travo and set it on 4,6V to power the 3,3V board and Servo
Seems that the servo only works correctly around 4,6V

Sorry, what is a "travo", other than a, "comune (municipality) in the Province of Piacenza in the Italian region Emilia-Romagna"?

"a battery"... details please...

Is your board 5V or 3.3V?

aarg:
Sorry, what is a "travo", other than a, "comune (municipality) in the Province of Piacenza in the Italian region Emilia-Romagna"?

"a battery"... details please...

Is your board 5V or 3.3V?

Sorry, power reducer from 220V to 4,6V DC
(we call it a travo in Holland)

I used both the boards, but last setup of power was with the 3,3V board

koekwous:
travo

Transformer. "Transformator" in Dutch, or "trafo" for short.

Try using the 5V board, and apply your 4.6V power to the VCC pin instead of the BAT+ pin.

aarg:
Try using the 5V board, and apply your 4.6V power to the VCC pin instead of the BAT+ pin.

I will try.
What should be different putting power on the VVC I.S.O. BAT+ ?

Don't have to much knowledge of this electronics, and is only a small part of a larger project I am working on, but its interesting stuff. :slight_smile:

Hi,
Schematic of OPs 328 board;

Tom.... :slight_smile:

This board is a little different than most, I was not aware of VCCIN, you should probably apply your 4.6V to it, not VCC.

Pololu User guide:

The VCCIN pin on the A-Star 328PB Micro serial header functions as a secondary power input for VCC that bypasses the regulator. To avoid unexpected behavior, it is important for the VCCIN voltage to match the regulator voltage on the version you are using. (Supplying a higher voltage to VCCIN raises the logic voltage of your system, and supplying a lower voltage can result in a brownout reset and/or violate the maximum frequency vs. VCC specifications in the ATmega328PB datasheet.)

Anyway, I’m quite sure you are underpowering it if you apply 4.6V to VIN.