User avatar
mntmst
Posts: 57
Joined: Thu Sep 27, 2012 11:26 pm
Location: Fairview, Oregon

Super Blood Moon

Fri Sep 25, 2015 8:27 pm

I'm running a little science project with one of my kids for the upcoming Lunar eclipse using an RPi2 to record changes in the moon light as it passes into the cone of the earths shadow.

The basic hardware is pretty simple: ADS1220 24-bit Delta-sigma ADC connected via SPI from a original Gertboard at 20 SPS for 20 true bits of resolution.
http://www.ti.com/lit/ds/symlink/ads1220.pdf
Calibration:
Image
System on a test cart in my shop:
Image
ADS1220 module:
Image
Photo detectors: (solar panels)
Image
Solar panels are not low noise sensors so it takes quite a bit of processing to get stable low level signals from them.
For this a custom driver just for this application was adapted from another driver I wrote that selects the needed modes, inputs and internal filters on the device for proper operation as a kernel module for the Comedi DAQ library. Then a simple user program using the Comedi DAQ library interface was written to read data from the chip for more signal processing before the logging the final data into a text file for later use with a spreadsheet.
https://github.com/nsaspook/nidaq700/tr ... /supermoon

The result for a typical nights (with clouds) run leading up to the eclipse: line and circle chart.
The little isolated spikes are from airplane landing lights flying near the house, they stop late in the night.
Link to the original sized image for Sept 23: https://c1.staticflickr.com/1/722/21059 ... 64_o_d.png

Image
Time is counter-clockwise, voltage from the center chart for Sept 24:
Image

The moon that night when it was clear from a DSLR camera:
Image
Voltage and power logged. Power in the uW range for moonlight vs 240W on sunlit panels.
Image

User avatar
mntmst
Posts: 57
Joined: Thu Sep 27, 2012 11:26 pm
Location: Fairview, Oregon

Re: Super Blood Moon

Sat Sep 26, 2015 5:08 am

More hardware related information.

The ADC uses SPI mode 1
The output of the ADC is binary twos complement so the RAW output has been converted in software to bipolar binary twos complement format for the user library.

Image
Kernel program header

Code: Select all

/*
 *     comedi/drivers/supermoon.c
 * 
 *	A special version for the TI ADS1220 SD ADC converter chip (and MCP3911 later) for low voltage sensing and
 *	solar panel panel light detection. +- 2.048, 1.024 and 0.512 voltage ranges @ 20 bits of usable resolution
 *	ADC is in single-shot conversion mode @20SPS, PGA disabled and gain from 1, 2 and 4 in differential
 *	signal detection mode, 50/60Hz rejection enabled. 500kHz SPI clock with direct RPi2 connection
 *	Analog +- 2.5VDC from Zener regulators for the bipolar input stage with external 2.5VDC Zener input
 *	signal protection.
 * 
 *	LEDs: + supply, - supply, DRDY__ LOW
 * 
 *	Board jumpers J1 Left to Right
 *	1 3.3VDC digital supply for direct connection to RPi2 board
 *	2 5.0VDC digital supply for optical interconnects for 5VDC or 3.3VDC SPI interfaces
 *	3 Enable 5VDC power
 * 
 * DIP8 Pins for MCP3002 header
 * 25K22	                               RPi DIP8 header   IDC 10 pin connector header	ADS1220
 * Pin 21   RB0	SPI Chip-Select	Pin 1		8	CS		                       2
 * Pin 22   RB1	SPI Clock         	Pin 7		7	SCK		                       1
 * Pin 23   RB2	SPI Data In	        Pin 5		6	SDI		                       16
 * Pin 24   RB3	SPI Data Out	        Pin 6		5	SDO		                       15
 * Pin 8    Vss			                Pin 4		10	GND		               4
 * Pin 20   Vdd			                Pin 8		9	Vdd 3.3/5.0VDC	      13
 * Pin 2    RA0	ANA0		        Pin 2		1	nc
 * Pin 3    RA1	ANA1		        Pin 3		2	nc

// The Comedi analog input framework contains the data needed to interface with user programs 
// in a standard way by having variables and pointers to the needed functions to 
// control, configure and read data

	if (devpriv->ai_spi->device_type == ADS1220) {
			/* we support single-ended (ground) & diff bipolar  */
			s->maxdata = (1 << thisboard->n_aichan_bits_ads1220) - 1;
			s->range_table = &range_ads1220_ai;
			s->n_chan = thisboard->n_aichan_ads1220;
			s->len_chanlist = 1;
			s->insn_config = daqgert_ai_insn_config;
			if (devpriv->smp) {
				s->subdev_flags = SDF_READABLE | SDF_DIFF | SDF_GROUND
					| SDF_CMD_READ | SDF_COMMON;
				s->do_cmdtest = daqgert_ai_cmdtest;
				s->do_cmd = daqgert_ai_cmd;
				s->poll = daqgert_ai_poll;
				s->cancel = daqgert_ai_cancel;
			} else {
				s->subdev_flags = SDF_READABLE | SDF_DIFF | SDF_GROUND
					| SDF_COMMON;
			}
		}
Early build construction: Input filter caps (mylar film) and metal film resistors to reduce thermal noise.
Sensor power is from 2 9volt batteries using a 3.3 LDO regulator for the digital and two 2.5volt Zeners for the +- analog input supply to the ADC. The other two chips are for a optical isolation circuit that's not used with the RPi and has it's own 5volt switcher regulator that's disabled here.
The two power indicators are LEDs in series with the Zener dropping resistors and the other LED flashes when a conversion is complete.
Image

Module boot and loading syslog

Code: Select all

[    3.181813] spi spi0.1: setting up native-CS1 as GPIO 7
[    3.186151] spi spi0.0: setting up native-CS0 as GPIO 8
[    3.192659] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[    3.373413] comedi: module is from the staging directory, the quality is unknown, you have been warned.
[    3.373422] comedi: module is from the staging directory, the quality is unknown, you have been warned.
[    3.377380] comedi: version 0.7.76 - http://www.comedi.org
[    3.413526] daq_gert: module is from the staging directory, the quality is unknown, you have been warned.
[    3.413676] daq_gert: module is from the staging directory, the quality is unknown, you have been warned.
[    3.415490] spigert spi0.1: default setup: cd 1: 1000000 Hz: bpw 8, mode 0x3
[    3.415814] spigert spi0.0: default setup: cd 0: 30000 Hz: bpw 8, mode 0x1
[    3.416913] comedi comedi0: 4 cpu(s) online for threads
[    3.416936] comedi comedi0: board setup: spi cd 1: 8000000 Hz: mode 0x3: assigned to dac devices
[    3.417601] comedi comedi0: board setup: spi cd 0: 500000 Hz: mode 0x1: assigned to adc devices
[    3.417641] comedi comedi0: Gertboard WiringPi pins setup
[    3.417655] comedi comedi0: RPi new scheme rev a21041, serial 000000007678e2db, new rev 1
[    3.417665] comedi comedi0: driver gpio board rev 3
[    3.417679] comedi comedi0: Gertboard WPi pins set [0..7] to outputs
[    3.417689] comedi comedi0: Gertboard spi slave device detection started, daqgert_conf option value 4
[    3.418454] comedi comedi0: ADS1220 spi adc chip board detected, 5 channels, range code 0, device code 24, bits code 0, PIC code 1, detect Code 0
[    3.418761] comedi comedi0: daq_gert attached: gpio iobase 0x3f200000, ioremaps 0xbb9c8000  0xf3003000, io pins 0x0, 1Mhz timer value 0x0:0x53f98d
[    3.433189] comedi comedi0: driver 'daq_gert' has successfully auto-configured 'Gertboard'.
The brass plates are ground plane/shields for the input filter and are connected to the metal box for (some) electrostatic shielding. The resistor plugs are for the current/power calculations. The user program is calibrated for a 4.7k load across the balanced input terminals from a protection network on the panel MC4 connections to handle a voltage overload condition. (>2.5vdc)
Image

Used my Omega CL511 calibrator set on 2000mV to dial the voltages in with signal software filtering off.
Image

Linux software used to generate charts from the logged data.
Image

User avatar
mntmst
Posts: 57
Joined: Thu Sep 27, 2012 11:26 pm
Location: Fairview, Oregon

Re: Super Blood Moon

Sun Sep 27, 2015 3:58 am

Not very clear as I was with the wife and her friend picking herbal medicines on a hill with just my crappy tablet camera.

Moon rise near Mt. Hood on the day before the Super Blood Moon.
Image

I've got a HD-3000 webcam for the PI to see if I can also synchronize video with the data collection.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 15050
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Super Blood Moon

Sun Sep 27, 2015 10:06 am

enlarged pictures from their stamp size to full size using size=150 markers.
further enlarge them with a right click option. Note the pictures also auto download for some strange reason.

p.s. more info about the Super Blood Moon event here: http://earthsky.org/tonight/total-lunar ... 27-28-2015

User avatar
mntmst
Posts: 57
Joined: Thu Sep 27, 2012 11:26 pm
Location: Fairview, Oregon

Re: Super Blood Moon

Mon Sep 28, 2015 4:59 am

Moon shots from Oregon.
Blood Moon:
Image
Moving back from the full eclipse:
Image
Image
Image

Tonights moon power run will be will be with 7 panels for ~500W of sunlit power.

Main array:
Image
Image
Image

User avatar
mntmst
Posts: 57
Joined: Thu Sep 27, 2012 11:26 pm
Location: Fairview, Oregon

Re: Super Blood Moon

Wed Sep 30, 2015 5:03 am

I've posted the data from the event here: https://www.physicsforums.com/threads/p ... st-5243967

User avatar
mntmst
Posts: 57
Joined: Thu Sep 27, 2012 11:26 pm
Location: Fairview, Oregon

Re: Super Blood Moon

Fri Oct 02, 2015 11:31 pm

The ADS1220 ADC with the PI worked out perfectly as the frontend for the detector. If you need a low noise, low power 24-bit device for low level signal data it's a good choice.

Here are a few FFT pictures of the noise levels with the input connected to a 4.7k metal film resistor. The RPi data logger generates SIGVIEW files for the analysis program.

19.5 samples per second, data is in microvolts with a small DC offset with the resistor.
Image
Image
Input shorted.
Image

Return to “Other projects”