Nano running servo and voltmeter

I have a servo running from a nano. Im planning on connecting it to a lipo battery pack. To do so, Ive wired up this:

servolcd.png

The servo runs off pin 8. Here is the sketch. For some reason now my servo stopped working:

#include <LiquidCrystal.h>
#include <Servo.h>
Servo servo1;
int servo1pin = 8;
int angle1 = 0;
float tempVoltage=0.0;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup(){
   lcd.begin(16, 2); 
   lcd.setCursor (0,0);
   lcd.print(" Arduino based ");
   lcd.setCursor(0,1); 
   lcd.print("Digital Voltmeter");
   delay(2000);

  Serial.begin(9600); 
  Serial.println("Voltemeter test!");
  servo1.attach(servo1pin);
}

void loop(){
  // Servo #1 ~ 2.5 secs
  for(angle1 = 0; angle1 < 180; angle1++)  { 
    Serial.println(angle1);                                 
    servo1.write(angle1);               
    delay(25);                   
  } 

    servo1.write(90); //recenter servo

    readVoltage();
}

void readVoltage(){
  int analog_val=analogRead(A0); // read A0 and store it in analog_val
  tempVoltage = (analog_val * 5.0)/1024.0;
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("V=");
  lcd.print(tempVoltage); //print v to LCD
}

Hi,

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

I have circled your problem, the power lines down the side of the protoboard are open there, you need to jumper them to get power to your servo.
servolcdeee.jpg

Tom... :slight_smile:

servolcdeee.jpg

Or re-position the red and black wires from the servo connector to the "rails" of that other half (on that same side).

My power lines to the servo are the cables on the far left. What do you mean they are not connected? Theyre both on the bottom rail. I have nothing on the top rails.

Marciokoko: My power lines to the servo are the cables on the far left. What do you mean they are not connected? Theyre both on the bottom rail. I have nothing on the top rails.

There is no connection between the left hand side and the right hand side of the rails. See the Blue and Red lines. They are indicating the connections and they do not run the whole length

Hi, Measure it with DMM, the side rails are open at the point circled.

Tom.. :)

Thanks

BTW, "Everything runs on smoke, let the smoke out, it stops running...." too funny!