Kategori Extern

11 okt

5 Comments

Aarhus Mini Maker Faire 2015

Af

banner

I 2014 blev der for første gang afholdt Mini Maker Faire i Danmark, nærmere bestemt i Aarhus. Vi var med dengang (dog kun om lørdagen), og da det blev annonceret at begivenheden skulle gentages i 2015, begyndte vi at forberede os.

Vi endte med at tage 5 personer afsted begge dage, og vi havde en bred vifte af projekter med:


Kørestolsrobotten, som vi også tidligere har fortalt om. I dagens anledning var der koblet en PS3-controller til, så den kunne styres trådløst. Den var et stort hit, især hos børnene, men også blandt mange voksne.

stol

Det var svært at køre stærkt indendøre, men på et tidspunk fik vi lejlighed til at tage den med udendørs:

Senere gentog vi successen, hvor den blev filmet af en drone:


Sejlbåden – desværre havde vi ikke plads i bilen til vand, men Thomas og Jesper lavde et hurtigt hack, så roret kunne bevæge sig:

båd2


Anders’ LED-cube:

cube


Demo af Kamstrup aflæsning: Vi havde taget PHKs PyKamstrup kode og tilføjet grafer vha. matplotlib. (Koden er her hvis nogen er interesseret).

Vi havde lavet en håndfuld byggesæt, og vi fik faktisk solgt fire af dem.

kamstrup


Det uden sammenligning mest nørdede projekt var datatransmission over dåsetelefon: Ved hjælp af minimodem, en højttaler og en mikrofon sendte vi en ASCII-udgave af Star Wars fra en PC til en anden:

dåser

sw

(Ja, hostname er I-CAN-do-it. Undskyld.)


Vi havde også taget Johns filament-extruder med. Vi fik ikke ekstruderet så meget, men til gengæld kom der en forbi der vidste alt om ekstrudering af plast, så vi fik en håndfuld nyttige tips med hjem.

extruder


Daniel havde medbragt prototypen af sin berøringsfrie kontakt:

kontakt


Naturligvis kan man ikke tage til MMF uden en 3D-printer, så den gode gamle Taz var også med, sammen med et udvalg af printede ting. Den mest populære af disse var uden en tvivl en “Useless Box”, som Anders havde lavet (den lyseblå kasse på billedet).

taz


Desuden havde Jesper taget sin retroradio med:

radio


Det var et par gode dage, hvor vi fik en masse besøgende og fik lejlighed til at hænge ud med vores fellow hackers i OSAA og Labitat.

Gemt under: Events, Extern, Udvalgte posts

31 aug

0 Comments

Measuring high DC supply voltage with an Arduino

Af

For my home-monitoring setup I would like an Arduino to measure the supply voltage it is getting from a DC battery UPS (Uninteruptible Power Supply). Unfortunately (actually by design, but that’s another story), the power supply is 24V, which means it will put out anywhere from 21.3V-29.8V (according to the manufacturer), which is far too much to measure with the Arduino’s 0-5V input range. For simplicity’s sake, lets assume we want to measure a 20-30V voltage. The immediate answer is to use a voltage divider, which will bring a voltage in the 0-30V range into the 0-5V range. The general formula for the resistor divider is:

    \[V_{out} = \frac{R_2}{R_1+R_2} \cdot V_{in}\]

We want V_{in} = 30 to give V_{out} = 5, so

    \[\frac{5}{30} = \frac{R_2}{R_1+R_2}\]

resistordivider Now, just as a sanity check we should calculate the current of the resistor divider, to make sure we’re not converting too much electricity into heat. Ohm’s law gives us

    \[ I = \frac{U}{R}\]

which in this cases gives

    \[ I = \frac{30}{12000} = 0.0025 A = 2.5 mA\]

