Arduino PPT Solar Charger

November 17, 2011 | electronics | By: Mark VandeWettering

A conversation I had recently got me on the topic of solar energy, and introduced me to something I hadn’t heard of before: maximum power point tracking. The basic idea is solar cells exhibit a complex non-linear relationship between illumination, temperature and resistance. This is usually represented by an curve that (for a given temperature and level of illumination) shows the relationship between current and voltage. Let’s swipe the diagram from wikipedia:

To maximize the transferred power, we want to maximize the power of the solar cell. This means operating the DC/DC converter at the particular point along the I-V curve where the area under the rectangle is maximized. Tim Nolan has designed a pretty cool circuit that when combined with an Arduino can do precisely that:

timnolan – Arduino PPT Solar Charger.

The details of the design are a bit beyond me at the moment (I’ve studied it for about 20 minutes) but the basic idea is to sample the voltage (via a voltage divider) and the current (derived from the voltage drop across a very small current sense resistor, amplified by an op amp), and then use the PWM capabilities of the Arduino to serve as a switching dc/dc converter. Very neat little circuit. I’ll study it more in the future.

Codec 2 at 1400 bits/s from David Rowe

November 15, 2011 | Amateur Radio | By: Mark VandeWettering

I’ve mentioned Codec 2 a few times in the past, but for those who don’t rememember, David Rowe has been working on a very low bitrate codec optimized for speech applications. This is of interest in amateur radio because we don’t have a suitable speech codec which isn’t patent encumbered (if for instance, DSTAR’s AMBE codec was not encumbered by patents, we could create open source versions which would be compatible with the DSTAR network).

David just announced that’s he’s got the codec down to 1400 bits per second. Check it out: it sounds pretty good.

Codec 2 at 1400 bits/s « Rowetel.

Even if you are’t interested in amateur radio, there are reasons to think this might be useful. David says that:

  • At 1400 bit/s you can send 45 phone calls in the same bandwidth required for a standard 64 kbit/s phone channel.
  • 1400 bit/s is 175 bytes/second
  • A 30 second voice mail can be stored in 5250 bytes
  • A 30 minute pod cast can be stored in 308 kbytes.

Very cool.

A nifty partition of 1..16

November 15, 2011 | Math, Puzzles | By: Mark VandeWettering

Courtesy of Phil Harvey’s Puzzle « Programming Praxis, I discovered that the numbers from 1..16 can be partitioned into two 8 element sets, with these nifty identities!

2+3+5+8+9+12+14+15 == 1+4+6+7+10+11+13+16
22+32+52+82+92+122+142+152 == 12+42+62+72+102+112+132+162
23+33+53+83+93+123+143+153 == 13+43+63+73+103+113+133+163

There has to be a good way to use this to make a cool geometric puzzle as well.\

Bonus: Are there any other values of N such that the numbers from 1..N can be split into two sets, each of which have the same sum, sum of squares, and sum of cubes?

Spoiler: Yes, there are.

ANGST: the Arduino n’ Gameduino Satellite Tracker

November 13, 2011 | Amateur Radio, Amateur Satellite, electronics, My Projects | By: Mark VandeWettering

I’ve stopped hacking on my Arduino/Gameduino satellite tracker for now. Here’s the final video demonstrating it running:


I’m currently working on the final schematic which will be posted on this permanent page. The code will be available github.com, for right now, it includes the library that I wrote that does the satellite prediction. I’ll be updating the code sometime later this week.

If you take it and use it, let me know: it will motivate me to do more with the code.

JeeNode v6 Kit from Modern Device

November 13, 2011 | Arduino, electronics | By: Mark VandeWettering

I’ve been playing a great deal with Arduinos lately, and have acquired a couple of Xbees to experiment with wireless. But Xbees, cool as they are, are kind of expensive for many tasks where a much simple RF link could suffice. Today, I ran across the JeeNode, which is available as a kit from Modern Device for just $22.50, and that includes a 915Mhz RF link. You’ll need an FTDI cable to program it, just like any other low cost Arduino. Pretty neat!

JeeNode v6 Kit | Modern Device.

Xv6, a simple Unix-like teaching operating system

November 10, 2011 | Operating Systems | By: Mark VandeWettering

I like operating systems. My first exposure to Unix was a revelation. Unix was a complex operating system that provided useful facilities for programmers, and it wasn’t written in assembler and locked away: it was written in C (the same language that you use to write ordinary programs for Unix) and it was understandable.

This was enhanced by The Lions Commentary on Sixth Edition Unix. It’s a brilliant commentary, clearly describing the source code for the Sixth Edition Unix. It filled a gap in the practical learning of operating systems for a generation of students.

But, well, it’s aging. It’s hard to use the Sixth Edition code, because it’s written for a PDP-11, in an archaic dialect of C, and well… we can do better.

Luckily, that’s what MIT thought too. They created an ANSI C version of the Sixth Edition Unix, compiled it for the x86 architecture in a way that could be run under the QEMU or BOCHS emulator. Here’s the page:

Xv6, a simple Unix-like teaching operating system

It’s less than 8K lines of C, under the MIT license. Seems like the kind of thing that could prove useful: bookmarked for future perusal.

VK3YE’s USB port powered 40 metre milliwatt transmitter on air

November 10, 2011 | Amateur Radio | By: Mark VandeWettering

I was looking for beacon circuits, and ran across VK3YE’s USB powered 40m transmitter. Unlike most simple beacon transmitters, this one transmits double sideband, which makes voice transmission possible. I like the basic idea!

USB port powered 40 metre milliwatt transmitter on air – YouTube



Very cool. He’s also got an awesome awesome YouTube channel, with over 180 vids uploaded. Lots of good information on crystal radios, homebrew, and low power operation. Snoop around! I was particularly intrigued by this video showing low power SSTV operation:



KD1JV on boost and buck converters implemented with an ATtiny13V

November 9, 2011 | Amateur Radio, electronics | By: Mark VandeWettering

Legendary QRP hacker Steve “Melt Solder” Weber has some awesome stuff on his website, particularly if you are interested in homebrew ham radio gear.   (Indeed, it appears he’s about ready to offer his legendary ATS-4 5 band rig kits again, experienced kit builders might want to check it out.)   But what drove me to his website this morning is quite clear exposition of buck and boost voltage converters in PDF form. Remember my ATtiny13 powered Halloween pumpkin? It was inefficient: about half of the power consumed in the circuit was simply lost as heat in the current limiting resistor. Had I read Steve’s exposition a month out from Halloween, I might have tried to do better.

Here’s the relevent circuit cribbed from his PDF:

Pretty simple! A couple of things to note: the NDT2955 is a logic level P type MOSFET, which turns fully on with a gate threshold of just 4V. Readers may remember that my own experiments with the IRF510 didn’t succeed in some small part because the IRF requires 10V to switch entirely on. Secondly, the ATtiny13 is powered directly from a 6V supply, through two diodes. These are there simply to drop the voltage to the 5.5V level which is the maximum safe amount. The ATtiny13V is very forgiving on voltages, and can operate all the way down to 1.8V, long after the batteries will have given up the vast majority of their power.

I’ll try to work through the equations and design a similar driver for my 1W Cree LEDs. To build it, i’ll need to come up with an appropriate MOSFET. Stay tuned.

Some simple circuits with solar cells…

November 8, 2011 | Amateur Science, electronics | By: Mark VandeWettering

My tinkering with my ATtiny13 based pumpkin circuit had me thinking that perhaps I should try to make something similar, but solar powered. Luckily, Windell had already anticipated my needs, and had put up a nice simple page with some circuits to experiment with. If you want a simple solar battery charger, or a simple solar powered microcontroller, try checking this out:

Simple Solar Circuits – Evil Mad Scientist Laboratories.

STM32L-Discovery: What should I build with it?

November 7, 2011 | electronics, My Projects | By: Mark VandeWettering

I got one of these boards the other day for free:

STM32L-DISCOVERY – STMicroelectronics.

Even if you didn’t get one for free, they seem to be pretty cheap: Nu Horizons has ’em for around $15, Mouser has them for $11.67, which makes them pretty much cheaper than every Arduino you can order. But what do you get for your dollars?

  • 32 bit processor with 128K flash, 16KB of RAM, 4KB EEPROM
  • DIP28 LCD Display
  • Linear touch sensor
  • Two user programmable LEDS
  • Can use either 5v or 3.3v supply, including power supplied by USB

Examining the information about the processor, the STM32L152RBT6, it appears to be based on the ARM Cortex M3, with a maximum clock rate of 32Mhz. The processor is optimized for very low power consumption, it only consumes 9 microamps of current at 32kHz in low power mode, and 230 microamps?Mhz in “dynamic run mode”. That sounds pretty cool! It’s data sheet says that it has 10 timers, up to 8 communication interfaces (including a full speed USB 2.0 interface) and a 12 bit ADC. From the data sheet:

A 12-bit analog-to-digital converters is embedded into STM32L15xxx devices with up to 24 external channels, performing conversions in single-shot or scan mode. In scan mode, automatic conversion is performed on a selected group of analog inputs. The ADC can be served by the DMA controller. An analog watchdog feature allows very precise monitoring of the converted voltage of one, some or all selected channels. An interrupt is generated when the converted voltage is outside the programmed thresholds.
The events generated by the general-purpose timers (TIMx) can be internally connected to the ADC start trigger and injection trigger, to allow the application to synchronize A/D conversions and timers.
The ADC includes a specific low power mode. The converter is able to operate at maximum speed even if the CPU is operating at a very low frequency and has an auto-shutdown function. The ADC’s runtime and analog front-end current consumption are thus minimized whatever the MCU operating mode.

All that sounds pretty cool!

Anybody have any good ideas of something I can do with it? Go ahead and leave a comment, or hit me via Twitter (@brainwagon) with your suggestions.

Has anyone noticed just how boring and useless Amateur Radio Newsline is?

November 3, 2011 | Amateur Radio | By: Mark VandeWettering

Like nearly everyone in the Bay Area, I spend too much time in my car, and one of the ways that I endure it is by listening to a lot of podcasts. Most of these are technical in nature, and in particular, I’ve sampled most of the ham radio podcasts out there. One of the primary sources of news is the Amateur Radio Newsline, and most weeks, I download it and listen to it.

And increasingly, every time I do, I shake my head and wonder why I am bothering.

Here’s the thing: it’s hardly got any amateur radio content on it at all.

Seriously. Go download any audio transcript, and try to find an actual story that contains something that actually enhances your enjoyment of amateur radio.

Let’s see how long it takes this week’s episode to get to a story that’s actually about ham radio:

  • News about the earthquake in Turkey. Yep, they had an earthquake. TRAC, the Turkish amateur radio society is helping out, Other than just saying that amateurs should stay off specific emergency frequencies if they are in use, no hint about anything any radio amateur can do. No names. No place to send donations. No mobilizations.
  • The FCC approved a set of new BPL rules, which don’t protect amateur frequencies from harmful interference. Might be interesting to people out there, but again, nobody to contact, no call to action, no names.
  • The FCC is going to have a national EAS test. Nothing to do with amateur radio.
  • Lots of intruders on 10m. Yes, illegal operators abound, particularly on 10m, and now that it is heating up, we’re hearing them. Is this news?
  • The National Capital Radio & Television Museum needs some space. Sounds like a fun place. Rather than talk about it, the story was mostly about their increasing lack of space and lack of handicapped access.
  • Odessa, Texas is considering a no-texting law. Yeah, hams get all upset when any law that might remotely keep them from operating mobile seems possible, but it’s not clear that this law applies to hams. My guess is: it doesn’t.
  • Enforcement actions. This is what annoys me absolutely the most about Amateur Radio Newsline. In every single episode, and sometimes even more than once, they take time to run essentially the same story over and over again (this week, there were enforcement actions against people in San Francisco and Florida):

    • Somebody was operating an unlicensed radio transmitter, most often which interferes with traditional broadcasters or police, fire, or other public safety services.
    • Said person is tracked down, and is found by the FCC to have been naughty.
    • The FCC fines them some amount (ten thousand dollars is typical), and gives them the customary 30 days to appeal.
    • This blogger dies a little inside.

    Here’s the thing: I don’t care. I can’t imagine that anyone cares. Operating an illegal transmitter is, well, illegal, but it has nothing to do with amateur radio. If I never hear the terms “notice of apparent liability” or “customary 30 days to either pay the fine, or file an appeal”, it will be too soon.

  • Gasp! Something actually ham radio related! A new 10m Digital Net! Huzzah!

We made it almost to the second break before we got something which might actually enhance your enjoyment of amateur radio.

Okay, I ranted enough: if you’ve made it this far, you deserve to have something nice tossed your way. Instead of listening to Amateur Radio Newsline, check out Martin and Colin’s ICQ Podcast. A father/son team, this good natured duo of hams from the UK pack together news, a feature, and typically propagation report or some other guest into each bi-weekly episode. Ham radio news, gathered and distributed by hams. I like it.

Nyle Steiner finds and demonstrates a memristor

November 3, 2011 | Amateur Science, electronics | By: Mark VandeWettering

Nyle Steiner, of the Spark Bang Buzz blog has been at it again, demonstrating cool electrical/electronic devices that are homebrewed. This time he constructed his own memristor.

If you aren’t up on electronics, you might not have heard of memristors before. While Leon Chua proposed that such a circuit element was possible, they weren’t actually created in a lab until 2008. But what is a memristor? It’s a circuit element whose resistance depends on the sum of the charge flowing through it. In other words, if you pass a voltage through a memristor in one direction, it’s resistance increases. If you pass a voltage through the other way, it decreases. But if you stop the voltage entirely, the memristor “remembers” the previous value it had, and will keep the same resistance it had when the charge was cut.

Amazingly, Nyle Steiner observed this memory effect in some brass shell casings which had been oxidized in a sulfur environment (I’m no chemist, so I won’t try to explain that part) over 10 years ago. He made this short video demonstrating such a memristor using both a curve tracer (which may take a few minutes of though to understand exactly what is going on) but also through a very basic circuit demonstrating how the memristor can “remember” a single bit and turn an LED on and off. If you didn’t know that memristor’s existed, you’d probably be forced to try to explain the behavior of the circuit in terms of capacitance: but unlike capacitance, the memristor doesn’t need to be refreshed to maintain its state. You’d find it rather puzzling, to be sure.

Awesome stuff.



Making some wallpaper with the sum of cosines…

November 2, 2011 | Computer Graphics | By: Mark VandeWettering

I was inspired by some Haskell code written by keegan, so I had to write a version of it in C. I didn’t do any animation, but I did have a lot of fun playing around with the parameters. For instance, check out the code, and how changing the value of N from 5, 7, and 19 generates interesting and cool patterns.

[sourcecode lang=”cpp”]

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>

/*
* quasi.c
*
* Some code, inspired by keegan @
* http://mainisusuallyafunction.blogspot.com/2011/10/quasicrystals-as-sums-of-waves-in-plane.html
* but presented without any further explanation.
*/

#define N (19)
#define XSIZE (1280)
#define YSIZE (720)
#define SCALE (0.2)

double x[N], y[N], ph[N] ;

double image[YSIZE][XSIZE] ;

int
main()
{
int i, j, k ;

for (i=0; i<N; i++) {
x[i] = cos(2.0 * M_PI * i / (double) N) ;
y[i] = sin(2.0 * M_PI * i / (double) N) ;
ph[i] = 0.0 ;
}

for (j=0; j<YSIZE; j++) {
for (i=0; i<XSIZE; i++) {
image[j][i] = 0. ;
for (k=0; k<N; k++) {
double d = (x[k] * (i – XSIZE / 2.) + y[k] * (j – YSIZE / 2.) + ph[k]) * SCALE ;
image[j][i] += (1.0 + cos(d)) / 2. ;
}
int t = (int) floor(image[j][i]) ;
assert(t >= 0.) ;
double v = image[j][i] – t ;
if (t % 2 == 1) v = 1. – v ;
image[j][i] = v ;
}
}

printf("P5\n%d %d\n%d\n", XSIZE, YSIZE, 255) ;
for (j=0; j<YSIZE; j++)
for (i=0; i<XSIZE; i++)
putchar(255. * image[j][i]) ;

return 0 ;
}
[/sourcecode]

Cool stuff!

BeagleBone, a new ARM-powered embedded platform

November 2, 2011 | electronics, Microcontrollers | By: Mark VandeWettering

I really like the Arduino, but even I must admit that performance-wise, it can be a little, well, disappointing. A 16Mhz 8 bit processor can do a lot, but there is also a lot of applications where having something a bit beefier makes a lot of sense. Something with support for a richer peripheral set, like USB, Ethernet, and video.

Thus, it is with some interest that I learned of the Beagle Bone:



The Beagle Bone

I haven’t got one, but there are a couple of features which I think make it attractive:

  • The price is $89. Yes, it’s more than an Arduino, but it’s not a lot more than an Arduino Mega, and it’s not any more than an Arduino Mega and an Ethernet shield.
  • Web based development environment. This is kind of a mixed bag, but one of the advantages of the Arduino environment is that it’s a one stop shopping trip to get setup: there isn’t a need to install a lot of different tools to get going. For hobbyists, letting people get right to work is a big plus.
  • Enough power to run OpenCV and the like. The Arduino is simply too underpowered to even think of doing anything like that, so the Bone represents a big increase in functionality.
    It runs Linux. Yes, it’s kind of fun to run on relatively naked hardware, but sometimes it’s more expedient to have some support for multitasking.

A couple of nits to pick though: I thought it should have included some kind of video interface on the base board. The $89 price point begins to look less and less attractive if you have to get a $20-$30 daughter board to provide the video interface.

I also think that it’s just a bit more expensive than I would like. If you compare it to the feature set of another microcontroller in the works, the Raspberry Pi, with a price of $35 dollars (for the Model B) with ethernet and video, but without the same level of expandability, the Raspberry Pi might be a good choice for education and hobbyist level hacking at a lower price (indeed, a price equal to an Arduino Uno).

To be fair, you can buy an Arduino Uno today, whereas the Beagle Bone and the Raspberry Pi are both still in the works.

It’s a great time for the hobby computer hacker though.

A Halloween Treat: What to do in a Zombie Attack

October 31, 2011 | Link of the Day | By: Mark VandeWettering

Happy Halloween everyone! I’ve kind of got zombies on the brain, which is better I suppose than having zombies munching your brain. I blame it all on the crew for the Zombie Tech podcast, despite their excellent taste in guests. Luckily, there is all sorts of good information on what to do in a Zombie Apocalypse: check out this civic defense film: