The Olimex Duinomite

A while back I was thinking about making a small board that would run it’s own OS and methodology for programming, similar to the computers of old such as the TRS-80 and the Commodore 64. Everything was on these machine for controlling simple tasks, video, audio and file stuff. All from the OS prompt. I always thought it’d be neat to have a microcontroller board that functioned similarly to the older computers but with IO.

Imagine my surprise when I discovered the Duinomite. I stumbled across it at dontronics and after reading a bit about it, I purchased it right away.

Duinomite

The Duinomite is basically a single board computer with a BASIC interpreter, VGA and Composite interface and a bunch of other little features which make it so awesome. It should also be noted that this idea was done first by Geoff Graham and his unit, the MaxiMite. It seems as though Olimex and Geoff were having a bit of a fight for a while but frankly, I don’t really know. All I can say is that it’s a really neat device and I’m glad that I bought it.

Duinomite board

Anyways, like I said, it has a basic interpreter on it. It allows you to program it with a ps2 keyboard or through the console on a virtual com port. The language itself is pretty rudimentary with no labels except for line number. No functions either. However, for simpler, less time intensive stuff, this board is ideal. Here are some screenies of the video display.

The video is pretty rudimentary, monochrome only, 324×216 or 320×200 in vga mode. It does seem to work ok though. The nice thing about this device is its easy access to a sd card so you can log data as well real easily.

anyways, I thought it was a neat device. anyways, check it out at http://www.olimex.com/dev/index.html

Data logging

As a side effect of trying this board out, I kept a couple of graphs. The first on is temperature versus time and the next is light level. I just wanted to try it out so I left it run overnight and here are the charts

I did something like this earlier, like 3 years ago. I’ve always found it neat to see such variation in a controlled environment. For example, the temperature graph shows when I closed the door to my office, the temperature dropped but you could see the furnace kicking on every 20 minutes.

Also, with the light. You can see I had the main light on. Then I turned it off. Then i left the monitor on when I left, eventually the monitor turned off and then as day broke you could see an increase in lighting.

I dunno, I think that kind of thing is cool.

Many Dev Boards… what to do?

First, an update about the annoyo, it worked perfectly and maximized irritation while making itself difficult to find. Anyways, I just received my BeagleBone and I promptly thought to myself, what am I going to do with this? Then I thought, hmmm, I have a bunch of other boards too.

These boards aren’t including the mps430 board, the pic boards, the mikroelectronika board or the Friendly ARM. Too many boards, not enough time. I’m sure I’ll use them for something I guess. Tomorrow begins the fun of interfacing the LS7166, it shouldn’t be too difficult.

Another pic10f200 project, the Annoyo!

I had this cool idea for a prank at the office, a device that generate sound every 6 minutes. This device generates 4 different sounds at 6 minute intervals. The idea is that the sounds are short, familiar, difficult to find and infrequent enough to prevent a hunt for the offending noise. This device has been done before and obviously much more professionally by others but it’s fun to make since all you need is 2 caps, a 10f200, a speaker and a battery.


The device itself is dead simple, simply find an old speaker you never use, preferably a small one so that you can drive it from the output pin. Using a small battery like I have there, you could probably let the device run for about 30 days. Here’s the design:

dead simple, once again. Only one output is used on this device, I even disabled MCLR so that there is no extra resistor. Just one cap for decoupling and one cap for producing a larger waveform for the speaker. You can change the cap size if you want, you may want a larger cap for a bit of a smoother wave. So, here’s the pinout and the source code and .hex file

  • GP0,1,3 -> Not connected
  • GP2 (pin 3) -> to speaker

Source and hex: 10f200 annoyo src.zip

Anyways, a couple of notes. This program was written with Oshonsoft basic. Also, it could have been written a bit smaller if I tried but as it stands it takes up 253 of 255 bytes available in flash. 🙂

Hope somebody has fun with this!

Building a quadrature generator with a PIC10F222

I need to start my new project with my digital RTJ gage and in order to do so I need to use the quadrature decoder chip LS7166. I could use the actual encoder I’m going to use for the project but it is large and unwieldy so I decided to build a generator for it.

The concept is simple, have a knob that produces no waveform in the middle of it’s stroke and as the pot deviates from the center, the speed of the signal increases also changing direction based on which side the knob id turned to. I couldn’t use a PIC10F200 much to my chagrin because it doesn’t have an ADC module built in, the PIC10F222 does however. It still works within my concept of low-end mcu’s doing valuable jobs since they’re still only 55 cents in quantity, from digikey of all places.

Overall, it’s a pretty simple design.

  • GP3 -> unconnected
  • GP2 -> Channel B out (Digital output)
  • GP1 -> Channel A out (Digital output)
  • GP0 -> 10k Potentiometer in (Analog in)

Dead simple. I did program a bit of a dead spot in the middle so that one can stop the quadrature from advancing quite easily. I put 2 LEDs on it to indicate that it is in fact working. Anyways, here’s the source (again it’s in Oshonsoft BASIC)

10f222 quadrature src.zip

I didn’t bother drawing up a circuit diagram since it’s such an easy circuit but here’s an additional image if you’re really curious. keep in mind that the board I’m using is Stripboard (aka Veroboard) so the traces run along one direction

Now for the fun challenge of making a simple serial interface MCU to the LS7166.

10f200 debouncing and a new compiler