No problems there. This works okay, but we lose a lot of precision, as only ~1/3 of the Arduino’s range is actually used: the Arduino’s ADC has 1024 different readings between 0-5V, so when reading the 0-30V range the precision is just about 30V / 1024 \approx 0.03 V over the range. If only we could move the lower bound, so that 20V would map to 0V on the Arduino. A wild Zener Diode appears! One use of a Zener diode is as a voltage shifter. voltageshifter Zener diode voltage shifter. This work is licensed under the Creative Commons Attribution 3.0 License, https://en.wikipedia.org/wiki/File:VoltageShifter2.png. The closest Zener diode I could find was an 18V of the BZX79 series. This resulted in the following circuit: zener-voltage-divider which I hacked into my Arduino box. Hacked supply monitoring Now, theoretically the formula for translating an voltage at the Arduino to the supply voltage should be:

    \[Vcc = V_{in} / (4700/(4700+6800)) + 18 = V_{in} \cdot 2.4468 + 18\]

I then did some quick measurements of various input voltages and the resulting voltage at the Arduino pin:
Input voltage Arduino pin
18V 0.32V
20V 1.16V
26V 3.60V
28V 4.41V
29V 4.81V
Plot it into a spreadsheet, create a graph and add a linear regression gives: Now, this formula is a bit different compared to the theoretical one, mainly in the Zener diode drop. However, the datasheet for the BZX79 actually has the 18V C-type (\plusminus 5\%) as between 16.8-19.1V, so this is well within spec. Since this is just a one-off, I’m happy to just use the measured formula, as this will be more accurate. The final precision should be 12V / 1024 = 0.012V. The current should be around I = \frac{U}{R} = 30V/11500 Ohm \cdot 1000 \frac{mA}{A} = 2.6mA, which again is ok.

Gemt under: Extern, HAL9k

Tags: ,

17 jun

0 Comments

Roomba 500-series Easy Scheduling using an Arduino

Af

DSC_0879
I have a iRobot Roomba 500-series vacuum cleaner robot, but without any remote, or command center or anything; alas, I have to push a button everytime I want the cleaning revolution to start :-(

But no more! It turns out the Roomba can be programmed, quite easily, to schedule automatically, and all you need is:

  • 1 Arduino
  • 2 wires

The Roomba actually supports a serial protocol, the iRobot Roomba 500 Open Interface Specification, that allows remote control, driving, sensoring, and scheduling.

Finding the serial port

Remove the plastic cover. It is easiest to remove the vacuum bin, and carefully pry it off with a screwdriver.
DSC_0882DSC_0884

There should be a 7-pin plug, on the right side. It has the following pinout:

Roomba serial pinout

Roomba serial pinout

Program the Arduino

Use this sketch (download: roombaschedule.ino):


/*
Set a schedule on an iRobot Roomba 500 series, using just an Arduino.
Mads Chr. Olesen, 2015.
*/

const byte currentDay = 3;
// 0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday
const byte currentHour = 2;
const byte currentMinute = 58;

// Schedule
const byte SUNDAY = 0x01, MONDAY = 0x02, TUESDAY = 0x04, WEDNESDAY = 0x08, THURSDAY = 0x10, FRIDAY = 0x20, SATURDAY = 0x40;

const byte daystorun = SUNDAY | MONDAY | WEDNESDAY | FRIDAY;
const byte times[14] = {
3, 0, // Sunday time
3, 0, // Monday time
3, 0, // Tuesday time
3, 0, // Wednesday time
3, 0, // Thursday time
3, 0, // Friday time
3, 0, // Saturday time
};

const int ledPin = 13;

void setup() {
Serial.begin(115200);
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, 0);

Serial.write(128); //Start
delay(1000);
Serial.write(131); //Safe mode, turns off Roomba light
delay(1000);
Serial.write(128); //Start, back to passive mode
delay(500);

//Set day time
Serial.write(168);
Serial.write(currentDay);
Serial.write(currentHour);
Serial.write(currentMinute);
delay(500);

//Set schedule
Serial.write(167);
Serial.write(daystorun);
for (int i = 0; i < 14; i++) {
Serial.write(times[i]);
}
}

void loop() {
digitalWrite(ledPin, 1);
delay(1000);
digitalWrite(ledPin, 0);
delay(1000);
}

You need to modify the variables at the top: set currentDay, currentHour, currentMinute according to the present time.
The pre-programmed schedule is to clean at 03:00 on Sunday, Monday, Wednesday and Friday. You can change this if you wish, by altering the daystorun and times variables.

