It is 12:30 at night and I was woken up by a thunderstorm raging outside. Heard the rain, saw the flashes, and heard the thunder. Went downstairs to look at the output of the AS3935 based lighting detector. Dang thing is just listing most of the lightning strikes as “disturbers”. Only rarely is it calling them strikes. Just now the house shook from strike less than a mile away the device did not pick it up.
Either I have something wrong with the support circuit or software, or this chip is not worth the silicon is was made from. I would love to hear from other users if they have had good luck picking up storms.
Over the weekend I took a side trip with my AVC processor to include a wireless BlueTooth transceiver. This will allow me to communicate with the robot as I run various experiments. It turned out to be fairly easy. Continue reading
I have been playing with the magnetometer in the Pololu 9DOF IMU. I recorded the data into a CSV file and plotted it in Excel. At the time I did not think much about it, but one evening as i was drifting off to sleep, I suddenly wondered why the Z axis (vertical) reading were so much larger than the x or y. Z was about twice the the maximum of X or Y.
After downloading the World Magnetic Model software, I now have an answer. In my neck of the woods (New Hampshire N42, W78) the magnetic flux lines are not even remotely parallel to the surface of the Earth. In fact they dive down at a 68 degree angle towards the North pole!
This accounts for the large values of Z flux and the tiny weight on marine compasses that allow you to balance the compass dial. If you did not adjust the weight as you move north the needle would dive down to the North and not be level. This also explains why when you buy a top of the line marine mechanical compass you are often asked where you sail so they can set it up for you.
A few months ago I came to the realization that I would have to abandon my bid for AVC this year. A whole bunch of issues came up in my work and private life that made it impossible to work on the project. I had half considered flying out just to watch the competition, but the expense of it just did not seem to be appropriate. But that does mean I have a full year to get get ready for the next AVC!
And along those lines, I have gotten some time to get back working with my entry. Over the last few days I have been characterizing the magnetometer in the Pololu 9Dof IMU. I built a 2 foot diameter non motorized turntable with a one degree accurate scale. I put the IMU on the turntable and recorded 20 data points at every 10 degrees. Plotting the X and Y data gave a very nice sinusoidal 90 degree out of phase plot. Interestingly the sensitivity of each axis seems a little different and not centered on zero.
The next test was to to the same data collection, but this time with the electronics board on the RC car. Again the data was nicely sinusoidal, but this time with a significant offset in the X axis. The X axis is aligned with the motor and I suspect the permanent magnet in the motor is causing the shift. It is also possible the battery or other ferrous metals are to blame.
The next test will be to collect data with the motor powered up. My guess is that all hell will break lose. Part of it from pure electrical noise, but mostly from all the magnetic flux kicked up by the motor. After this test will be one to determine how far away the IMU needs to be from the motor and will a MuMetal shield have any effect.
I also managed to get down to Boston last weekend and stopped in at You Do It Electronics in Needham. Fun store and I spend two hours browsing and came away $80 poorer. Amazing how a small bag of doodads added up that fast.
I took my first jump into GitHub as a contributor. I put my current AS3935 based application called “Striker” into the repository. You can find it here:
This should now get me off the hook for several of you asking for the code!
Please note that I am using full bit-banging I2C interface. It turns out the AS3935 bug is not just on the first read of register 0, but all reads and writes of it. I had considered a hybrid solution of using the Wire library to access the bulk of the registers and a bit bang solution for register 0. But it practice this was painful to implement.
What I hope to do is look at the Wire library and ‘adjust’ it to ignore the incorrect NAK during the address cycle for register 0. But that will have to wait.
You will also notice that the Arduino has a pin to control an LED, a horn, and a silence switch. It also has a pin to control a spark generator to provide self test capability. This is not tested yet as my oscilloscope had to go back for service before I could get the lightning simulator working.
After three weeks of banging my head against a brick wall, I confirmed last night that the AS3935 has an issue with the I2C interface. There is an issue with the chip that prevents reading register zero without violating the I2C protocol. Interestingly, once you read it the first time, it works properly for the rest of that power cycle. I have confirmed this on the Embedded Adventures and Tautic Electronics (in I2C mode). Continue reading
The more I bang my head against this chip, the more I am certain there are ‘issues’ with it. I can now read and write every register with amazing repeatability except register zero. This register refuses to be read or written to. I have now crafted an email to the manufacturer asking them for help. Now I have already discovered one thing about this chip that leave me scratching my head how any competent engineer could have made such a stupid mistake. It would not surprise me that they also decided that register zero was off limits and yet claim full read write ability in the manual. So now I sit back and wait for an answer. Meanwhile, I am playing with my TE cooler. I can stabilize the temperature with a PID control loop. My only worry is that I think I am going to need a pretty big heat sink. More on this later.
I was having problems with reliable communications with the lightning detector chip over the I2C bus. Sometimes I would read a register and it would not be at all what I was expecting. The situation was during calibration when I was reading register 8 and suddenly one of the control bits would get set to zero. Since I was only reading this register, having a bit change value was unexpected. And it was not just a read problem because the functionality of that was controlled by the bit changed as well. Continue reading
I just purchased a rather larger (1″ dia, 3/4″ thick) N52 super magnet to erase MiniDV video tapes. Wow! What an amazing thing. I can see why I had to agree to all the safety notices on the item. If you get your finger pinched by it, it would do some damage. Not finger severing, but it would certainly bring up a nice blood blister!
This thing is so strong you can hang a few pounds from it with only the contact with a wallboard screw! And yes, with a few swirls, a MiniDV tape is completely erased. For those interested, K&J magnetics is the place to go.
I have been having problems with the I2C interface on a chip I have been playing with. Since I do not have an I2C bus analyzer (nor can I afford one!), I have been using my scope to decode bus transactions. That that gets old very quickly. So why not automate the process? Continue reading