Category Archives: IOT

NEW GUIDE: Circuit Playground Express Automatic Sunglasses @Adafruit #CircuitPlaygroundExpress #AdafruitLearningSystem

CPX Sunglasses

The hits in the Adafruit Learning System keep coming today with a new guide on Circuit Playground Express Automatic Sunglasses. These glasses sense the light around the wearer and either cover your eyes or turn on a light. Perfect for the beach and camping. The code is both in CircuitPython and Microsoft MakeCode, take your pick.

I don’t think you can cosplay Data from Googies without such a nifty gadget, updated for this century. Check it out today!

CPX + Sunglasses

via Adafruit

Rover V2 Handles Stairs as Easily as the Outdoors

Rover V2 is an open-source, 3D-printable robotic rover platform that has seen a lot of evolution and development from its creator, [tlalexander]. There are a number of interesting things about Rover V2’s design, such as the way the wheel hubs themselves contain motors and custom planetary gearboxes. This system is compact and keeps weight down low to the ground, which helps keep a rover stable. The platform is all wheel drive, and moving parts like the suspension are kept high up, as far away from the ground as possible. Software is a custom Python stack running on a Raspberry Pi that provides basic control.

The Rover V2 is a full mechanical redesign of the previous version, which caught our attention with its intricate planetary gearing inside the wheel hubs. [tlalexander]’s goal is to create a robust, reliable rover platform for development that, thanks to its design, can be mostly 3D printed and requires a minimum of specialized hardware.

from Blog – Hackaday

NEW GUIDE: Circuit Playground Express Serial Connections @Adafruit @MSMakeCode #CircuitPlaygroundExpress #CircuitPython


A new guide in the Adafruit Learning System today: Circuit Playground Express Serial Communications.

Do you need to hook up a serial connection device? Or perform serial communications with another board like a Raspberry Pi? This guide shows you the basics of serial communications and the hookups. Examples are coded in Microsoft MakeCode and CircuitPython showing output of data to a terminal program.

Check out this new guide today!

CPX + Serial

via Adafruit

NEW GUIDE: Make It Switch @MSMakeCode @Adafruit #CircuitPlaygroundExpress

Make It Switch

Have you wanted to add external switches to your project but got lost in all the types, connections, etc.?

Make It Switch, a new guide in the Adafruit Learning System guides you through all the info – various switch types, naming, functionality, and how to use in Microsoft MakeCode, CircuitPython, and Arduino. Worried about switch debouncing, that’s included also. Check out this handy tutorial today.

via Adafruit

NEW GUIDE: Make It Log – send data directly to a spreadsheet @MSMakeCode @Adafruit #AdafruitLearningSystem

Make It Log to Spreadsheet

A new guide in the Adafruit Learning System today. Make It Log shows you how to capture data from a Circuit Playground Express directly to the spreadsheet of your choice, either on your computer or your Android phone.

Using the Human Interface Device in USB, the Circuit Playground Express emulates a keyboard. It types out the numbers for your measurements and ensures the cursor in the spreadsheet goes back to the next line for the next set of measurements. So easy!

The examples are coded both in Microsoft MakeCode and Circuit Python, choose your preferred coding method.

Get logging your data to a spreadsheet today with this guide.

via Adafruit

Bitcoin Powered Electrical Outlet

If you ever wanted to charge for electrical usage here is a way to do it with Bitcoin. Shared by Islam Roston on

Project Idea
Bitcoin and blockchain technology opened a whole lot of opportunities for paying for goods and services but the catch was that it wasn’t fully automated because it lacked easy hardware integration support. However, it got easier with the release of the Koyn library. In short, the Koyn library allows your hardware like Arduino compatible boards to receive and send Bitcoin payments.

One application model for Bitcoin that interests me is pay per service, and one of many applications I decided to get my hands dirty on is renting electricity. So, I started building an electrical outlet that is powered by Bitcoin.

This project works on HIGH AC voltage which is quite dangerous. Your safety is your own responsibility, including proper use of equipment and safety gear, and determining whether you have adequate skill and experience. You must accept that you and you alone are responsible for your safety and the safety of others if you choose to build this project.

Learn more!

via Adafruit

Track Everything, Everywhere with an IoT Barcode Scanner

I’ve always considered barcodes to be one of those invisible innovations that profoundly changed the world. What we might recognize as modern barcodes were originally designed as a labor-saving device in the rail and retail industries, but were quickly adopted by factories for automation, hospitals to help prevent medication errors, and a wide variety of other industries to track the movements of goods.

Medication errors in hospitals are serious and scary: enter the humble barcode to save lives. Source: The State and Trends of Barcode, RFID, Biometric and Pharmacy Automation Technologies in US Hospitals

The technology is accessible, since all you really need is a printer to make barcodes. If you’re already printing packaging for a product, it only costs you ink, or perhaps a small sticker. Barcodes are so ubiquitous that we’ve ceased noticing them; as an experiment I took a moment to count all of them on my (cluttered) desk – I found 43 and probably didn’t find them all.

Despite that, I’ve only used them in exactly one project: a consultant and friend of mine asked me to build a reference database out of his fairly extensive library. I had a tablet with a camera in 2011, and used it to scan the ISBN barcodes to a list. That list was used to get the information needed to automatically enter the reference to a simple database, all I had to do was quickly verify that it was correct.

While this saved me a lot of time, I learned that using tablet or smartphone cameras to scan barcodes was actually very cumbersome when you have a lot of them to process. And so I looked into what it takes to hack together a robust barcode system without breaking the bank.


A Barcode Reader to Make a Hacker Proud

Dedicated barcode scanners cost around $20 USD from banggood or DX and are an obvious solution, but that would be boring. I also wanted a more powerful device: a barcode scanner that could directly connect to the Internet so I could track things centrally online without any further hardware. While the idea was hardly unique, it still stuck with me. Recently, I saw a tiny barcode scanner module (Youku E1005) for sale for $17 USD with no datasheet, and I knew the game was on.

The scanner module itself was very compact, which lent itself well to making a convenient device. It had a generic unlabeled MCU, and a 12-pin ribbon cable connector. The vendor told me it supported Code 39 barcodes (true – but it actually supports many more!), and had USB and TTL output. It was time to puzzle the module out!

Dissecting Barcode Hardware

Not my finest soldering job.

Logically, some of the 12 pins were going to be power, ground, USB data lines, and TTL serial output. Typically these modules are used to build hand-held barcode scanners, so also require a trigger to be pressed to activate the scanner. The first step was to desolder the connector so I could get access to the pads underneath.

The next step was to identify power and ground. Ground was pretty easy since several components were connected to what was clearly a ground plane. The power pin was harder, but there was an IC that looked like a voltage regulator in a SOT-753 package. Given common pinouts, both the enable and the voltage input pins were connected to a single pad.

Having probable inputs for power and ground, I connected 3.3v to the circuit. Nothing happened, which is expected as I’ve yet to find the trigger pin that activates the device. The easiest thing to do was to quickly connect each remaining pad to ground and see if the trigger was of the ‘active-low’ variety. It turned out it was, and the LED of the device turned on to indicate it was ready to scan.

Making Sense of It All

Pin Function
5 TX
12 Trigger

The final step was to find the TTL output. That turned out to be pretty easy now that I could force the device to scan barcodes. I took an arbitrary barcode and scanned it while looking at different pins on my oscilloscope. When I found output, I captured it so I could determine the baud rate later on. The final pinout I found is to the right. The flat cable connector pads were fairly dense, so I soldered wires to components connected to the relevant pads rather than the pads themselves where possible.

After scanning a barcode and capturing the output on my oscilloscope, I saw that the duration of the shortest peak was just over 100μs. That translates to a frequency of a little under 10000 bits per second. The closest common baudrate is 9600 baud, so that is likely our TTL baudrate. Now, we have all the information we need to connect the barcode scanner module to a microcontroller, in our case an ESP8266 running NodeMCU.

The first peak has the shortest duration in the sequence, at about 105μs. A reasonable baud rate to try is the closest common one to 1s/105μs = 9523 baud, which is 9600 baud.

Our code will be very simple: Change the UART speed to 9600 baud, and when any data is received concatenate what comes in for the next 150 milliseconds and print it out. Remember to set the baud rate of your development tool (e.g. ESPlorer) to 9600 as well.

-- Setup UART and print something so we know it's working

uart.setup(0, 9600, 8, uart.PARITY_NONE, uart.STOPBITS_1, 0)

-- Set up a couple of variables so they're not nil

data = ""
datac = ""

-- This function prints out the barcode data and clears all variables so the scanner can read a new barcode. If you wanted to send the data over MQTT, your code would replace the print statement here.

function finish()
    data = ""
    datac = ""

-- This function concatenates all data received over 150 milliseconds into the variable datac. The scanner sends the data in multiple parts to the ESP8266, which needs to be assembled into a single variable.

uart.on("data", 0, function(data)
    datac = datac .. data
end, 0)

This worked quite nicely and was able to read various types of barcode without issue. It would be very easy to connect this to a server on the Internet, either directly via MQTT, or using an Internet of Things dashboard. It would even be possible to implement encryption and authentication if you needed.

Custom Tricks Now Open Up To Us

An interesting fact is that the NodeMCU is capable of executing serial input, so make sure that feature is turned off (the 0 at the end of the uart.setup line). Otherwise someone will promptly drop by with the barcode to the right. The usual precautions apply to the backend as well. You could even filter out problematic characters at the hardware level, which would be nice. Of course if you’re clever this could be a feature and not a vulnerability.

I didn’t have a particular use case for this barcode scanner in mind, but it would be nice to see someone implement it in a cloud Point-of-Sale system for small merchants in Asia to track inventory in a primarily cash-based economy. In effect that would be very similar to the original use of barcode scanners – minus the expensive POS system.

Finally, while at a local convenience store, I saw the perfect project case for this sitting on a shelf. I bought it, and it was filled with candy! Sometimes we live in the best of all possible worlds:

Fun fact: all my hacks are sugarfree and do not cause tooth decay. The case also comes in an extra cool variety, but I’m saving that for another day.

from Blog – Hackaday