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:

Wednesday, February 18, 2015

Minimalistic Arduino

In order to build a minimalistic Arduino, you need:
  • one 10kOhm resistor
  • two 22pF capacitors
  • one 100nF capacitor
  • one 16.000Mhz quartz oscillator
  • the ATMEGA 328P-chip (best with preinstalled bootloader)
  • a 5V Voltage-supply and some wiring
  • something for programming the chip (existing Arduino-Board or a USB-FTDI-Serial converter)
  • one LED and a 150 Ohm resistor (two of both if you want one for the voltage supply as well)
  • switch (Reset switch)
  • USB-FTDI-Serialchip / Arduinoboard
the basic schematic:
minimalistic Ardunio schematic (with optional reset-switch)
If you like the default LED on PIN 13 on the original Arduinoboard, connect first the LED to Pin 19  (right after AVCC), then the 150 Ohm resistor to the LED and the other end to ground.

If you want to supply your project with for example 9V from a battery you can build a simple voltageregulator like this (not suited for AC-Input!):

simple DC-Voltageregulator
all you need is a LM7805 and two 10uF capacitors. If you want, you can connect a LED with resistor to the 5V output (in order to see if the Atmega is under power).

If you are using a USB-FTDI-Serialchip (UFSC) connect the DTR/RST-PIN to the RESET-Pin of the Atmega via a 100nF capacitor. RX of the UFSC goes to the TX of the Atmega and the TX of the UFSC goes to the RX-Pin of the Atmega.

Sunday, February 8, 2015

Arduino & EasyDriver & Steppermotor

If you'd like to run a steppermotor with your Arduino, you're going to need a EasyDriver. This chip allows you to connect a variety of different steppermotors and supply them with their needed voltage (in most cases 12 V). Most common steppermotors will have four wires comming out of them which connect as follows:

Wiring of the EasyDriver, the Arduino and the steppermotor (LED is optional)

If you have a motor with six wires comming out of it, try connecting the two outer and the two inner wires to the chip.

The following Arduinocode has been modified so that you can connect up to three EasyDriver-chips. If you like you can connect three LEDs to Pins 11, 12 and 13 in order to see which motor is supposed to be running (don't forget to use appropriate resistors).

The EasyDriver has a few more connectors you can use:

Most important are ENABLE and SLP (Sleep). You can connect each of them to a seperate Arduino PIN and use the digitalWrite(PIN, HIGH) command to activate them. The difference between these two:
  • ENABLE set to HIGH will stop the powersupply to the steppermotor (you will be able to turn the motor shaft by hand), the IC is still under power.
  • SLP set to LOW will stop the powersupply of the motor and will put the IC into a hibernate-mode. Waking the IC up again can take some time (a few ms)

Monday, September 22, 2014

Arduino, QC1602A and HC-SR04

There are two ways to connect a LCD-Display and an Arduino: Via I2C or by connecting them as follows:

Wiring of the Arduino, HC-SR04 and the LCD-Display

The Arduino-Code: