3dprinted Robot Mower Part 2 Finally Out!

I finally finished editing part 2 of the mower video.  Had some technical difficulties with the footage but finally was able to get something out.

 

I am out of work this week on vacation and hope to get more done on the mower and try to get it test running.

 

18650 Battery capacity checker

Some of you know, I really like lithium ion batteries

*shocked*

Shut it!  This is a short post, I don’t need you hamming up the works.

Just wait till I show up in your videos….

You wouldn’t….

Hello….

Oh hell…..

Ok, lets not worry about that now.

I picked up a pretty sweet haul of batteries this week.

 

 

 

 

22lbs.  I counted 107 2cell packs.  214 cells to check out.  This is great, but I have a single opus charger that can do 4 cells at a time.

So 214 cells will take some time to process.  I have done that game.  So I wanted to do more cells.  There are examples online of doing this with arduino’s and what not and since I am big fan of arduino’s anyways I decided to give that a shot.  I built it out initially with an arduino uno.  Using the awesome guidance of Adam Welch.  If you don’t know who Adam is, you gotta check out his work.

Website: http://adamwelch.co.uk/ 
Youtube: https://www.youtube.com/channel/UCm5sG3-BXQZfVy3st2T_XKg

His work I used for this is here.

I modified the code a little as I didn’t have that screen.  I have a 20×4 screen.  I also updated mine to calculate the voltage reference from the internal 1.1v reference.


/*
* Battery Capacity Checker
* Uses Nokia 5110 Display
* Uses 1 Ohm power resister as shunt - Load can be any suitable resister or lamp
*
* YouTube Video: https://www.youtube.com/embed/qtws6VSIoYk
*
* http://AdamWelch.Uk
*
* Required Library - LCD5110_Graph.h - http://www.rinkydinkelectronics.com/library.php?id=47
*/

#include <LiquidCrystal_I2C.h>
#define gatePin 2
#define highPin A0
#define lowPin A1

boolean finished = false;
int interval = 5000; //Interval (ms) between measurements

float mAh = 0.0;
float shuntRes = 1.0; // In Ohms - Shunt resistor resistance

float current = 0.0;
float battVolt = 0.0;
float shuntVolt = 0.0;
float battLow = 2.9;

LiquidCrystal_I2C lcd(0x27,20,4);
unsigned long previousMillis = 0;
unsigned long millisPassed = 0;

void setup() {
analogReference(INTERNAL);
Serial.begin(115200);
lcd.init(); //initialize the lcd
lcd.backlight(); //open the backlight
Serial.println("Battery Capacity Checker v1.1");
Serial.println("battVolt current mAh");

pinMode(gatePin, OUTPUT);
digitalWrite(gatePin, LOW);

lcd.setContrast(68);

lcd.clear();

lcd.print("Battery");
lcd.print("Check");
lcd.print("Please Wait");
lcd.print("AdamWelch.Uk");

delay(2000);
lcd.clear();
}

void loop() {
voltRef = readVcc() / 1024.0;
Serial.print("Volt Ref: ");
Serial.println(voltRef);
battVolt = analogRead(highPin) * voltRef / 1024.0;
Serial.print("Batt Vol: ");
Serial.println(battVolt);

shuntVolt = analogRead(lowPin) * voltRef / 1024.0;
Serial.print("Shunt Val: ");
Serial.println(shuntVolt);
Serial.println();
Serial.println();
/*
Serial.print(battVolt);
Serial.print("\t");
Serial.print(current);
Serial.print("\t");
Serial.println(mAh);
*/
if(battVolt >= battLow && finished == false)
{
digitalWrite(gatePin, HIGH);
millisPassed = millis() - previousMillis;
current = (battVolt - shuntVolt) / shuntRes;
mAh = mAh + (current * 1000.0) * (millisPassed / 3600000.0);
previousMillis = millis();

lcd.setCursor(0,0);
lcd.print("Discharge ");
lcd.setCursor(0,1);
lcd.print("Volt:");
lcd.print(battVolt);
lcd.print("v ");
lcd.setCursor(0,2);
lcd.print("Current:");
lcd.print(current);
lcd.print("a ");
lcd.setCursor(0,3);
lcd.print(mAh);
lcd.print("mAh ");
lcd.print("Running ");



}
if(battVolt < battLow)
{
digitalWrite(gatePin, LOW);

finished = true;



lcd.clear();
lcd.print("Discharge");
lcd.print("Voltage:");
lcd.print(battVolt);
lcd.print("v");

lcd.print(mAh);
lcd.print("mAh");
lcd.setCursor(0,1);
lcd.print("Complete");


}
delay(interval);
}

long readVcc() {
long result;
// Read 1.1V reference against AVcc
ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
delay(2); // Wait for Vref to settle
ADCSRA |= _BV(ADSC); // Convert
while (bit_is_set(ADCSRA,ADSC));
result = ADCL;
result |= ADCH<<8;
result = 1126400L / result; // Back-calculate AVcc in mV
return result;
}

Next step is to add a “charging” function with a tp4056 so I can charge then discharge.

 

Amazon – 5 for 6.95

Ebay – 10 for 4.95

Aliexpress – 10 < 2 bucks.

 

Once that is working I should be able to add a couple more modules.  I have been really looking towards doing something with Brett Wattys 8 module charger.  That things is INTENSE!!!

If you want to see all the info check out the secondlifestorage forum.

https://secondlifestorage.com/t-Brett-s-Arduino-8x-Smart-Charger-Discharger

He also has a portal he is setting up to help aggregate some numbers on how many cells the community has recycled.

 

 

Until later!!!

bye!!!!

3dprinted Robot Mower – part 1

 

3dprinted Autonomous Robot Mower – part 1

Welcome to part one of me trying everything I can to not have to mow…. After avoiding mowing for a bit I needed to find a better solution.

In my slightly concussed state I came up with it. A 3dprinted robot mower!!

Using printed and electrical parts from http://www.reprap-windturbine.com/index.php?id=20&L=1 I am building my mower.

My firmware will tie in to my home automation system so the system will control mowing times based on times/weather conditions ect.

 

 

Bike generator for 18650 battery packs – Part 1

Part 2 of the Bike generator for the 18650 battery packs. In this one we build the mounting frame for the treadmill motor, 3dprint an axle connecting sleeve and do some tests with the multimeter to see what kind of voltage we can!. Getting closer to starting to record power generation data to the home automation system!

 

 

Bike generator for 18650 battery packs – Part 1

Welcome to part 1 of the bike generator build.

This build will add a pedal powered bike generator to help charge my 18650 battery packs. This will be in additional to the small solar panel currently in use.

The charge controller and statistics will be build on an arduino controller and tied in to my openhab home automation system for tracking and graphing.

The controller will connect wirelessly using mysensors and an nrf24l01 radio.

 

Time lapse in new printer enclosure

surprised-rainbow-faceSo awhile back I came across an instructables article regarding using some ikea lack tables to make a 3dprinter enclosure…..

I love ikea….

So this was the project.  http://www.instructables.com/id/3d-Printer-Enclosure-from-Upcycled-Furniture/

I went to ikea.  Got 2 lack tables and put them together…. I want my printer higher up.  ELEVATE TO THE LEVEL OF THE GODS!!! no.  just high enough I can watch it cause I like to watch it go back and forth while I make printer noises.

So I ordered a 3rd table.  Put it on top.  Sweet.  Much better.  I moved the printer into the enclosure this weekend (no sides put on it yet) and decided I needed to get the lighting in place.  So I took some neopixel strips I had laying around and hooked them up to an arduino.

13694706_1455593267790887_1215760066_nOk, so that’s now how I am leaving it 🙂  but it did look cool.   Now I can set the colors.  Plain white for printing.  I am trying to figure out how in octoprint to get a hook in to detect when it’s heating up.  That way I can turn the lights orange or red to indicate heating phase.

 

 

So I did a timelapse and a vid.   The vid of the whole rig setup

Here is the timelapse test print

 

I am working more on trying to get some good photo and video in with these projects too.  If you like the videos give a thumbs up and a subscribe.

OpenHab Wall Switch

So recently I started thinking about my HA system when I have guests.  I have a small house (not a tiny house) just a small house.  When my parents visit they setup camp in the living room.

vYtvpWpWorking on getting PIR motion sensors to turn things on and off.  But with guests, I need a guest mode to disable the motion sensor…. and not because I tend to dance in front of the motion sensors.

 

 

89b1c00006954836a703dfc0457c8626But with the motion sensors disabled.  There still needs to be a way for the folks to control the lights.  So I started thinking.

What I came up with was physical buttons, pass something to mqtt, then to openhab.  Openhab rule to control “group” of lights aka living room.

So time to start proto typing some things.  First I wanted to see if I could somehow make it work without putting holes in the wall.   WAF = 10 on that one.

2016-06-12 17.31.52So I started by 3d printing a light switch blank panel.  It’s a rough print, but needed to see if I could make it deep enough to put some triple A batteries to run it.

Once I tested some depth I was happy.

Frank-GrimesNext to build build some electronics.

 

So I broke out the good old arduino uno.  This is my go to for initial builds even though I usually end up with a pro mini in the end.  The uno is a great test bed.

So it started out with Uno + Ethernet Sheild + 2 buttons.

2016-06-12 12.53.39-2

 

I ended up adding just a notifcation LED just so I know once it’s connected to MQTT since I am not watching via serial monitor now.   2016-06-12 17.34.42So what does this get us now?  Well.  It boots up.  You press one button, all the lights in the living room turn on.  Press the other and they turn off.  I know what you’re thinking.  So what?

One of the lights is a phillip hue light.  The other is controlled via z-wave.  So how did I do this.  Lets start with the item definitions in openhab.

//Group Definition
Group gLivingRoomLights

//Items
Switch Switch_LivingRoomStandingLight "Living Room Light"     <light> (gLivingRoomLights,gDashboard) { zwave="2:command=switch_binary" }
Switch LivingRoomTableLight   "Living bulb" (gLivingRoomLights,Switching) {hue="1"}

//Dummy ITEM that is set via mqtt
Switch LivingRoomLights "Living Room Lights" {mqtt="<[mqtt:switches/livingroomlights:state:default]"}

So in my items file, I have the 2 light items and a dummy switch.  Notice the 2 light items are in the “gLivingRoomLights” group.  This is important.

Now for the rules.


rule "Living Room Lights"

when
Item LivingRoomLights changed
then
if(LivingRoomLights.state==ON)
{
gLivingRoomLights.sendCommand(ON)
logInfo("All Living Room Lights","ON")
}
else
{
logInfo("All Living Room Lights","OFF")
gLivingRoomLights.sendCommand(OFF)
//off
}
end

So this rule is triggered when the Dummy Switch (LivingRoomLights) changes.  If the state was changed to ON then i send the “ON” command to the entire group.  Same for when I turn it off.  So to test it I used mqtt-spy and manually did it.  All is working.

k16232506

What’s next is I am going to work on shrinking said project down to using an arduino pro mini, 2 AAA batteries.  For the network transmission I am back and forth between 2 options.

  1.  esp8266 – using the esp is great, but it’s not very forgiving on power.   I know there are deep sleep modes, but they aren’t really good for what I need with multiple buttons.
  2. nrf24l01 – RF modules.  These little suckers are really easy on the power.  If I use these I have to build a rf->ethernet bridge.  But with these I think the power consumption is much simpler.

Either option I go with, I can use a pro mini and have 2 interrupts I can attach to buttons.

Down the road if I need more buttons, I can use a pro micro and get something like 14 interrupts and still be able to use deep sleep.

iphone-battery-iconIf I wanted to cut holes in the wall and run cable I wouldn’t be as concerned with the battery levels.

 

 

 

Want to see it being tested?