I’ve noticed some people doing search terms for debouncing and I figured I would post my method of debouncing inputs from switches. Some people have a big thing with using caps and resistors and gates with hysteresis but I prefer to simply use a cheap microcontroller because the result is programmable, MCU’s are cheap and there are fewer parts than the usual arrangements. Here is a crude circuit diagram of the debouncer. for this circuit the arrangement is (Input GP3 -> Output GP1)(Input GP2 -> Output GP0)

The problem with some other MCU methods is that people often try checking every 5ms to see if two successive input were high. This is a faulty approach since it can be computationally wasteful and can still produce noise. My approach is as follows:

  1. read the input on a loop
  2. if the input is high, increment a counter up to a certain maximum (say 90)
  3. if the counter goes above a certain amount (say 60) then turn on the output
  4. if the input is low, decrement the counter until it reaches 0
  5. if the counter goes below a certain amount (say 30) then turn off the output
  6. Don’t change the value of the output between 30 and 60

What this does is ensures that there is an area of hysteresis where the noise or bounce of the switch will not generate noise on the output. You can play with the rules to suit your specific need and improve responsiveness or make the output resilient to accidental triggering. This is the reason why for some more important things I have used this method. I have used a pic16f505 for this purpose as well with larger arrays of buttons. Having a programmed method that you can change easily can give you an easy ‘jellybean’ solution for these kinds of problems. Mind you of course when dealing with switches in high noise environments you may need to optoisolate or run TVSs on the switch.

If you’ve read any of my other posts you’ll know that I like the PIC10F200 MCUs simply because of their simplicity and the fact that a lot of people write them off as useless. This design is pretty crude as you can see and that leads me into the topic of the compiler. First,  here is a sample hex file for debouncing – debounce. This hex is programmed to premit a pressed switch to activate after 11ms.

I recently bought a suite of compilers from OshonSoft since I drifted over there out of pure chance. This company is a one man show who sells a variety of BASIC compilers for PIC, Z80 and 8085 processors. I tried the 10f compiler and was immediately impressed with how, for so inexpensively, there was a useful tool for simulation and programming.

I’ve only used the 10f compiler so far but it beats the tar out of PicBASIC Pro, as far as I can tell thus far. Not a lot of frills or gimmicks but it outputs very tight code. Here’s the source for the debouncer pic10f200. You can download a demo version of the 10f simulator at his website.

debouncesrc.zip

Well, anyways, that’s my little treatise on the subject. Also, for those of you on a tight budget and just getting into microcontrollers, Oshonsoft might be a good place to buy a compiler that’s reasonably simple.

Ugluino, the ugly Arduino powered robot

So, even though I’ve built a wide variety of crap over the last few years, all of them with varying utility, I’ve decided to build a quick robot. With oodles of free time and the feeling of having to go back to work on the horizon after what feels like an eternity of holiday (1 week) I quickly grabbed a bunch of stuff I had sitting around and put this guy together with all the grace of a kindergarten macaroni art sculpture.

Ugluino Being Built

Based off of an Arduino Nano, this guy works just fine. I don’t like using Arduinos for the following reasons.

  • Perceived lack of control of what’s going on inside
  • Feels like cheating since it’s so easy
  • Arduino UI is kind of shitty, especially for larger source files.
  • When dealing with AI routines, making it difficult to use multiple files is a minus

Anyways, i plugged ahead and quickly pounded this out with the following IO

  • Input – The only one, the Echo pin on the ultrasonic sensor
  • Output – Trigger on ultrasonic sensor
  • 4 Digital output – for controlling direction on SN754410 Quad half h-bridge driver. These go to two gear motors which are attached directly to wheels
  • 1 PWM out for duty on motors
  • 1 attached servo out of the servo to turn the sensor
The back end of the Ugluino

Most everything worked out swimmingly until I fucked around with some wiring and produced a short. I hooked the robot on to the USB supply on my computer, I noticed after a few second that the power to the unit wasn’t running… hmmm POOF! Well, as it turned out, there was a problem with the wiring to the ultrasonic dealy and it blew what I beleive was a zener diode

I wasn’t able to figure out exactly what it was, I suspect that it is a zener diode that selects between main power and USB since it is on the output of the VReg. I could be wrong. Since I didn’t have any more Arduino Nano’s I simply tried to fix it and soldered a wire across the offending gap. The device seems to work fine…? Anyways, if anyone know what that part was on the Arduino Nano v3.0, I’d like to know ’cause I couldn’t find the 3.0 Schematics and the design has moved those parts around.

Anyways, The robot moves around based on a very simple algorithm.

  1. Stop Moving
  2. Scan from 40Deg Right to 40 Deg Left in 10 deg increments
  3. return appropriate movement from a function that analyses it
  4. execute proper movement (Forward, Backward, Right, Left, Hard Right and Hard Left)
  5. rinse
  6. repeat

It seemed to work reasonably well. I’d like to build a more sturdy version for shits and giggles so that I can play with the algorithms. I’m probably gonna build one with a PIC18F2685 instead of an Arduino. Also, instead of a single sensor, I will use IR proximity sensors to detect low lying objects. Moving the sensor with the Servo make the robot seem more intelligent than it actually is like it’s ‘looking around’. I quite like that. 🙂

Anyways, it’s my first post of the year, considering it’s January 1st and 3:52 am as I write this. maybe I should go to bed. Here’s a video of it getting around.