Social

Social

Social

Sunday, January 24, 2016

Automated Worm Bin Progress: Part 2

See Part 1 of my notes for the first steps.

I have nearly completed building my worm bin.  The temperatures have been too cold to get glue to dry to finish some details. Meanwhile, I will work on the technical portion of the worm bin's temperature monitoring.

nearly complete worm bin with heater rack in foreground

I have the soil temperature part working well.  The soil sensor is collecting the temperature and displaying it on the graph on the bin's home page.



The soil temp line is brown on the graph but shows as grey with the other color settings being a little transparent.  You can see on the far left, I had the probe on an ice pack to help me see that it was there (otherwise it would be almost the same temp at the air).  Near the very end (right), there is a blip up where I held it in my hand for a couple of seconds.

I had to edit a few of the step 1 and step 2 files to get the second sensor working with the others.

I modified the step 1 python script (temperature-and-humidity-to-csv-logger.py) to include some of python code from step 2:
http://pastebin.com/t16z5Agf

You will need to edit the line:
soil_temp_sensor = '/sys/bus/w1/devices/28-000006c3a429/w1_slave'
To match your sensor's id see the step 2 tutorial link.

I also edited the public/index.html file to handle the new sensor info:
http://pastebin.com/40dsmaPU

Be sure to restart everything (the web server or Raspberry Pi) to make sure it all works.

Now would be a good time to make a backup disk image if you are following along.

Measuring Soil Moisture


I now would like to measure the soil moisture.  This seems to be a bit trickier to find a sensor that will work with Raspberry Pi and Python.  There are some tutorials on Arduino moisture sensor ideas.  This project uses both Aruino and Raspberry Pi for monitoring crops.

So far, this combined temp and soil moisture sensor might work (a bit pricey):
https://www.adafruit.com/products/1298
Seems to work with Arduino but not sure about a Python.  I did find python library for it which might work :
https://pypi.python.org/pypi/rpiSht1x

There are also some projects that show other options that look interesting:

This Instructable looks really interesting because it gets into many more elements beyond just monitoring and looks at reacting to conditions.
http://www.instructables.com/id/Environment-Control-System/?ALLSTEPS

http://computers.tutsplus.com/tutorials/build-a-raspberry-pi-moisture-sensor-to-monitor-your-plants--mac-52875

http://jenfoxbot.blogspot.com/2014/09/raspberry-pi-soil-moisture-sensor.html

I have a few other related projects to work on.  I'll take a break on the technical part of my worm project for now and think about the moisture sensing a little more.   I need to finish my worm bin construction, put some worms in it, and install on outdoor wireless access  point to connect to the the Raspberry Pi from the comfort of my house (200 feet away).

I hope what I have done so far gets you started.  If you have any improvements or other ideas please let me know.

Friday, January 22, 2016

Make a Rasperry Pi Worm Bin Monitoring System

I have 10 horses generating manure every day, so I am curious about using that for feeding my earthworms.  I will be exploring other feedstocks too.

I am building this OSCR flow through bin pictured, and I want to get email or text alerts when things are not ideal so I do not kill my worms and I have the most efficient system possible.

I also want to know how well the bin design functions.  For example, does the insulation work well in summer and winter or does it work less well in summer?  If I add some frozen water bottles in the heat of summer how much will it impact soil temp?

unfinished OSCR worm
bin
Incidentally, my bin now is painted and has insulation panels inside as well as  a heating tray for under the soil.  I'll post more on that later.


Building the Monitor

Monitoring web page charts worm bin exterior temperature and percentage humidity after step 1 below.

There are many ways to do the tech part of things to setup a worm monitoring system.  You can choose from Raspberry Pi, Arduino, and other micro controller boards to get started.  I chose Raspberry Pi because I am comfortable with Linux and can cobble together a little Python code.  Additionally, there seems to be plenty of libraries for the various sensors available.

I basically I want version 1 of my monitor to tell me my outdoor temp, soil temperature, and soil moisture level.  PH might be nice too.  I am very experienced with technology in general and much less experienced with worms and Raspberry Pi and sensors.

Eventually I may want to automate feeding or watering but I must take baby steps.

This is not a finished tutorial, but rather a document of what I am currently exploring.  It's purpose is to help me remember my steps.  You might find some inspiration to get started making your own monitoring solution.  I may not have technical answers to your Raspberry Pi or sensor questions but it does not hurt to ask :-)

What you might want to buy:

A Raspberry Pi board.  Raspberry Pi is much different than an Arduino.  A Raspberry Pi can run a full operating system cheaply (including Windows 10).  I use an older Raspberry Pi B+ but would prefer new faster model 2.   Get a  power supply for it too.

There are many temperature sensors out there.  My favorite place to browse for them is Adafruit, but some of the prices on Amazon are better.  Adafruit has a nice looking sensor for soil temp and moisture for around $50.

