Archive

Author Archive

DIY Baby Monitor

10/11/2016 3 comments

I recently discovered WebRTC in another project and wanted to try it out in some home project. Since our another home project is nearing it’s delivery, a baby monitor seemed to be in the (very long) list of things to buy.

Our baby will probably be sleeping mostly outside in the baby carriage and I wanted some kind of device with live picture thats viewable anywhere in the house to keep an eye on him while doing something else. WebRTC seemed to fit the bill since it works wherever a recent enough browsed is available like in the Android tablet we have in the space between our kitchen and the living room. I tried to use ready software and 3D-printable parts wherever possible to make something usable fast. Read more…

Controlling Opal branded wireless electrical socket

The weather is getting so cold currently that the cars heater needs to be turned on for more than an hour. Since I don’t want to wake up any earlier than possible, I went to get a socket that could be remotely timed. I found Belking Wemo switch, but unfortunately it proved to be an utter waste of money. The configuration software is extremely poor and the device refused to connect to my homes access point no matter what I tried.

I had previously bought cheap sockets with a remote. These were branded “Opal” and cost next to nothing in a pack of two sockets and one remote and they seem to work well enough. Only minus was the strange 12v battery the remote uses.

_DSC3951

Socket, front

I popped open the remote to check how it worked. The layout seems to be easy enough. The +12v from the battery is dropped to +5v for the microcontrolled under the epoxy blob. The controller scans the keypad and generates the code which is fed to RF part. The RF transmitter requires the +12v straight from the battery and operates in 433 MHz frequency. I cut the signal trace from the controller to the transmitter and soldered wires to the test pad in the signal trace and the ground. Using the oscilloscope I checked what the controller is outputting when the keys are pressed.

Read more…

Autoleveling with proximity sensor

24/12/2015 3 comments
g2s

Geeetech G2S

I have a Geeetech G2S 3D-printer, which features autoleveling out of the box. Unfortunately the autoleveling is pretty much a joke, consisting of piece of bended wire and a microswitch. Due to the wire flexing, the probe will get different values when the head is moving from left to right than from right to left.

s-l1600

Inductive proximity sensor

I saw someone experimenting with the inductive proximity sensor for autoleveling. These sensors are usually used in applications like limit switches in the garage door openers. They aren’t designed for accuracy and thus I was a bit skeptic how it would work out. The sensors only detect metals, but for G2S it’s not an issue as it has a steel heat bed. Out of recommendation, I bought LJ18A3-8-Z/BX sensor from eBay. The benefit of this type of a sensor is the long detection range, which allows to position the sensor higher than the print head. This way there’s no need to manually lower and raise the sensor before starting the print. The downside is that the sensor needs +12v and also outputs the same voltage, so it can’t be directly connected to the endstop connector.

Read more…

Categories: 3D Printing, Electronics

Giving Kyosho iReceiver unlimited range*

15/03/2015 3 comments
_DSC2605

Kyosho EP Blizzard SR

Screen Shot 2015-03-15 at 13.17.24

iReceiver (c) Kyosho

A while ago I bought a version of Kyosho Blizzard, which features the new iReceiver which lets you control standard servos and ESC’s with your tablet or mobile phone. There’s also a camera fixed to Blizzard’s fuselage for streaming video. I didn’t have high expectations about the video performance but for the video the range is really poor. For controlling, the range is what you would expect for wi-fi device, about 50 m. The application however stops streaming the video as soon as it detects even a slight packet loss, which generally happens after 20 m. The thought arose, that since mobile networks are nearly ubiquitous, how about tunneling the traffic via 3g connection?

Read more…

“H-Series” Security camera

This post is mostly a note for myself, but might prove useful for other also. A while back I bought a security camera to my home from Dealextreme. It was typical Chinese quality with strange translations and weird software but worked nevertheless. I decided to buy another for my company and chose this model again from Dealextreme and thought that it’s the same camera with updated resolution. I was very wrong, this time the cameras internal software was so buggy that it almost made it unusable. The camera has no brand or name or anything, but the manufacturer is probably Wansview.

Read more…

PebbleMondo

16/06/2014 2 comments
PebbleMondo beta

PebbleMondo beta

I recently switched from Sports Tracker to Runkeeper, because the latter one offers integration with the Pebble smart watch. However both of those refused to work with my Polar heart rate sensor so I ended up with Endomondo. I wanted to keep the Pebble integration, but apparently even though that there are few threads in the interwebs requesting this feature, it does not seem to be in the list for now.

Endomondo does not offer any API to query information, but I noticed that when it’s not the active application it posts a notification with some very useful information. Since I heard that it’s possible for Android application to catch the notification messages posted by other programs, I decided to write my own adapter for Pebble.

Example notification

Example notification

It proved to be quite difficult to extract the sent information since it’s wrapped into RemoteView object, which does not provide any useful way to tinker with its contents. Finally I found an example from the Stack Overflow which gives an example how do this. Unfortunately the only way seems to be using introspection which is never recommended but seems to work.

The application gets the following information:

  • Duration of exercise
  • Calories burned
  • Heart rate
  • Distance

The information is sent to Pebble’s built-in sports application, so no extra application slot is used from the watch. Unfortunately the watch app is not customizable. It has a display for pace and speed and neither of those is available from Endomondo, so I’m reusing those fields for calories and pulse. User can toggle between these numbers by pressing the middle button on the watch.

