Professional Documents
Culture Documents
Table of Contents
File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Step 9: Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
http://www.instructables.com/id/IoT-Weighing-Scale/
Intro: IoT Weighing Scale
Hi, thanks for taking the time to come and have a look at my instructable. It has been super fun undertaking this project, in making it I have learnt so much and, I hope in
reading this you might learn something too. If you enjoy this instructable please consider voting for it in the Internet of Things competition, it would be greatly appreciated
:)
Inspiration
Through my girlfriend I was introduced to the food sharing app OLIO, an amazing initiative whose goal is to reduce food waste through peer-to-peer food sharing. Check
it out and spread the word. With food waste on my mind and the IoT Builders competition here on instructables, I decided I would try and create something that could
help reduce food waste.
What I have come up with is essentially a WiFi enabled weighing scale. The device is configured to IBM's Watson IoT Service and from there the data stream is sent
through a Node-RED flow to visualise the data.
This device is not limited to combatting food waste, it can monitor just about anything. A few examples of what you could keep track of:
The possibilities really are endless, if it can be weighed and its weight changes, this device could be very useful.
NodeMCU ESP8266
The easiest way to describe the NodeMCU ESP8266 is that it is an incredibly cheap "Arduino-like" development board which has WiFi built in. I paid just 3.91 for mine
on eBay. Best of all you can program it in the Arduino IDE.
Load Cell
This is simply a bar of aluminium with two holes drilled at the centre - when supported at one end and with a load applied at the other an analogue reading is produced.
HX711 Board
http://www.instructables.com/id/IoT-Weighing-Scale/
This is an amplifier which converts the analogue reading produced by the load cell into a digital one readable by the NodeMCU ESP8266. I bought the HX711 and Load
Cell together for 3.42 also on eBay.
Node-RED
Node-RED takes a lot of the work out of IoT. It requires a much lesser understanding of programming and languages since it is visually based. It is exceptionally easy to
link your project to Twitter and send tweets or link your email account and send an email from it.
IBM Watson IoT Service
An online cloud service that can securely host you IoT project. Basically in this project the sensor data is sent to IBM's Watson IoT Service where it is received stored and
sent on to other places on the internet.
This project requires very little in the way of materials. They are as follows:
NodeMCU ESP8266 link
HX711 Board and 5kg Load Cell link
Slide switch equivalent link
Dupont cables link
HTC Cell phone battery link
100mm x 100mm x 27mm of Oak (you can use equivalent hardwood)
Sprung 4 point contact (I salvaged mine from an old printhead)
2 pieces of translucent acrylic 100mm x 100mm x 7mm
2 x M4 countersunk machine screws 18mm long
2 x M5 countersunk machine screws 18mm long
2 x M4 pan-head bolts 15mm long
6 x M5 washers
2 x M5 nuts
Note:
My brother had an old HTC cell phone lying around that didn't work anymore hence the battery being used in this project. I am still able to charge the battery using the old
phone. If you were to buy the above battery make sure you have some way of recharging it.
Cost:
I was lucky enough to be able to find the acrylic and oak in the waste bins at my university workshop. I also had a scrap printer lying around from which I salvaged wires,
a switch and a spring contact. I also already had most of the nuts, bolts and washers. Altogether I spent around 10.
http://www.instructables.com/id/IoT-Weighing-Scale/
Step 3: What you will need - Tools
I am really lucky to have access to very well equipped workshops at university and before I left for the Christmas break I used a CNC router and Laser cutter. However,
you could still achieve this project without those specialist tools. Tools I used were as follows:
CNC router
Laser cutter
Bench-top disc sander
Bandsaw
Cordless drill
Jigsaw
Drill bits, various sizes
Needle files
Sand paper, various grades
Wire cutters
Pliers
G-Clamps
2 part epoxy, Araldite or equivalent
Super glue
This list is not exhaustive but the main tools I used are listed here.
http://www.instructables.com/id/IoT-Weighing-Scale/
File Downloads
As mentioned earlier I used a CNC router at uni. This is how I made the main enclosure of the device. I have attached the tool-path should anyone want to replicate the
piece. I used a 4mm straight router bit.
(At this stage I hadn't completely designed the whole device, it would have been great to have routed out the battery bay and slots in the base. Instead I did this at a later
stage with a jigsaw for the battery bay and a drill and needle files for the slots.)
Bandsaw
With the CNC router I only marked the perimeter with a 4mm deep cut rater than cutting the entire depth the whole way around. This was because the CNC router is quite
slow. I cut the waste off with the bandsaw.
Disc Sander
Image Notes
1. 27mm thick piece of Oak
2. 4mm straight router bit
http://www.instructables.com/id/IoT-Weighing-Scale/
Image Notes
1. Slot for base to lock into (cut by hand after design developed)
2. Slot for base to lock into (cut by hand after design developed)
Image Notes
3. Recess for battery cut with jigsaw
1. Round those corners
4. Hole to reset NodeMCU ESP8266
5. Countersunk holes for mounting load cell 5mm
6. Contact from old printhead
File Downloads
http://www.instructables.com/id/IoT-Weighing-Scale/
Step 6: The Base
Since the battery is rechargeable it was necessary to make it easily accessible. The base is made up of a rounded square piece of acrylic with two pan-head machine
screws which protrude the thickness of the base of the oak chassis. These two screws slot in to two key hole slots cut into the base of the oak chassis and slide across to
secure the base.
To make the key hole I drilled a 5mm and a 3mm hole a centimetre to one side. I then used a round needle file to connect the two. You can see the base being
removed in an earlier video in the instructable.
The weighing surface (top) is pretty much the same as the base. It is also made from 7mm thick acrylic. Two holes are drilled and countersunk to line up with the load cell
mounting holes. These countersunk holes then receive two M4 countersunk machine screws which are 18mm long. It is important they are countersunk to ensure a flat
weighing surface.
Mounting
I placed two M5 nuts over the load cell holes to allow a gap between the underside of the weighing surface and the load cell bar. Place the acrylic on top and tighten.
http://www.instructables.com/id/IoT-Weighing-Scale/
Image Notes
1. M4 18mm long machine screws
Step 9: Software
Arduino IDE
Download the two .ZIP files. Add the pubsubclient library in the Arduino IDE by going to Sketch>Include Library> Add .ZIP library...
You will also need to add the NodeMCU ESP8266 board to your Arduino IDE. I found this instructable to be very informative and useful in getting started with the Arduino
IDE and NodeMCU ESP8266 link.
You will also need to edit the following 4 lines however you won't know your relevant details until the next part of this step (configuring your IBM Bluemix device):
IBM Bluemix
The first thing you need to do is go and sign up for a free trial of IBM Bluemix link. I figured a screen-shot series (above) would be the best way to describe how to
configure the online portion of the software. Follow that and once you know your organisation_ID, device_type, device_ID and token go back and edit the Arduino sketch.
Another thing you will need to do is to add the Node-RED dashboard so that you can use the "gauge" node. Instructions are included in the screen shot series.
Calibration
http://www.instructables.com/id/IoT-Weighing-Scale/
You will find that the number you get is wrong, i.e when nothing is on the scale it doesn't read 0. Find the line of code in the Arduino sketch:
Start by substituting this line with just "valCalibrated = val" take a note of the value arriving at the Node-RED debug window. Let's assume that value is 2500 for example.
Re upload the sketch with this line:
Now you need to work out your scale factor. Place a 100g weight on the scale. Note the number arriving at the Node-RED debug window. Let's assume it is 1500. Since
this is the value for 100g our scale factor is 100 times smaller i.e. 15
A video which really helped me understand calibrating a load cell can be found at the following link
Final Notes
Upload the sketch for a final time. Now go to yourappname.mybluemix.net/ui you should find a nice looking gauge with a live feed of data coming from your IoT Scale.
Well done!
Image Notes
1. This is my currently working app but this series of screen shots will guide you
to creating your own.
2. Click on "Create App +"
http://www.instructables.com/id/IoT-Weighing-Scale/
Image Notes Image Notes
1. Start your app 1. Your app is now running, click on the route url to open Node-RED
Image Notes
1. This is where you can create your first flow Image Notes
1. This is a default flow which you can delete
This is where we will add the device which sends our weighing data
2. Sign in with your IBM Bluemix details
http://www.instructables.com/id/IoT-Weighing-Scale/
Image Notes Image Notes
1. This is my connected device, we will add one as an example 1. You don't need to put lots of details in for the following windows which pop up.
2. Click here to add device I only put in Device Type and Device ID. I put "ESP8266" for both, perhaps
"ESP8266" and "IoT Scale" respectively would have been more appropriate
Image Notes
1. Go to the route url once more, we can now reference our device in the Node-
RED flow Image Notes
1. This is the flow I created to handle the data stream. I have attached it for
download. Read on to find out how to import it
http://www.instructables.com/id/IoT-Weighing-Scale/
Image Notes Image Notes
1. To import the flow I have provided click the hamburger>import>clipboard and 1. Install this to use the "gauge" node I have used
paste the flow code
http://www.instructables.com/id/IoT-Weighing-Scale/
Image Notes
1. If everything has worked correctly yourappname.mybluemix.net/ui
should take you to a live gauge feed of the weight on your IoT scale
File Downloads
Any problems at all please leave a comment or message me. Hope you have enjoyed this instructable.
Happy making!
Related Instructables
IoT Oil Tank Install Node- Install node red Making a IoT Controllable Connected Cars
Gauge With IBM RED on Intel on lubuntu IoT cloud service Led (Music With Intel
Bluemix and Edison by Atlas7 by Jhon_Control with ARM mbed Visualizer + IoT) Edison by
Maximo by platform and by vhajar ShreyasUpasane-
DanF115 IBM Bluemix by DIGIT
Eric.Hyungki.Jung
http://www.instructables.com/id/IoT-Weighing-Scale/
Advertisements
Comments
http://www.instructables.com/id/IoT-Weighing-Scale/