Other things to consider...
HINT: You may want to save yourself some grief and periodically make a backup image file of your work.  (Like after step 1).  Just use the same software you used to transfer your raspian operating system to the card from step 1.

Basic Steps 

Keep in mind that I just started this project so I will modify this post or add more posts as I make progress.

Step 1 Adding Air Temperature/Humidity Sensor

You can follow this home automation tutorial to get the basics up and running with ambient temperature sensor first.  I did not need the humidity functionality but decided to use it anyway.
http://www.home-automation-community.com/temperature-and-humidity-from-am2302-dht22-sensor-displayed-as-chart/

The Raspberry Pi B+ board has more GPIO pins than the original Raspberry Pi so I am always looking them up with this image:
http://www.raspberrypi-spy.co.uk/2014/07/raspberry-pi-b-gpio-header-details-and-pinout/#prettyPhoto/0/

After step 1 my setup looks like this
The Raspberry Pi is on the left (green) and a breadboard is on the right (white).  The breadboard just helps you attach wires, sensors, and resistors to the Raspberry Pi.

The white box on the lower left of the breadboard is the air temperature sensor- less than $9 on Amazon.  The larger black box to the right (orange light) is my wifi antennae attached to USB hub (not necessary).  The other cables coming into the board on left are mostly unnecessary too because they are just to setup the operating system until I have a network connection  (USB mouse and keyboard and HDMI for video)

Step 2 Adding soil sensor

A different tutorial explains how to setup the soil sensor.
http://www.modmypi.com/blog/ds18b20-one-wire-digital-temperature-sensor-and-the-raspberry-pi
Because I am already using pin 4 for the first sensor, I decided to use pin 17 for the second sensor.

where instructions say to edit /boot/config.txt
and add:
dtoverlay=w1-gpio
I also add the new pin info (since the device defaults to using the pin I am already using for the air temperature sensor in step 1)
dtoverlay=w1-gpio,gpiopin=17


So far, I now have the soil sensor working.  I am now about to begin the python programming.  In an future blog post I will look at the script from step 1 and see how I will incorporate the second sensor into the monitoring script I already have so it's results will be included in the graph on the web page.

The circled up black cable is the added waterproof soil sensor. 


In general, if you are not very technical, start out with very small steps.  Do some basic Raspberry Pi tutorials first.  The when comfortable, try reading your room temperature, and move on from there.

Part 2: Adding the soil temperature sensor.

Thursday, March 13, 2014

Sean's Photos

Male CardinalDowney Woodpecker Warns BluebirdBluebirdFox SquirrelRed-headed WoodpeckerRed-headed Woodpecker
Icy SituationWild GeeseYellow BirdWoodpeckerCardinalCardinal in Landing Pattern
WoodpeckerWoodpecker in Pine TreeCardinalPine WarblerSunsets over snowy pasturesBird in the Yard- Minolta Rokkor 135mm Lens- Nex-6 Body
Joplin PorscheRexCriminal Carriagescriminal_executionerPOMPEII_OCEAN_Bbremen_windmill

Some photos I take with various cameras including 1970's lenses and camera phones

Thursday, February 27, 2014

Getting Paid - Payment Ideas For Your Small Business

Make Payments Easy

Nobody wants to work to complete a transaction.  Parting with one's money is much easier when it's painless and quick.

Keep this single point in mind when designing your web site or app and when choosing your payment methods, your customers will be much happier and you will be more profitable.

How Do You Do Business?

How and where you do business matters when thinking about getting paid.  Different payment systems are easier to implement or cost more or less depending on what you do and where.

Do you operate online, in a physical location, or both?  Do you take payments by phone, in person, in the field, on a web site, or in a mobile app? Do may even have a physical goods store setup on a eCommerce hosting platform like Big Commerce or Shopify.

Your Future Plans

What are you planning to do in the future?  Are you going to change web hosts, develop a mobile app, start selling at events?  Keep your future business goals in mind when evaluating your payment choices.  You do not have to be married to one method of payment processing forever, but sometimes you can use one service provider in different ways.

Types of Payment Systems To Consider

I use and recommend a number of payment options to my clients depending on their budget and technical capabilities.  I personally use several at once.

My Criteria For Choosing a Payment Solution :

  1. Must have good security
  2. Must be easy for customer: This increases sales by reducing transaction friction...aka 'abandoned carts'
  3. Must be relatively simple for me to implement (less important than #2)
  4. Customer support provided by payment company must be good- good documentation and quick response times on issues are very important.
  5. Solution cannot cost too much (least important of all)- Many options are similarly priced and more sales will hopefully make up any difference in cost per transaction.

Converting Visitors to Buyers

If you want to make the most sales for the largest dollar amount, you cannot simply pick a payment system like Paypal, plug the button's html code into your site, and check the task off your list as done.

Reading the works of academics who study behavioral economics (Dan Ariely is a good one), we find that people will behave differently when in buying mode based on what is offered to them.  For example, given only one method of payment, customers are less interested in completing the transaction.  Sometimes its because the one method you gave them is not their favorite.  Psychologically, however, it turns out that 2-3 payment choices translates into more sales.  Going over this number gets too complicated so buyers abandon their cart.  Provide at least two different payment processing options such as credit card and Paypal.

How Payments Used To Be

The brick-and-mortar and online digital-only payment systems are evolving and the line between them is blurring. In the earlier days of the web, many small businesses accepted payments online with Paypal and had a credit card reader provided by their local bank in their physical place of business.  If you were a larger business you might have an online merchant account with your bank also.  More established providers are offering more features and interesting new companies are coming online quickly.  It's finally becoming a buyer's market for merchants.

Traditional Merchant Bank/Gateway Setup

I have implemented traditional merchant bank account solutions with a gateway (Authorize.net).  They are expensive and complicated for many small businesses.  The merchant pays monthly transaction fees, report fees, bank fees, gateway monthly fees, and have account setup fees.  After a year the contract expires and must be renegotiated.  No fun to setup and operate, but a little cheaper if you do a lot of business.  Many small businesses do not do enough volume to pay all the fees.

Use Cases

Small businesses should look at the new choices for taking payments.

I currently like Square for getting payments quickly while mobile. Many businesses have also been using them as in-store terminals (Starbucks).  Square is useful when I am in the field at an event.

Stripe is good for credit card payment processing on mobile apps and web sites.  Stripe also integrates with some hosted shops like Big Commerce and Shopify.  They do require a secure server (security certificate) which can be had from these e-commerce hosts as well.  I use Stripe for a Big Commerce site, my own mobile apps, and web site payments on my own server where I maintain a digital security certificate.

Paypal is an option to add a second payment choice, but there are other like Dwolla to consider as well.

If you are going to develop a mobile app, there are other considerations.  Native Android and iOS apps require use of their respective mobile platform's payment processing system.  Apple and Google want their 30% cut on every sale.  This is true for digital goods and services but not for physical items.

If you decide to make a web app (not in the app stores) then the merchant keeps all of the payment without paying 30% to Google or Apple.  That is of course, less the typical processing fees.

Bitcoin

Digital currency like Bitcoin will likely become a strong payment method on the future.  There are a lot of obvious benefits to using digital currency.  Mostly freedom from dealing with bank rules and fees are the main benefits.  Unlike when using a credit card, a Bitcoin buyer cannot dispute the 'charge' and get their money back.  Bitcoin sales are instant and final and the merchant gets to decide whether it will make good on any transaction problems.

There are already U.S. based Bitcoin solution providers (Coinbase) who can give you the html button code to plugin in to your site for taking payment in Bitcoins.  More people need to use Bitcoin before this can be a mainstream payment option.

The Right Payment Solution Makes Life Easier

I find that all payment solutions have their strengths and weaknesses.  Stripe is a little more work to setup but I have had great luck with them. I have heard of merchants having problems with Square and Paypal because they sometimes appear to side with buyers in charge disputes in unfair ways.  I have not used Square enough to experience this, but I have had issues with Paypal.  For physical goods sellers, this can be an expensive problem.  Fairness and other problems like these are often not the fault of the technology, but rather the customer service provided by the payment solution provider.

There are always new entrants to the payment solutions market which I review as they become available in case a better options comes along.  Hopefully my current list helps you make some decisions related to your business needs.

Sunday, October 13, 2013

Developing "Web Sites" In a New Way

Leveraging the Cloud 

I started making web sites around 1995.  In the last year I have started moving away from the client-server model to a cloud and api driven service model for new projects. While I still maintain my own Linux servers, with customized content management systems (CMS) on them, I find that managing the legacy infrastructure takes too much time away from new idea development itself.

For example, I am using cloud databases instead of my own mySQL database server.  I am also using cloud services for mail delivery, payment processing, and even CMS content creation.  Thanks to an insane number of REST apis available today, I can get more done without getting bogged down installing Linux libraries, system upgrades, and wrestling a restrictive CMS system.

Incidentally, some of my favorite apis right now are SendGrid, Stripe, Osmek.


Mobile First

I have been doing all new projects with mobile in mind.  I make new apps and with the phone screen size in mind, and then test and adjust for tablets, and desktops.

I am targeting the widest possible operating system and browser compatibility by developing with HTML5 and serving app directly to iOS, Android, and desktops via the modern web browser.

By avoiding the app stores and the associated programming languages required for each platform, I expect to reach more people and avoid the limitations imposed by the various stores such as Google Play and Apple iTunes.

Now I am spending much of my time thinking about HTML5 and related browser compatibility issues.  In the past, I have spent more time with python, but I now find myself using javascript, jQuery Mobile, and css3.  This mix allows me to make apps more finely tuned for exactly what I want to achieve, without the overhead of a bloated CMS driven site.