The watch application will start automatically when Endomondo starts pushing notifications. The included Android app only displays some instructions and is required by the Play store. The actual program runs as a service on the phone and it needs to be given access to application notifications from the settings menu.

Application source code is available here: https://gitorious.org/pebblemondo

Installable application is available from the Play store against small support fee: https://play.google.com/store/apps/details?id=com.jannem.pebblemondo

Disclaimer: This application is not associated with Endomondo® or Pebble®

Categories: Uncategorized

Thesis audiobook aka. Thesis grenade

Thesis grenade, almost finished
Thesis audiobook, contents missing

Idea

As a good friend of mine, Ville Kotimäki (who is also an excellent photographer btw) just finished his PhD, some figuring out some present to give was in order. I got an idea to machine some really solid piece out of aluminum and engrave it with text. I also wanted it to play something, as it seems to be a recurring theme for me.

The initial idea was to build a fire alarm siren inside an aluminum container, which would be welded shut and would only have ON button, but no means to turn it off. The idea was shortly scratched because also I would have to listen to it. The second iteration was to make the container read out the thesis like an audiobook.

Text

Fortunately I managed to recruit my friend Heikki to do all the laborious tasks. We started by downloading the thesis pdf. The pdf was converted to text and Heikki did they most annoying part of the project by cleaning the text files from badly converted items like equations, picture captions and tables etc. In the meanwhile I tried a few different speech synthesis programs. I would have liked to use some open source software, but most of them sounded like Stephen Hawking on a bad day.

The commercial Nuance was far superior to everything else I tried. Nobody seemed to have a license for it but there is a nifty feature in OS X that it has text to speech support by Nuance and from system preferences menu you can even download additional voices from Nuance. Heikki proceeded to write a script, which splits the text file to single pages. These pages are then converted to speech with “say” command in OS X and resulting AIFF files are converted to WAV files suitable for wav library we used in Arduino.

Container

The container itself was first drafted on a piece of paper. The measurements were dictated by the speaker we used (diameter 66mm) and the fact that on the inside there are speaker, 9v battery and power switch on top of each other. My brother machined the container shape from solid aluminum with a manual lathe from the drawing. Engraving and machining of the legs and drilling the bottom to let the sound out was designed with Alphacam software and machined with Haas UMC-750 5-axis machining center at my company G-Tronic.

I thought the engraving would be an easy job with Alphacam , but it turned out that the post processor which generates code for the machining center from cad drawing had a few nasty bugs resulting the tool occasionally to go through the work piece. Eventually I had to resort the help of professional machinists at the company, but (or because of that) the finished product looks great! The black effect on text is achieved by coloring it over with a black sharpie and wiping it over with a tissue dipped in acetone.

Electronics

The schematic for the device is really simple. SD-card is connected in parallel with ISP interface to ATMega328p. Since SD-cards operate with 3.3v voltage, LM328 regulator drops voltage from 9v battery to 3.3v. BC547 transistor acts as a extremely simple audio amplifier, switching 9v voltage to speaker commanded by processors pwm output. Not and audiophile solution but works surprisingly well in this case. Since Heikki wanted to learn some electronics, I just drew the schematic in Eagle and left him the job of figuring parts arrangement on the stripboard and soldering the parts together.

We had a great trouble with the first version. We tried to use LD1117V33 fixed voltage regulator. When measured, it outputted solid 3.3v but the ATMega just would not start to execute the code. The thing worked without problems when powered with PSU. Only explanation I can think about is that the regulator starts to oscillate, but when we checked the output with oscilloscope, there was nothing obvious visible. In the end we exchanged the regulator with trusty old LM328 and the problems went away. The circuit draws about 170 mA, which translates to roughly 3h of usage from 9v battery, but we figured out that no sane person wants to listen this for more than couple of minutes at the time. Note that the connector SV2 pinout is not the same than SD-card pinout! For example how to connect the SD-Card to avr, see here.

Firmware

The firmware itself is quite straightforward, the only difficulty was the user interface since there is only a power button and we did not want the device to start at the beginning of the book each time. We also wanted a couple of different voices to read the book. On the SD-card, audio files are saved with file name pattern <page (number)>-<voice (number)>.wav. When the device is turned on, it randomizes one of the three voices to use. Each time it finishes playing one page (one file), it saves the next page number to eeprom memory. When device is turned on, it starts to play from the saved page. If the device is turned off before it finishes to play back one page, the counter resets to the beginning of the book. There’s even a nifty page turn sound saved in every other file.

When we initially tested the setup on Arduino UNO board, we used TMRPCM library. It worked well, but on the final hardware, we used the internal 8MHz oscillator instead of 16MHz crystal and found out that the library does not support other that 16MHz clock speed. We changed the library to superior SimpleSDAudio, which enabled us to use 31.250 kHz sampling rate @ 8 Mhz. The library seemed also to have smaller compiled size, but that was irrelevant to us since we are only using 10k of 32k code space.

Result

I was really happy with the finished device. Some Ville’s friend dubbed the device to “Thesis Grenade”, which is quite accurate by the looks of it =) The video below is a little bit repetitive, I tried to demonstrate the different voices used, but the random generator decided to use one same voice for many times.