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!

 

 

NO!!! I want to print more!!!! or Offloading octoprint timelapse videos

octo

I use octoprint to manage my printer.  When I can, I batch print.  I will literally print things back to back. But I also love the timelapse and we have all seen it….warning

 

But I have more robot stuff to print!!!!

Settle down there smart guy.

Nobody asked you!

Ok, interruptions aside.  Running octoprint on an original pi is a little slow.

Did you say apple pi?

captain-picard-facepalmI don’t like this guy.

I said ORIGINAL pi.  Yes, old school slow.

So what happens if you try to print again while it’s rending a timelapse… well, you get a lot of stalls on the print, meaning the head sits over the print causing some unnecessary melting.

So how do you fix it if you are so smart?

Well, you would offload it.  I have a linux box that handles all sorts of random tasks.  It could do it.

So here is how I offload it.

  1.  setup an NFS share to a nas/other server
     192.168.X.XX:/mnt/vol/dataset1 /home/pi/fs nfs nouser,atime,auto,rw,dev,exec,suid 0   0 
  2. Configure octoprint to store the timelapse pics on this NFS share.paths
  3. All that is doing is changing the location of the timelapse, not offloading jerk.
    I KNOW!!!  I’m not done!
    Sorry
    So now we need to setup the exact same share on the other linux box.  If I had thought about it early on I would have changed the path on the pi to be something like /media/share/ instead of /home/pi/fs
    So we put the same path on the other linux box.
    (see 2.)
  4. Now the fun stuff.
    Finally!
    I created a small shell script on the PI.

    #!/bin/bash
    ssh root@192.168.X.X "ffmpeg $@"
    if [ $? -eq 0 ]
    then
    # everything was good
    exit 0
    else
    exit 1
    fi
    
  5. Set up your pi to be able to login with no password (using keys instead) so that the ssh connection will not hold anything up.
  6. Configure octoprint to use this new script as your ffmpeg path.
    2016-11-07-19_03_42-octoprint

So let me walk you though it.

Good idea.

Are you being nice all of the sudden?

No.

Anyway.  So octoprint is now setup to store your timelapse images on the network somewhere.  Linux box is setup to have the exact same path.  When your print is done octoprint executes the timelapse.sh script thinking that is ffmpeg.  So it runs it waiting for it to exit with a success or failure.  So in the script, we ssh to the linux box, tell it to run the ffmpeg with the $@ which means everything octoprint wanted to pass to ffmpeg locally we are passing to the remote ffmpeg.  The other box does all the heavy lifting and returns an exit code, we pass that exit code back to octoprint.  It’s none the wiser.

The cpu is next to nothing because we are just waiting for the ssh command to finish.  So I have started additional prints with minimal issues.

I have noticed that if you keep your filenames short and sweet it helps.

Is this a great solution or what?

No.  Buy a better pie.

Don’t you mean a “pi?”  Haha.  Jerk.

pievpi

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?

 

 

Some projects and upgrades

So I have a few things on order coming from china for some various projects.

I figured since I haven’t posted much lately I will post some pre-project dribble.

Phoenix Connectors – Aliexpress

phoenix connectors I have these coming to be able to connect audio up to my ClearOne XAP800.   ClearOne XAP-800 Professional Audio Conferencing System Pic 4 xap800_l

The XAP800 is going to be added to my Home Automation system to be able to control/mix/route audio from various sources to various destinations.  If you want to read more about what this can do check out my buddy here.

http://hazymat.co.uk/2015/04/multi-room-audio-options/

 

3d Printer Upgrades

Its funny.   The whole time I have had my printer I have been constantly wanting to upgrade.  Maybe because I built my printer from a kit and know each piece.  I look at upgrades thinking, this will help just a tiny bit more.  This will make it a tiny bit better.  But also, I enjoy these projects.  So I have what I can only hope are my last big round of updates.  Nevermind.  I just thought of one more.  Bowden extruder…. but that’s for another post.

Motor Coupler – Aliexpress
The motor coupler is going be to used to connect my 5mm drive shaft to my below 8mm threaded rods.

Lead Screws w/ Copper Nut – Aliexpress
Replacing my current threaded rods and nuts with some nice thick Lead screws and longer copper nuts should add some additional stability and durability in that I won’t have to replace the nuts regularly like I do now.

Aluminum Build Plate – Aliexpress
The aluminum build plate will replace my glass bed.   I have hard it does well for heat distribution but also I need it for the below proximity switch.

Induction Proximity Switch – Amazon
I am going to get rid of current auto level setup.   I am going to the inductive sensor so there is no longer going to be a swinging arm.  This will hopefully improve start up time, and keep better accuracy.

shoppingUT82quJXalbXXagOFbXSReprap-Prusa-i3-3D-printer-parts-Anodized-Aluminum-BUILD-PLATE-for-Heated-Bed-3D-Printer-RepRap.jpg_640x64061fxf9nPCFL._SL1100_

 

Random

20 555 Timers – Aliexpress
ne555I have these 555 timers coming because I plan to use them on a small solar charge controller project I need for my Green Sprinkler system Project.

 

100 Optocouplers – Aliexpress
111781498246_1A couple weeks back I designed and tested a small circuit that will detect when the 12v accessory line in my car is turned on and off.  Using these optocouplers I will be able to use this signal to either power on my raspberry pi in my car, or to tell it to turn off.  This is going to be useful so that the pi doesn’t turn off as soon as I get home, but will be signaled to turn off in about an hour.  This will give enough time for sync jobs to run, backups and any config changes I want to do.

So there it is.  Some of my up coming projects

  • Big Printer upgrade
  • Solar Charge Controller
  • CarPi Power circuit deally (i need a better name)
  • Green Sprinkler System
  • Home Automation Audio Router

juggling-businessman-image

This guys has his shit way more together than I do.  Look at him!  He’s wearing a suit….  I barely wear pants!!!!

 

 

 

 

 

 

MineCraft Nightlight Christmas Present

Ok, so my son is 8 and that means he automatically likes Pokemon and minecraft.
He also likes anything with LED’s (geek in training I believe… blinky oooooh shiny…. sorry, distracted.)

So awhile back I came across this post BLE controlled Minecraft nightlight.  I figured, this is perfect.  So I started order some parts (making a few changes of my own along the way) and printed out the cube and base.

Parts:
Adafruit Pro Trinket – 3V 12MHz
Adafruit Neo Pixel Strip
Capacitor
3d Printer
Adafruit BlueFruit LE Bluetooth module

 

2015-12-16 17.56.55

 

2015-12-16 17.57.19 2015-12-16 17.57.23

I then soldered up the led strips I had from a different project.  Finished wiring everything up based on Mr. McMillan’s guide.  One of the changes I made was I needed to make a different base piece.   The cover originally designed required some larger feet than I had for it.  So I designed a new piece.

Here is the alternate piece.  Thingiverse

2015-12-16 21.00.042015-12-16 21.00.012015-12-16 20.59.592015-12-16 20.23.34

Had an issue the weekend before christmas and had to order some replacements.  So here I was Christmas Eve soldering everything up.

2015-12-24 16.57.26

And I got it all working just in time.  So Christmas morning it was sitting beside all the presents already lit up.  I didn’t get a pic of it under the tree.  Kind of wish I had.  But here is a pic of it light up on my desk.

2015-12-24 17.50.24