If you don't modify the schedule, the Roomba should start automatically after 2 minutes.

Put it all together

You should now have a partially undressed Roomba, and a programmed Arduino. Now it is time to connect them. With both unpowered, connect the following:

  • Arduino GND to Roomba ground (pin 6)
  • Arduino TX (pin 1 on e.g. Uno) to Roomba RX (pin 3)

It should look like this:

DSC_0886

Now, the moment of truth. Press the "CLEAN" button on the Roomba, the light should go on. Plug in the USB for the Arduino. The Roomba light should turn off briefly, and after a few seconds the Arduino should blink it's LED. The schedule is now programmed, all done!

Gemt under: Extern, HAL9k

Tags: ,

24 mar

0 Comments

HAL9k; now with awesome electrical and network installation

Af

The local hacker space here in Aalborg (HAL9k) has moved from Rapsgade 1 to a permanent location at Sofiendalsvej 80. For a number of weeks we he been moving boxes of all our stuff, painting walls and other tasks related to the move. One of the things that I was involved in was the electricity installation and the computer network.

We have been so lucky to inherit a large number of metal and plastic cable trays including a number of Ethernet jacks and power outlets reducing the budget for establishing a new infrastructure at the new place.

After a lot of work, 50 m metal, 20 m plastic cable tray and 1,2 km Ethernet cable later we now have 74 ethernet jacks connected to our distribution frame with our two 48 port gigabit Dell switches connected to an OpenBSD firewall in VMware on our Dell R710 server, routing IPv4 and IPv6 (through a SIXXS tunnel). Thank you to Xena for the switches and the server.

The wireless network is handled by a 802.11a/b/g access point. The access point and the directional antennas are actually meant for outdoor usage, so we mounted it on an IKEA table leg to give it a touch of the rustic outdoor life on a large pole…
If you are curious about the details of the network setup check out the hal9k wiki here.

Besides the network installation we have also installed a new distribution board and a lot of power outlets. We have a dedicated power meter for the server room besides the three other power meters (which according to our plan will be monitored by our LIAB) and relays for the groups used in the workshops making integration with the physical access control system and emergency buttons easily done.

 

IMG_3762 IMG_4140 IMG_4145 IMG_4155 IMG_4156 IMG_4159 IMG_4171 IMG_4174 IMG_4180

 

 

 

 

 

 

Gemt under: Extern, HAL9k

Tags:

30 okt

0 Comments

POS printers and Python

Af

I had this old POS (Point Of Sale) receipt printer laying around for some time and thought it could be fun to play a bit with it. Printing plain text is simply done by sending it as characters via a serial connection. Cutting the paper is some ESC code which i found in a manual online. Printing images was a bit more tricky, since it is requires some specific codes, depending on how the dots in a vertical bar, equal to the height of a character, must be composed. I wrote a small Python module integrating the ability to print images, text etc.  since I could not find anything online simliar to what i wanted.

At the local hacker space (HAL9k) we have now received a large box full of used receipt printers, VFDs etc. and some of the members have asked for the module for printing images so I have uploaded pyPOSprinter to GitHub. It makes use of pySerial for communicating with the printer and Python Image Library for reading image files. The included example also shows how to use pyQRNative to print QR-codes (bar codes are soo last centory :-)  ).

from pyqrnative import PyQRNative
qr = PyQRNative.QRCode(5, PyQRNative.QRErrorCorrectLevel.Q)
qr.addData(“http://www.sman.dk”)
qr.make()
im = qr.makeImage()
ims = im.resize((525,525))
from POSprinter import POSprinter
printer = POSprinter.POSprinter()
printer.write(“Hello Puffy\n”, align=”center”)
printer.lineFeed(2)
printer.printImgFromFile(“puffy.gif”, resolution=”low”, scale=1.0)
printer.write(“Friske agurker paa glas”, rcolStr=”200 DKK”)
printer.lineFeed(2)
printer.printImgFromPILObject(ims, scale=0.5)
printer.lineFeedCut()