Sunday, August 27, 2017

NodeMcu + LCD - WiFi network scanner

After figuring out how to connect a LCD with I2C-backpack to the NodeMcu, I had the idea to program a simple network-scanner.

Connections between NodeMcu and the 20x4-LCD with I2C-backpack

The Code (uploaded via the Arduino-IDE):


You might need to install the ESP8266 and LiquidCrystal_I2C-library (if you haven't already). Arduino-IDE-> Sketch-> Include Library-> Manage Libraries -> search for ESP8266 / LiquidCrystal I2C.

Monday, July 17, 2017

CD81-Nixie + K155ID1 + Arduino

The general "problem" with driving nixie tubes, is that they need between 130 and 210V DC in order to work. On Mike's PBX Cookbook's webpage you can find schematics for a power-supply (see picture below).

schematic for a nixie-powersupply

For testing purposes I recreated the above power-supply on a single-sided PCB:

power-supply for testing CD81-nixie-tubes

Once you have the power-supply (you can buy them as well, see Threeneuron's Pile o'Poo for example), you need to decide how you want to switch the different segments of your Nixie-tubes on and off. On Mike's webpage you can find the approach of using multiple transistors (MMBTA92 / MMBTA42 in case of a CD81-tube). A much simpler and cheaper solution are nixie-drivers like the K155ID1 (you can find them relatively cheap on ebay).

Pins of the K155ID1

For each nixie-tube you want to use, you need one of those driver-ICs. Each IC is then connected with four wires to the arduino as follows:

wiring (fritzing templates from cslamar's github-page)

For the following code you need to connect:

K155ID1-Pin Arduino-Pin
A 2
B 3
C 4
D 5
Vcc 5V
GND GND

The Anode-Pin of the nixie-tube gets connected to the +130V of the power-supply. All the other pins get connected accordingly to the K155ID1-pins.

Test-Arduino-Code (from lucadentella.it):

In the end you should get something like this:

CD81-nixie test-cycling

Tuesday, August 2, 2016

Arduino Laserengraver

Introduction

In short: If you want to control a laser engraver with a PC you'll need a microcontroller (connected via USB/WLAN to a PC) and drivers for the stepper motors. The microcontroller (in this case the arduino) needs software, which can take gcode-commands (coming form the PC) and turn these into signals for the motor-drivers. Thankfully this software already exists - it's called grbl (homepage on github, backup: zip-file). grbl is intended for three-axis cnc-machines. In order for the homing-function to work properly, you have to change the following lines in the config.h-file:


Hardware

First, I wanted to build a laserengraver by myself. After several attempts though, I realized that buying a kit / something where everything already fits, would cost me less (in parts, time and nerves). So I bought the makeblock xy-Plotter with the Laserengraver head. If you are interested in building your own, a search on instructables might help you. Otherwise looking for projects on kickstarter might be a good idea (laserengravers/-cutters appear periodically).

makeblock xy-plotter with laserengraverhead
Since the laser burns stuff, you can get quite a lot of smelly smoke. Putting it inside a box / adding some venting is a good idea.

Controller

After the assembly and testing the recommended software, I managed to burn out one of the stepper-drivers. Not wanting to buy a new one and already having a plethora of electric components form my first attempts, I made my own pcb.

Laserengraver-contoller with Arduino Pro Mini

If you google grbl + shield you'll find that there are several people who have done the same and are selling their boards (there is even one for the raspberry-pi). If you don't want to buy one: I drew mine with fritzing and used the direct-toner-method for etching.
In order to control the laser (needs 12V DC) you can use the pin A3 (originally for the coolant-control).

Laserengraver wiring
Since the arduino can't output 12V you'll need a MOSFET to turn the laser on and off (Gcode-Commands M8 and M9). In the above picture the wiring for a 30N06LE N-channel MOSFET is displayed.

connections for grbl

Software

In order to send g-code to the arduino/grbl-controller from your PC you'll need a programm like grblcontroller, UniversalGCode-Sender, bCNC, ... . In order to generate the gcode-files from pictures i use inkscape with the "J Tech Photonics Laser Tool"-plugin. Another (simpler) solution is a program like reaConverter.

possible "workflow" for turning images into gcode
If you want to turn dxf-files into gcode, have a look at CamBam (the oldest version is for free).

One idea for a first engraving might be a bird's eye view of your home town. Google maps offers an API, which allows the change of visibility and style of different maps elments. The website Snazzy Maps allows you to do this online:



End result:

engraving of custom maps-image

Monday, July 18, 2016

WiFi - Nixieclock

finished clock inside the wooden case
In order to get a nixietube to light up, you need a rather high DC-voltage source (around 140V). With modern IC's it is possible to generate the environment needed, but switching the pins of the tube with a normal 5V-microcontroller (the arduino for example), calls for the right transistor. - You can of course find them online, but as it turns out (at least in my case), they're rather expensive and pretty small (SMD-size). Since I don't have the tools for such tiny electrical components, I decided to simply buy nixietube-modules for the arduino.

QS30-1 nixietube-module for arduino; Website/picture taken from: http://www.nixieclock.org/
You can buy mutliple of these modules and daisy-chain them toghether. Afterwards, you connect five wires to your arduino, add the library to your IDE (download zip), and use the example-code as a skeleton for your own implementation. So if you want to build a clock using these modules, you need an additional microcontroller and a RTC-module.

In my case, I used the DS3231 RTC and a arduino-compatible WiFi-breakout called "Wemos D1 R2". This way I could use the code from my previous post (Set RTC via WiFi -> timezone-adjustment gets described there) and simply add the nixie-library in order to control the tubes/show the date. For this setup I made a small single-sided pcb for the Wemos in fritzing:

single-sided pcb designed in frizting
As you can see, the pcb needs six jumper wires. - If you don't like that, you can always make it a double-sided pcb - or simply use nothing put jumper wires and leave it at that - the pcb is not required.

detail of the connection between the module and pcb
The wiring for the RTC is the same as described in the earlier post (Set RTC via WiFi). If you have a 5V-DC-powersupply lying around, you can simply use this one to power the Wemos and the nixie-modules. I hadn't, so I added a small DC-buck-converter to the assembly (connected to the upper four breakoutpins of "J2" → V in, GND in, GND out, 5V out).

Because the code for this project is too long for this post, here's only an excerpt. You can download the complete arduino-program here. If you are interested in the fritzing-file, leave a comment down below. The github-page: link

Thursday, July 7, 2016

Set RTC via WiFi

If you have WiFi-access, you can set your real-time-clock (RTC) with the help of the network time protocol (NTP) If there's no WiFi, using a radio-time-reciever might be a good option (see post about DCF77).

This post describes how you can set a DS3231-module via a WLAN-connection using the ESP8266-based "Wemos D1 R2"-board.

Wemos D1 R2 and DS3231-RTC-module

If you want to programm the Wemos-board with the Arduino IDE, you'll probably need to install the CH340 driver-package first (webpage with instructions, backup zip-file). After that, you add the ESP8266-library to your Arduino-IDE. For this you best follow the instruction on the github-page (backup zip-file). 
If you are going to use the DS3231-RTC-module you'll need to add the libraries in this zip-file as well (datasheets are attached).
And last, if not already installed, you'll need the time-library as well (Sketch → Include Library → Add .ZIP Library; backup zip-file).

wire-connections between the wemos and DS3231

Connect the wemos and the RTC as follows:

Wemos DS3231
D14/SDA/D4 SDA
D15/SCL/D3 SCL
5V VCC
GND GND

The code for this project is rather long. Shown below are only the setup und loop-function. You can download the complete Arduino-project here.



Timezone adjustment

The variable "timeZone" on line number 18 is equal to the UTC time offset. The calcualtion goes like this:

Time your clock has to show = UTC + time offset 

So if you live in the UK for example, your value for "timeZone" would be 0.
If you live in Manaus, Bolivia, the value for "timeZone" has to be -4.

To find out how much this offset has to be, you can check out the list on wikipedia, or use the following map:

Standard World Time Zones

Monday, December 21, 2015

Arduino radio controlled clock

In order to build a radio controlled clock with the arduino, you need a DCF reciever. In this post the receiver board from conrad is being used (Nr. 641138). For the display the Seven-Segment-LED-Backpack from Adafruit is utilized. - You can of course replace it with any display you like (an LCD for example). The circuit:


DCF + Arduino + Seven-Segment-Display

The pullup-resistor and the filtercap are necessary for the reciever board to work. They aren't needed for the 7-seg-display.

Circuit on breadboard

In order for the DCF-code to work you'll need to add three Arduino-libraries to the IDE (Sketch->Include Library-> Add .ZIP Library): DCF77, Time and Timezone.
I had trouble with compiling the examples included in the DCF77-library. Updating the Time-library resolved that problem (link).

In order to run the 7-seg-display you'll need the library from adafruit: github-link

The code:


Above code is set for the central european timezone. If you live somewhere else, in the UK for example, change the value of "LocalTime" in the fifth to last line to "UK.toLocal(DCFtime)". The same goes for other timezones (they get declared / are listed at the beginning of the code).

It takes around two minutes for the clock to get the current time. You can follow the process by opening the Serial Monitor of the Arduino IDE.

Saturday, May 16, 2015

Arduino Ethernet and Weathershield

A combination of the weathershield from sparkfun and the Ethernet-Arduino:

Ethernet-Arduino and the Weathershield
What the webpage looks like:

type the IP-adress directly into the url-bar of your browser

The code: