Yesterday I tore into a Keurig machine that I saved from a landfill. The machine no longer worked and I don't really even recall what, but I have another Keurig that collects dust (I use a drip coffee maker), so why not.
- This could be the beginning of something, I'm not sure what though
- I now have two check valves and three pumps. One of those pumps works (the other two, I'm not so sure). These are not self-priming pumps. Two of the pumps and the aerator are marked at 100 mA, which is nice and low but still too much to be driven directly from an Arduino pin.
- The tank can be pretty useful. It has a thermocouple and overheat switch on the side, a heating element at the bottom, and several probes on the top.
- This is dangerous work. Lots of sharp plastic. I'm fairly certain these were made to be assembled only.
One of the things I was looking into is a digital compass module. These are modules that return a direction it is pointing relative to magnetic north.
I started by using the Bus Pirate to access and read the module. I did that as below:
m <-- for menu
4 <-- for I2C
3 <-- for 100KHz
I2C>(1) <-- I2C Address Search
Searching I2C address space. Found devices at:
0x3C(0x1E W) 0x3D(0x1E R)
I2C>[0x3c 0x00 0x70] <--Set measurement mode to 8-average, 15Hz
I2C START BIT
WRITE: 0x3C ACK
WRITE: 0x00 ACK
WRITE: 0x70 ACK
I2C STOP BIT
I2C>[0x3c 0x01 0xa0] <-- Set gain to 5
I2C START BIT
WRITE: 0x3C ACK
WRITE: 0x01 ACK
WRITE: 0xA0 ACK
I2C STOP BIT
I2C>[0x3c 0x02 0x01] <-- Set to single-measurement mode
I2C START BIT
WRITE: 0x3C ACK
WRITE: 0x02 ACK
WRITE: 0x01 ACK
I2C STOP BIT
I2C>[0x3d r:6] <-- Read 6 bytes
I2C START BIT
WRITE: 0x3D ACK
READ: 0xFF ACK 0xFD ACK 0xFF ACK 0x98 ACK 0x00 ACK 0x5F
I2C STOP BIT
This returned 0xFF, 0xFD for X, 0xFF, 0x98 for Y, and 0x00, 0x5F for Z. This is Twos Compliment Form, which is best explained by this Stack Overflow Community Wiki.
X Coordinate (0xFF): Binary 1111 1111 + 0xFD: Binary 1111 1101
Y Coordinate (0xFF): Binary 1111 1001 + 0x98: Binary 1001 1000
Z Coordinate (0x00): Binary 0000 0000 + 0x5F: Binary 0101 1111
Ultimately, this is where I stopped. I know it works, I have some ideas on how changes affect it. Now on to an Arduino.
Arduino Micro Setup
I plugged this into an Arduino Micro on a breadboard as below. The 5V, ground, pin 2/SDA, and pin 3/SCL were connected as shown (note that the compass on the left can be ignored - I have two and they are both in the breadboard just to keep them somewhere safe).
One of the more difficult parts of this is ensuring you're in the correct pins on the Micro - the numbers are small and not centered on the pin.
The code is below. I started with code from Sparkfun and modified it as necessary.
Right now, this is functional. There will be more to come.
I saw that on Reddit today, and it is a real reminder that if you like reading my site or any like it, Net Neutrality is pretty damn important.
If you haven't filed comments with the FCC or taken action otherwise, please do so and show your support for an open Internet so you can still read this blog and the many other fine blogs out there.
73 de KE8P
I bought an Arduino Due a while back, and not having anything seriously pressing, it was set aside for other things.
The Due has a lot of differences from other Arduinos for various reasons. The stuff you'll see on most websites leads with "it's 32 bits and runs at 3.3 volts!". And those are important - any non-EE like me using an Arduino thinks at 5 volts, and in some cases you can blow up a Due with that much voltage. But there are more important differences:
- 4 serial connections
The Mega has 4 also, but the Uno and Leonardo have 1. Some things, like GPS receivers and the APRS Shield use serial connections, so this is a more-is-merrier situation.
- 2 I2C channels broken out and labeled
All of the Arduinos have I2C interfaces, but they are not labeled on the Uno, Leonardo, and Mega. Really, this is just an inconvenience because you can look up the correct pins. The Due labels them so you don't have to look them up, and the Due is the only current Arduino board that has two I2C interfaces.
I2C is useful for a lot of sensors, including temperature sensors, EEPROMs, real-time clocks, digital compass modules, and DACs.
- 2 Digital-Analog Converters (DACs)
On the Uno, Leonardo, and Mega, there are no DAC converters - the analogWrite command writes to PWM outputs on those processors and that output is still 5V, but the output is a square wave that makes some things (like LEDs) look like you've reduced the voltage, when really you've reduced the amount of time that the voltage is on. Wikipedia has a longer explanation.
DAC converters do not output a PWM signal. Instead the actual voltage is output, so if you give a 3.3V DAC a command corresponding to 50%, it will output 1.65V DC (NOT PWM!).
- Controller Area Network (CAN) breakouts
CAN is mostly used in vehicles in part of the On Board Diagnostics (OBD-II) system, but it is being adopted elsewhere. It's adoption may continue with increased adoption of the Internet of Things.
- Digital Signal Processing
Perhaps one of the more interesting parts of the board where amateur radio is concerned is that the main chip (where all the magic happens) is powerful enough (between being 32 bits and 84 MHz) that it can do Fast Fourier Transform operations as well as number crunching operations. Since there are both ADCs and DACs, an analog input can be sampled to digital data, processed, and then output through the DAC back to an analog waveform. See an example at M0XPD's blog. This also enables the use of the Due as an SDR (another link to M0XPD's blog).
I'm going to be doing a lot more here with the Due, so this should break me out of the no-post-slump I've been in.
If you currently use a newsreader (e.g. Feed.ly) to get my blog OR you have it as a feed on your website, please check your URL and ensure it is going to ke8p.us. The ac8jo.us domain will be disappearing in about 2 months and I don't intend to renew it.
RSS URL: http://www.ke8p.us/feed/
In 45 days (around September 19), I will be changing the domain over to a different page and breaking anything that starts with ac8jo.us.
Thanks to the good service of UPS (that's with one S, not that other group that leaves my parts sitting somewhere in Chicago for three days), I am now the proud owner of a solder station.
The sound from it is not too loud with the blower on, and of course when the blower is off there is no noise. It heats up VERY quickly, too. I'm used to my cheap old Radio Shack pencil iron taking 5+ minutes to heat up, and this heated up in about 30 seconds.
The temperatures are in Centigrade, so it'll be something to get used to, but no big deal. And it was $50 via eBay (the link now goes to a more expensive item by the same seller).
Today, I got to drive home without windshield wipers in a rainstorm. Fortunately, no crashes and no tickets.
The problem has been a lingering problem and even slowed my drive to work last week because I had to stop and shake the connector to the wiper's pulse board. After the drive home today, I decided it was time to fix it. I knew there was content out on the internet and I found this video from Road Rage Customs that basically said to replace the board. I also knew that there was a resoldering fix.
Lemme think here... drop $21 on a new board or touch it with a soldering iron?
After re-installing the board, I tested the wipers and they worked except the driver's side wiper was a little loose. I removed the cover and tightened the bolt holding the wiper arm down and tested again. Works!
I'm writing most of this as the ARRL June VHF contest is underway. With the 706 still laid up (parts did NOT come on Friday the 13th with a full moon... positive omen? No.), it's on the bench gathering a little dust.
So I noticed in QST the August 70cm contest. I have 20' (+/-) of masts, and 20 watts on 70 cm, and I can make an antenna... but I would need a good directional antenna because I have no interest in buying a 400 MHz linear amp for a contest that I may not have any contacts in.
"Good directional antenna" means a yagi or a quad. It also means it needs to be rotatable. I could just turn the entire mast, but I don't know how that will work - my poles are fiberglass, and will have to be guyed, so that may be easier said than done. I have a junk box full of stepper motors, I have some Arduinos... this could get fun. Even better, it is temporary, so I don't have to drop big bucks to do this.
So my thinking is that I want an inexpensive home-built rotator. I want the rotator to know where the antenna is pointing, and there are two components to this - a rotation sensor to tell me where the antenna is pointing and a sensor to act like a compass to tell me where north is.
All that being said, this is post 1 of 2.
For the hobbyist, there are basically four encoder options: optical, magnetic, capacitive, and mechanical. These can be incremental - where it tells you that there is change and how much the change is (or a pulse on change) or absolute (where it gives you a specific position).
Optical encoders are commonly found in printers and scanners, and the same concept was used by Ben Heckendorn on his Doggie Treat Dispenser. These have an optical sensor that looks for dark/light marks on a disk on a rotating shaft. I don't know about prices for these, since I have a few of them from a coworker's printer that stopped working.
Magnetic encoders operate by using a magnet and a hall effect sensor to sense the change in the magnetic field due to the magnet's rotation. I'm guessing (operative word!) that these are bad to use in strong magnetic fields (like near a motor, hard drive, or one of those big electromagnets used in junkyards to lift cars).
It appears the only magnetic encoders available (for hobbyists) are analog - they give a voltage output based on the rotational position. This has the benefit of being absolute or semi-absolute. Prices range from $10 to $45 from the big US suppliers. Their use with an Arduino would be similar to the use of a light sensor (although the voltage divider may be built into the sensor, so you may not need to have one separate).
Capacitive encoders work similarly to optical encoders, but instead of using a beam of light, it uses a set of disks and a capacitance sensor. Benefits (according to CUI) are that dust can mess up optical encoders and that LEDs can burn out.
Capacitive rotary encoders run around $25 and provide up to 2,048 positions of output (that's one every .18 degrees!). Looking at the linked item, it seems to be the most ready-to-use sensor, depending on the application.
Mechanical rotary encoders are common in selector switches. They have mechanical rings inside (I couldn't find a good explanation of how this works). They are inexpensive and common, but I'm not sure of their use within an antenna rotator. Truthfully, the amount of torque needed to turn a selector switch is so much that I'm not sure this is really an option.
As the only picture on this post indicates, I have a motor with a sensor. I am going to build that into some sort of rotator that can be mounted on top of a fiberglass pole that I can use to turn the antenna. I don't know if I can have it done by August, but I'm going to try... presuming I get the 706 fixed first!
I built an iGate.
I basically used the instructions from KB9MWR, although aprsx was giving me fits. I have soundmodem running on Debian (it's much easier to get it working there than Ubuntu), and the latest aprsx compiled locally.
Hopefully by the time the evening rolls around, more will fill up this map gated by me.
Note that my location on the map is near, but not at, my house (not that I'm not really hard to find, with the magic of ULS/QRZ and Google Street View).
You can see the stats on aprs.fi. At the time I'm finishing this post, I've only gated 6 stations through and they are only digipeaters and weather stations. I have seen position packets through, but I don't know if they are not being gated or if they are but APRSIS isn't sending them because they are duplicates.
Either way, coverage on SR 32 (a high traffic highway) and SR 125 (a high traffic roadway) now have some coverage, and it looks like a local nearby digi is down for now (the owner has indicated in a blog post that he's moved, so it may be back sometime).
Despite working at the food booth for the Milford Hamfest, I did get some time to get into the boneyard. I came back with a few things.
Not a bad haul.