6 posts tagged

projects

All hail to Airtable

Some time ago I learnt about Airtable and thought that it was a great thing, but didn’t have a project to try it with.

Now I use it a for a couple of my projects.

First “production” use was when I did the diPlayer. I just needed some connected database where the end user could edit the records with his phone without extra hassle. Also I wanted something with a simple yet robust API. And Airtable was a great fit for it.

Another one was a side project with a chatbot that tracks citizenship application status for users. The users just enter their application code, and the bot does the regular checks and reports back when status changed. Very handy, and with Airtable I just outsourced all the database work to a service. With this one I also gave very granular control to another person, so that they can add records in bulk in their space without accessing all the database.

Now I am building another IoT project that will also use Airtable for remotely accessing data that will be gathered by a Raspberry Pi running an MQTT broker.

Then I used it for a couple of home things – like keeping track of the job applications statuses, utility contractors.

So it’s a great thing if you want to shorten your time to market and focus on client. Give Airtable a shot!

 No comments   2021   airtable   DIY   projects

Webhook Bot

Webhook Logo

At some point I was considering to make a bird-feeder with a simple Arduino sensor to count birds.

I thought I could make use of some simple tool that would notify me of another bird visiting, or that the battery is low. E-mail would do, but it feels like too much hassle when you can send one request to a messenger of choice.

Glip and Slack offer easy creation of a public webhook URL for any chat, that you could use to send messages.

However, I wanted to use my private messenger accounts for it, and did not find a similar project nor for FB messenger, nor for Telegram.

So I made one myself. That’s how Telegram @wwwebhook_bot was created!

Initially I wanted to use it with FB messenger, but it’s hard to get it approved there for public use.

The project has first seen light of the world in August 2018.

Source code on Github

 No comments   2020   bot   javascript   nodejs   projects   telegram   webhook

Arduino Bluetooth Car Controller

Arduino 4WD Car Kit

My wife has recently presented me an Arduino 4WD Car Kit.

The kit is great, produced by keyestudio, and based on l298n motor driver.

It took me a while to assemble and make it work, but I got so much fun in the process.

The app

The kit producer provides an Android app, but it’s quite buggy, so I looked for alternatives.

I found a simple app code by Boldi Zopcsak and tweaked a little bit tot include the MAC address input field which was hard-coded before.

Also the app now tries to connect to Bluetooth device on start.

What I’m especially happy is that I set up the Github Action to build the app on every commit. It also stores the app builds, very handy.

Check out Repo on Github.

Builds: Android CI

 No comments   2020   android   arduino   bluetooth   DIY   projects

Repurposed an old iPad as a home status screen

Here is my new small project – TableStatus/StenGazeta (Daybook.buznik.family as of November 2020).

I have been thinking about creating some kind of a status screen for my home and family for a long time.

Our friends have recently donated an old iPad 2 to us. It runs iOS 9.3.5, so I can barely install a handful of apps from Appstore. That’s where this idea started.

I could never gather all the details until this Christmas, when I got some time and slapped together a preact web app.

Try it

Features

It’s a web page that displays widgets:

  • daily weather – temperature, conditions and humidity, and lunar phase
  • agenda – events from our shared calendar for the day (events are also togglable, so you can use it as wishlist)
  • photoslider with pictures from selected google photos albums
  • simple notes

Nothing particularly interesting about those – mostly leveraging a couple of APIs.
I used openweathermap.org for weather, and Google APIs to retrieve the calendar and photos.

The notes are just a text area that stores value in localStorage, not synced across sessions.

Usage

You can just visit Daybook page on your iPad and it will work.

In order for Calendars and Photos to work, you need to login with your Google account.

Source and Setting Up

Right now, I’m happy with the result, though I’m adding some ideas as enchancements on Github.

Source code on Github

It has a readme which has some notes on the API keys that you need to get and some other vars to set up.

The project is build with webpack and can be hosted on any kind of hosting. I use Netlify for it.

You can set up one for youself, too.

Anyway, let me know if you’d like to use it, but it lacks something via this form.

A note to React gurus and beginners

The project is definitely not to show off my React skills, rather the opposite – I wanted to slap some stuff together in a very limited timeframe and also to try preact.

Also if you are a beginner and want to learn by its code – it’s not the best specimen.

preact

I wanted to go really minimal and was lured by preact’s promise of 3kb gzipped size.

However I ended using the preact CLI to create the project boilerplate together will the webpack and compilers and other stuff, and 260Mb node_modules.

Also tried to start with React Native, but its toolchain is still not clear to me. Ran into a couple of issues with the suggested solutions as “reinstall all your node_modules and cocoa pods”, not cool.

 No comments   2020   daybook-cc   iPad   preact   projects   web app

Toy Traffic Light with Arduino and Lego Duplo

Demoing this to my son

Here is my small project that I made for my son’s 2nd birthday.

He is very fond of trains and cars, so I thought that a working traffic light would not hurt. I know there are some commercially produced toys, but I wanted to do something myself.

If you have religious feelings about Lego, proceed with caution – some damaging images ahead.

Concept

I just looked at a 2x4 regular Duplo block and thought that its bottom tubes resembled the traffic light tubes (kind of).

Those tubes also large and deep enough to accomodate regular 5mm LEDs.

However to place the Arduino and have some space for the wiring, I had to cut almost entirely the two and a half tubes with a Dremmel rotary bit. Even after this the block still has some rigidity:

Videos

How not to solder:

Almost ready:

Complete:

Parts

Project is based on Arduino Nano which fits pretty well inside the regular Duplo block.

  • Arduino Nano V3
  • Red, Green, Yellow LEDs
  • 220 Ohm resistor (3x, for the LEDs)
  • Pushbutton
  • Battery block

Power

One can use pretty much anything to power Arduino Nano with some LEDs. I had some CR2032s, 9v crown, Li-Ion 18650 and an 3xAAA battery block lying around.

Initially I wanted to go with CR2032 in order to reduce weight and complexity, but the ones that I had did not produce enough current.

18650 is a good choice, but would require more block processing to fit the battery.

So I went with a noname 3xAAA battery pack.

Coding

I started off with a python sketch, aiming to use ESP32 with micropython to allow over-the-air traffic pattern updates.

For some reason I had issues with ESP32 on my laptop (could not properly connect over serial, even with that bespoke UART driver).

So I went really simple, with a regular Arduino and C.

Wiring

Assembly

Soldering is really messy, but also the space was limited:

I’m as surprised as you are with my soldering:

Some drilling had to be applied:

Complete with some hot glue:

 No comments   2020   arduino   DIY   family   hardware   lego   projects   source-code   toy

diPlayer – Raspberry Pi-based player for DI.FM

diPlayer assembly

This is a desktop player for DI.FM that I made for the 20-year anniversary.

I gathered a lof of experience during this proejct:

  • learned how to solder (again)
  • familliarised myself with Python
  • wrote and debugged firmware for an Arduino Nano
  • learned to model in Fusion 360
  • found out that 3-d printing don’t happen right on the first time

Details

Desktop player based on Raspberry Pi, that can play DI.FM channels (IceCast streams to be exact).

It is controlled with photoslides frames that have NFC-stickers on them, the stickers point to certain channels.

The player can also play other sources like Spotify, Google Play Music, Soma.fm thanks to MusicBox software.

It has a physical Play/Pause button, volume knob and a small screen that displays current track. Sound output is through audiojack or HDMI (Raspberry Pi standard).

Inspiration

Last year I saw these tweets:

And some comments had a link to the PlasticPlayer project.

It’s a small device based on Espruino with NFC-sensor and a screen. Upon detecting NFC-chip it gets its reference track from the database and sends the link to it to the Raspberry Pi that sits on the same network.

The author, Brendan Dawes, released all the source code and models for 3-d printing on Github, which helped me a lot.

My Attempt

I started to work on the project in June 2019.

It was around the time I just received a couple fresh ESP32 from China. I did reflashed one of them with Espruino, but even simplified code from the Brendan’s repo didn’t run.

Also I didn’t like that in such a simple project there will be two separate wi-fi connected devices, and I deemed suboptimal Arduino getting track data from the remote server in the face of Raspberry Pi power and possibilities.

So I rewrote and remodeled everything from scratch.

I just forked the repo and dove into unraveling all the upcoming issues.

Mistakes and Experience

On the breadboard

NFC PN532

This is a very popular Arduino NFC-module. It took me only one a half months of unstable work (!) for me to read to the original manual.

One of the keys issues here was that the wire management – the wires should go under the antenna turning in 90°.

The wires should go under the antenna turning in 90°

NFC-module is very susceptible to electromagnetic noise from other devices and wires.

Encoder

I also decided to replace the “Next Track” button with the volume knob.

On the first iteration I tried to use encoder with Arduino.

Encoder is a knob you must be familiar with from a wide range of electronics. It uses two rings inside and a cursor to determine if it goes forward or backward.

On a separate breadboard and an Arduino with only the encoder connected everything worked smoothly.

But whenever I tried to use it with my main board, together with NFC-module, screen and a couple of buttons, the volume was unstable at all, and I couldn’t use it.

I couldn’t discover why it happened. Maybe it was due to some regular voltage spikes that I could measure. Some tutorials stated that encoder needed hardware interruptions to work, and so maybe I used the wrong Arduino pins.

After some struggling, I almost gave up on the project and decided to try potentiometer.

Potentiometer

It’s a more traditional knob, based on the resistance change inside itself.

It didn’t come out easily as well. Looked like the NFC-module emitted a lot of noise, and potentiometer readings bounced by 10% either side all the time. 10% is quite a span, which is to easy to smooth out.

At some point, I got an advice on an Arduino forum, to connect the potentiometer physically closer to the power source. It did help, just until the final assembly.

Case

In the original Brendan’s repo (above) there is a case 3-d model. But it appeared I need more height due to the fact that I wanted to squeeze both Raspberry and Arduino inside, and also I wanted a different type of wiring on the back side.

I tried to model it at first in Blender – from my knowledge it was a popular program to make Counter-Strike skins 15 years ago.

I did a case model from scratch using the relative units. In a day the printing guys sent me a picture of a bottom lid with the Raspberry mounting holes spaced apart too much. They suggested me redoing the model in Fusion 360.

I never tried parametric modeling before and it worked like a charm. Fusion is an awesome and fast peace of software, and it took me only a complete Sunday to learn the program and model the case with exact measurements.

This time printing went smoothly in terms of dimensions. However the surface quality appeared to be poor in some places, and I couldn’t fix it afterwards.

The case before painting

I tried to sand it and apply different Dremmel rigs, but it didn’t really help. In the end I coated it multiple times with acrylic paint which made it look a little better.

Final Assembly

I had only two weeks left to the deadline (a trip to Croatia to meet my colleagues), so I was calm thinking that I have a lot of time.

By this time I got desperate a couple of times and was close to abandoning the project due to unexpected issues. Now, remembering those moments, I can’t understand why it scared me that much. My wife really helped in those moments, encouraging me to continue.

One of the first surprises was the fact that the USB-cable that I used to connect Raspberry Pi and Arduino did not fit into the case. So I soldered a shorter version of USB-A — mini-USB.

Soldering mini-USB plug

Then I soldered all the components and headers onto the circuit board, and potentiometer started to report incorrect readings again. I got some more advices on the forum, tried to put a capacitor.

In the end I replaced the potentiometer with the encoder, but this time plugged it into the Raspberry Pi. I added another small class to read the encoder readings in my Python program and it was good.

One of the iterations of my expansion boards for Raspberry Pi
One of the iterations of my expansion boards for Raspberry Pi

It was only three days before the flight, and I had more plans for the firmware updates, Raspberry Pi suddenly stopped working.

It looked very strange – I could connect via ssh, but the Musicbox web-interface was not available. The solution was too straightforward – reinstalling Raspberry Pi. Later I discovered the sd-card got corrupted due to multiple hard power-offs.

At some point it all worked together, but I didn’t have any emotions left to rejoice.

It took me about two months of almost every evening (after my main work), which came with some exhaustion.

Final layout of the player

I still did some programming right until the flight, and also had to make Python program autostart when I was in Croatia.

Cutting the NFC-cards covers, night of the flight

Presentation

Ari, Andrew, me, Mich

It was a good one, despite the device looks.

Links

P.S. Want to say thanks to my wife who cheered me up many times during this project, helping me to go forward. Thank you 😘

P.S.S. I had a couple people asking me when I’m going to make the ones for sale and I started thinking about it. Let me know using this form if you are interested.

Originally published in my older blog in Russian in October 2019.

 No comments   2020   arduino   DI.FM   DIY   hardware   projects   raspberry pi