Jump to content
43oh

Solar Driveway Light to MSP430 Wireless Sensor Node


Recommended Posts

  • Replies 42
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Greetings!  I am new to the forum and this is my first solo microcontroller project.  Please be kind to me as I am a Geographer and by no means a programmer or electrical engineer.  Stupid questions s

Nice project & code!  One word of caution with the nRF24 handler code (your main while(1) loop)--   w_tx_payload(32, buf); msprf24_activate_tx(); LPM4; // Put the RF transceiver back

Baby boy was born and I have been sick for a week and a half so that has slowed my progress.  I did play with the bypass switch on the DC booster and came to the conclusion that I need to reduce the t

Posted Images

Nice project & code!  One word of caution with the nRF24 handler code (your main while(1) loop)--

 

		w_tx_payload(32, buf);
		msprf24_activate_tx();
		LPM4;
 
		// Put the RF transceiver back to sleep
		msprf24_powerdown();

 

After that LPM4, when the chip wakes back up, you really want to be sure to check the nRF24's IRQ and clear (acknowledge) it... something like-

        msprf24_irq_clear( msprf24_get_irq_reason() );

 

Otherwise the nRF24 module may remain with its IRQ pin active perpetually so the next time you transmit, the MSP430 won't detect the IRQ since it's watching for a transition (that might not occur).  I haven't tried this particular case so I'm not 100% sure that's true, but it follows what I understand about the nRF24L01+'s general flow.

 

Furthermore, with Enhanced ShockBurst (autoack) enabled, if the transmission does fail after the 15 retries, it will not let you send any new packets at all until the IRQ has been acknowledged.

 

Lastly, for nrf_userconfig.h, comment out the "Settings for 16MHz MCLK" section and uncomment the "Settings for 1MHz MCLK" part since you're using 1MHz DCO... It's not strictly necessary (at 1MHz MCLK it'll just pause for 16 times as long as it should, if you're using the Settings for 16MHz MCLK defines) but can help button up the power consumption a tad :smile:

Link to post
Share on other sites

Also for another project of mine where I am building nRF24L01+ based "temperature bugs", here's the code I used to get degrees:

int adc_temp_read()
{
        int adcval;
        long tempC, tempval;

        // Select temp sensor with ADC10CLK/4
        ADC10CTL1 = INCH_10 | ADC10DIV_3;
        ADC10CTL0 = SREF_1 | ADC10SHT_3 | REFON | ADC10ON | ADC10IE;  // 1.5V Vref

        sleep_counter = 1;
        WDTCTL = WDT_ADLY_16;  // Wait 46ms for REF voltage to settle
        while (sleep_counter)
                LPM3;
        WDTCTL = WDT_ADLY_250; // Resume original setting

        adc_done = 0;
        ADC10CTL0 |= ENC | ADC10SC;  // Start conversion
        while (!adc_done)
                LPM0;
        ADC10CTL0 &= ~ADC10IFG;

        adcval = ADC10MEM + ADC_CALIBRATION_OFFSET;  // Calibration offset defined in "typebug.h"
        ADC10CTL0 &= ~ADC10ON;
        tempval = (long) adcval + ADCVAL_STATIC_OFFSET;
        tempC = (tempval * 27069 - 18169625) >> 16;  // oPossum's formula:
                                                   // http://forum.43oh.com/topic/1954-using-the-internal-temperature-sensor/

        return (int)tempC;
}

 

The ADCVAL_STATIC_OFFSET is a #define at the top of the file I intend to tweak to dial out some of the error (this was showing 20C aka 68F on the basement floor when my infrared thermometer was showing ~60F, and I think the IR thermometer was more correct based on how my feet felt on that floor... lol)

But just to keep things simple I declare a long integer to temporarily hold the ADC value and then work with that

Link to post
Share on other sites

I personally try to avoid embedded floating point calculations, as you're doing in the soil_temp() function. I see why you're doing it, but still...

Also, I don't know for sure, but you're doing a calculation in Kelvin like:

T = 1.0f / ((9.63666e-8 * R * R + 2.32134e-4) * R + 1.14061e-3);

In which you multiply 9.63666*10-8 with R3, shouldn't you multiply by R2? (i.e: replace * R * R by * R)

Link to post
Share on other sites

Nice project & code!  One word of caution with the nRF24 handler code (your main while(1) loop)--

 

		w_tx_payload(32, buf);
		msprf24_activate_tx();
		LPM4;
 
		// Put the RF transceiver back to sleep
		msprf24_powerdown();

 

After that LPM4, when the chip wakes back up, you really want to be sure to check the nRF24's IRQ and clear (acknowledge) it... something like-

        msprf24_irq_clear( msprf24_get_irq_reason() );

 

Otherwise the nRF24 module may remain with its IRQ pin active perpetually so the next time you transmit, the MSP430 won't detect the IRQ since it's watching for a transition (that might not occur).  I haven't tried this particular case so I'm not 100% sure that's true, but it follows what I understand about the nRF24L01+'s general flow.

 

Furthermore, with Enhanced ShockBurst (autoack) enabled, if the transmission does fail after the 15 retries, it will not let you send any new packets at all until the IRQ has been acknowledged.

 

Lastly, for nrf_userconfig.h, comment out the "Settings for 16MHz MCLK" section and uncomment the "Settings for 1MHz MCLK" part since you're using 1MHz DCO... It's not strictly necessary (at 1MHz MCLK it'll just pause for 16 times as long as it should, if you're using the Settings for 16MHz MCLK defines) but can help button up the power consumption a tad :smile:

Thanks @@spirilis!  These code adjustments did make the the code better.  I was having issues with the data being loaded into the middle of the char buf array.  For example, the first int in the char array would populate buf[6] on the rx side instead of buf[0]. I assume changing the clock setting resolved this issue.  I didn't read your config file completely and totally missed that part of the configuration!  :?       

Link to post
Share on other sites

I personally try to avoid embedded floating point calculations, as you're doing in the soil_temp() function. I see why you're doing it, but still...

Also, I don't know for sure, but you're doing a calculation in Kelvin like:

T = 1.0f / ((9.63666e-8 * R * R + 2.32134e-4) * R + 1.14061e-3);

In which you multiply 9.63666*10-8 with R3, shouldn't you multiply by R2? (i.e: replace * R * R by * R)

I still haven't figured out what is wrong but I do think it has something to do with the floating point math. I do believe the transmitter is sending a packet.  Perhaps the floating point path calculation is causing a timing issue with the wireless transceiver.  Anyone else got any ideas on that?  

 

I know the kelvin equation is correct because I used it in another project on the MSP430.  

 

The good news is that I have a basic version of my receiver code working.  I am able to print my sensor data (the working sensors) in delimited format and chart if using the python script, Apache server, Flot JavaScript charting library on the Raspberry Pi.  I had the transmitter about 80ft from the receiver though two walls and it worked perfectly. Once I get the temperature sensor stuff working I plan to stick this thing outside and collect data for about 24-hours.  That way I will have a pretty chart to post.  

 

The minimum I still have left to do to get this working:

-Fix the temperature sensor code on the tx side

-Finish the design of the rx PCB which sits on the Raspberry Pi.  This PCB will include a transistor to turn a water solenoid valve on/off and a 12v to 3.3v power supply circuit which will power the MSP430, the Raspberry Pi, and the solenoid valve.

-Add code that determines when to turn water off/on based on current soil moisture.   

Link to post
Share on other sites

@@spirilis maybe you can help me sort this out.

 

I am still having issues with my thermister code.  The math is correct and does show the current temp in the outgoing char buffer.   I do believe it is transmitting because I am using USCI_B on the launchpad and I can see the 1.6 led flicker when the packet is sent.  However, my receiver code isn't picking it up.  When I comment out the offending math and just pass the raw adc the receiver picks it up 100%.  I am using Opossum's printf library on the receiver side to print to UART. I have also made some changes so the packet size is dynamic. Here is my current code:

 

TX:

#include "msp430g2553.h"
#include "msprf24.h"
#include "nrf_userconfig.h"
#include "stdio.h" //for sprintf
#include "math.h"

const char txaddr[] = {0xDE, 0xAD, 0xBE, 0xEF, 0x00};

void main(void)
{
	//Setup Clocks
  DCOCTL = CALDCO_1MHZ; //Internal oscillators frequency
  BCSCTL1 |= DIVA_1;                        // ACLK/8 - wake up about every 26 seconds (WHEN DIVA_3 - about 6 seconds for DIV 1)
  BCSCTL2 = DIVS_0;  // SMCLK = DCOCLK/0 - SPI (USCI) uses SMCLK, prefer SMCLK < 10MHz (SPI speed limit for nRF24 = 10MHz)
  BCSCTL3 |= LFXT1S_2;                      // ACLK = VLO

  //Initiate Watchdog Timer
  WDTCTL = WDT_ADLY_1000;                   // Interval timer - 1000ms
  IE1 |= WDTIE;                             // Enable WDT interrupt

  //Set inputs/outputs
  P2DIR = BIT0 + BIT1;  //2.0 and 2.1 Output

  //Initiate Wireless Module - Initial values for nRF24L01+ library config variables
  rf_crc = RF24_EN_CRC | RF24_CRCO; // CRC enabled, 16-bit
  rf_addr_width      = 5;
  rf_speed_power     = RF24_SPEED_1MBPS | RF24_POWER_0DBM;
  rf_channel         = 120;

  msprf24_init();  // All RX pipes closed by default
  msprf24_set_pipe_packetsize(0, 0);
  msprf24_open_pipe(0, 1);  // Open pipe#0 with Enhanced ShockBurst enabled for receiving Auto-ACKs

  //Main Loop
  while(1)
  {
    //Delay sensor read and transmission
    static int delay = 0;
	delay++;
	if (delay == 1){   // 26 seconds for each 1 delay - when BCSCTL1 |= DIVA_3
		char buf[32];

		// Online the nRF24L01+ transceiver
		msprf24_standby();
		flush_tx();

		//Compose RF Message
		int MCU = chip_temp();
		int temp = soil_temp_adc();

		/*  START OFFENDING CODE */
		double R, T;

                //Calculate resistance
		R = log((1 / ((1024 / (double) temp) - 1)) * (double) 10000);

		// Compute degrees K
		T = 1.0f / ((9.63666e-8 * R * R + 2.32134e-4) * R + 1.14061e-3);  //stenihart coefficients for Vishay 10k thermister

	        // return degrees F
		temp = ((T - 273.15f) * (9.0f / 5.0f)) + 32.0f;
		/* END OFFENDING CODE */

		int Soil = soil_moist();
		int Sun = light_sensor();
		int size = snprintf(NULL, 0, "%d;%d;%d;%d", Sun, Soil, temp, MCU);
		sprintf(buf, "%d;%d;%d;%d", Sun, Soil, temp, MCU);

		//Setup radio and transmit message
		w_tx_addr( (char*)txaddr );
		w_rx_addr(0, (char*)txaddr );  // Pipe 0 receives auto-ack's, autoacks are sent back to the TX addr so the PTX node // needs to listen to the TX addr on pipe#0 to receive them.
		w_tx_payload(size, buf);
		msprf24_activate_tx();
		LPM4;
		msprf24_irq_clear( msprf24_get_irq_reason() );

		// Put the RF transceiver back to sleep
		msprf24_powerdown();
		delay = 0;
	}

    _BIS_SR(LPM3_bits + GIE);               // Enter LPM3
  }
}

#pragma vector=WDT_VECTOR
__interrupt void watchdog_timer (void)
{
  _BIC_SR_IRQ(LPM3_bits);                   // Clear LPM3 bits from 0(SR)
}

 

RX:

 

#include  "msp430g2553.h"
#include "stdarg.h"
#include "msprf24.h"
#include "nrf_userconfig.h"

const char rxaddr[] = {0xDE, 0xAD, 0xBE, 0xEF, 0x00};

void sendByte(unsigned char);
void printf(char *, ...);

/**
 * puts() is used by printf() to display or send a string.. This function
 *     determines where printf prints to. For this case it sends a string
 *     out over UART, another option could be to display the string on an
 *     LCD display.
 **/
void puts(char *s) {
	char c;

	// Loops through each character in string 's'
	while (c = *s++) {
		sendByte(c);
	}
}
/**
 * puts() is used by printf() to display or send a character. This function
 *     determines where printf prints to. For this case it sends a character
 *     out over UART.
 **/
void putc(unsigned  {
	sendByte(;
}

/**
 * Sends a single byte out through UART
 **/
void sendByte(unsigned char byte )
{
	while (!(IFG2&UCA0TXIFG));			// USCI_A0 TX buffer ready?
	UCA0TXBUF = byte;					// TX -> RXed character
}


//Main Loop//
void main(void)
{
	char buf[32];
	int i;
	char s = 32;

	WDTCTL = WDTPW + WDTHOLD;			// Stop WDT

	//Set UART pins
	P1SEL = BIT1 + BIT2 ;				// P1.1 = RXD, P1.2=TXD
	P1SEL2 = BIT1 + BIT2 ;				// P1.1 = RXD, P1.2=TXD

        // Red LED output
	P1DIR |= BIT0;
	P1OUT &= ~(BIT0);

	//Set MCU clocks
	UCA0CTL1 |= UCSSEL_2; // SMCLK
	BCSCTL1 = CALBC1_1MHZ; // Load calibrated constants for 1Mhz operation.
	DCOCTL = CALDCO_1MHZ; // ...

	//Initiate UART
	UCA0BR0 = 104; // 9600@1MHz
	UCA0BR1 = 0; // 9600@1MHz
	UCA0MCTL = UCBRS0; // Modulation UCBRSx = 1
	UCA0CTL1 &= ~UCSWRST;// **Initialize USCI state machine**

	/* Initial values for nRF24L01+ library config variables */
	rf_crc = RF24_EN_CRC | RF24_CRCO; // CRC enabled, 16-bit
	rf_addr_width      = 5;
	rf_speed_power     = RF24_SPEED_1MBPS | RF24_POWER_0DBM;
	rf_channel         = 120;

	msprf24_init();
	msprf24_set_pipe_packetsize(0, 0);
	msprf24_open_pipe(0, 1);  // Open pipe#0 with Enhanced ShockBurst

	// Initialize RF receiver
	w_rx_addr(0, (char*) rxaddr);

	// Receive mode
	if (!(RF24_QUEUE_RXEMPTY & msprf24_queue_state())) {
		flush_rx();
	}
	msprf24_activate_rx();
	LPM4;
	msprf24_irq_clear( msprf24_get_irq_reason() );

	while (1) {
		if (rf_irq & RF24_IRQ_FLAGGED) {
			rf_irq &= ~RF24_IRQ_FLAGGED;
			msprf24_get_irq_reason();
		}
		if (rf_irq & RF24_IRQ_RX) {
			s = r_rx_peek_payload_size();
			r_rx_payload(s, buf);
			msprf24_irq_clear(RF24_IRQ_RX);

			// Compose UART message
			for ( i = 0; i < s; ++i )
			{
			printf("%c", buf[i]);
			}

			P1OUT |= BIT0;  // Red LED on
			__delay_cycles(1000000);
			P1OUT &= ~BIT0;
			__delay_cycles(1000000);
			P1OUT |= BIT0;  // Red LED on

			} else {

			}
		LPM4;
		msprf24_irq_clear( msprf24_get_irq_reason() );
	}
}


/* nrf_userconfig.h
 * User configuration of nRF24L01+ connectivity parameters, e.g.
 * IRQ, CSN, CE pin assignments, Serial SPI driver type
 *
 *
 * Copyright (c) 2012, Eric Brundick <spirilis@linux.com>
 *
 * Permission to use, copy, modify, and/or distribute this software for any purpose
 * with or without fee is hereby granted, provided that the above copyright notice
 * and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
 * OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#ifndef _NRF_USERCONFIG_H
#define _NRF_USERCONFIG_H

/* CPU clock cycles for the specified amounts of time--accurate minimum delays
 * required for reliable operation of the nRF24L01+'s state machine.
 */
// Settings for 1MHz MCLK.
#define DELAY_CYCLES_5MS       5000
#define DELAY_CYCLES_130US     130
#define DELAY_CYCLES_15US      15

/* Settings for 8MHz MCLK.
#define DELAY_CYCLES_5MS       40000
#define DELAY_CYCLES_130US     1040
#define DELAY_CYCLES_15US      120
 */

 /*/Settings for 16MHz MCLK
#define DELAY_CYCLES_5MS       80000
#define DELAY_CYCLES_130US     2080
#define DELAY_CYCLES_15US      240
/*

/* Settings for 24MHz MCLK.
#define DELAY_CYCLES_5MS       120000
#define DELAY_CYCLES_130US     3120
#define DELAY_CYCLES_15US      360
 */

/* SPI port--Select which USCI port we're using.
 * Applies only to USCI devices.  USI users can keep these
 * commented out.
 */
//#define RF24_SPI_DRIVER_USCI_A 1
#define RF24_SPI_DRIVER_USCI_B 1

/* Define whether this library should use LPM0+IRQs during SPI I/O and whether this library should provide the ISR. */
#define RF24_SPI_DRIVER_USCI_USE_IRQ 1
#define RF24_SPI_DRIVER_USCI_PROVIDE_ISR 1


/* Operational pins -- IRQ, CE, CSN (SPI chip-select)
 */

/* IRQ */
#define nrfIRQport 2
#define nrfIRQpin BIT4

/* CSN SPI chip-select */
#define nrfCSNport 2
#define nrfCSNportout P2OUT
#define nrfCSNpin BIT3

/* CE Chip-Enable (used to put RF transceiver on-air for RX or TX) */
#define nrfCEport 2
#define nrfCEportout P2OUT
#define nrfCEpin BIT5

#endif

 

ADC10.c

#include  "msp430g2553.h"

void disable_adc(void)
{
	ADC10CTL0 &= ~ENC;
	ADC10CTL0 &= ~ADC10IFG;
	ADC10CTL0 &= ~REFON + ADC10ON;
}

void config_adc(void)
{
  // Use Vcc/Vss for Up/Low Refs, 16 x ADC10CLKs, turn on ADC
    ADC10CTL0 = SREF_0 + ADC10SHT_2 + ADC10ON;
}

int light_sensor() {
	unsigned adc;

	disable_adc();
	config_adc();
	// A1 input, use ADC10CLK div 1, single channel mode
	ADC10CTL1 =  INCH_0 + ADC10DIV_3;
	ADC10AE0 = BIT0;      // Enable ADC input on P1.0
	ADC10CTL0 |= ENC + ADC10SC;     // Enable conversions.start a new conversion

	while (ADC10CTL1 & ADC10BUSY);   // wait for conversion to end

	adc = ADC10MEM;
	disable_adc();

	return adc;
}

int soil_temp_adc() {
	unsigned adc;

	disable_adc();
	config_adc();
	// A1 input, use ADC10CLK div 1, single channel mode
	ADC10CTL1 =  INCH_4 + ADC10DIV_3;
	ADC10AE0 = BIT4;      // Enable ADC input on P1.4
	ADC10CTL0 |= ENC + ADC10SC;     // Enable conversions.start a new conversion

	while (ADC10CTL1 & ADC10BUSY);   // wait for conversion to end

	adc = ADC10MEM;
	disable_adc();

	return adc;
}

int chip_temp() {
	unsigned adc;

	disable_adc();
	config_adc();
	// A1 input, use ADC10CLK div 1, single channel mode
	ADC10CTL0 = SREF_1 + ADC10SHT_3 + REFON + ADC10ON;
	ADC10CTL1 = INCH_10 + ADC10DIV_3;
	ADC10CTL0 |= ENC + ADC10SC;

	while (ADC10CTL1 & ADC10BUSY);   // wait for conversion to end

	adc = ADC10MEM;
	disable_adc();

	// return degrees F
	return (int)((adc * 48724L - 30634388L) >> 16);
}

void setSensorPolarity(int flip){
  if(flip == 0){
    P2OUT |= BIT0;
    P2OUT &= ~BIT1;
  }else{
	P2OUT |= BIT1;
	P2OUT &= ~BIT0;
  }
}

int soil_moist(){

		unsigned adc;

		disable_adc();
		config_adc();
		// A1 input, use ADC10CLK div 3
		ADC10CTL1 =  INCH_3 + ADC10DIV_3;
		ADC10AE0 = BIT3;      // Enable ADC input on P1.3
		ADC10CTL0 |= ENC + ADC10SC;     // Enable conversions.start a new conversion
		while (ADC10CTL1 & ADC10BUSY);   // wait for conversion to end

		adc = ADC10MEM;
		disable_adc();

		setSensorPolarity(0);
		__delay_cycles(2500);
		setSensorPolarity(1);
		__delay_cycles(2500);

		return adc;
}
Link to post
Share on other sites

That is strange.  Only thing that jumps out at me is that on the RX side, when you read a new packet and get the size (s = r_rx_peek_payload_size();) ... Check first to make sure 's' isn't 0 or >32, if it is, issue flush_rx() and continue without reading the payload or acting on it. I don't think this happens with AutoACK at 1Mbps and 2Mbps but it happens frequently at 250Kbps. Might not be your issue. But do check for this and set some flag--maybe an LED or an unused I/O pin you can probe with your multimeter--to experiment and see if one of those is happening.

 

I take it that when you put a big comment block (e.g. /* ... */) around the START OFFENDING CODE ... END OFFENDING CODE block the problem goes away?

 

Lastly, for the sake of being pedantic or whatever, the following is no longer necessary:

 

  1. if (rf_irq & RF24_IRQ_FLAGGED) {
  2. rf_irq &= ~RF24_IRQ_FLAGGED;
  3. msprf24_get_irq_reason();
  4. }

 

Because msprf24_get_irq_reason() now clears the RF24_IRQ_FLAGGED bit in rf_irq.

Link to post
Share on other sites

That is strange.  Only thing that jumps out at me is that on the RX side, when you read a new packet and get the size (s = r_rx_peek_payload_size() ;-) ... Check first to make sure 's' isn't 0 or >32, if it is, issue flush_rx() and continue without reading the payload or acting on it. I don't think this happens with AutoACK at 1Mbps and 2Mbps but it happens frequently at 250Kbps. Might not be your issue. But do check for this and set some flag--maybe an LED or an unused I/O pin you can probe with your multimeter--to experiment and see if one of those is happening.

 

I take it that when you put a big comment block (e.g. /* ... */) around the START OFFENDING CODE ... END OFFENDING CODE block the problem goes away?

 

Lastly, for the sake of being pedantic or whatever, the following is no longer necessary:

 

  1. if (rf_irq & RF24_IRQ_FLAGGED) {
  2. rf_irq &= ~RF24_IRQ_FLAGGED;
  3. msprf24_get_irq_reason();
  4. }

 

Because msprf24_get_irq_reason() now clears the RF24_IRQ_FLAGGED bit in rf_irq.

Thanks for the reply!  Correct, the code works beautifully when you comment out the start/end offending code block.  I can view the outgoing char buf through CCS and it looks normal.  That is why this is so frustrating.     

 

It makes me sad you also think it is strange.  I was hoping for an obvious mistake.  

 

I don't believe s = r_rx_peek_payload_size is the issue. Before I wrote the current rx code I was using Ike's example receiver code and I had the same issue with the thermister code block.  Ike's code doesn't use  r_rx_peek_payload_size to determine the size of the message payload.  

 

Please continue to be pedantic or whatever.  

Link to post
Share on other sites

I did populate the entire PCB tonight so I could stick it outside and test it with the Raspberry Pi.  Only one problem...it doesn't work.  Everything on the PCB is wired correctly because it works when I apply 3.3v directly to the MSP430G2553 DVCC and DVSS pins.  I know I am getting 3.3v to the chip from the DC-DC boost converter because I can read it on my multimeter. I think this leaves me with a current issue. The TPS61097-33 DC-DC booster can source up to 100mA depending on the voltage.  Apparently that is not enough to supply the circuit and/or code. http://www.ti.com/product/tps61097-33

 

I am going to reduce the wireless transmission speed to see if that will help with the issues. Anyone have any other ideas?  Schematic is in the first post.     

Link to post
Share on other sites

What kind of capacitance do you have on the Vcc line for the MCU and nRF24 module? I have found the nRF usually needs at least 10uF to get its oscillator started (without it, you'll see the module mysteriously drop back to POWERDOWN mode within 200uS of starting). 22uF is even nicer.

 

Sent from my C3PO via Tapatalk

Link to post
Share on other sites

What kind of capacitance do you have on the Vcc line for the MCU and nRF24 module? I have found the nRF usually needs at least 10uF to get its oscillator started (without it, you'll see the module mysteriously drop back to POWERDOWN mode within 200uS of starting). 22uF is even nicer.

 

Sent from my C3PO via Tapatalk

 

I have a 10uf 16v ceramic capacitor on the DC-DC boosters VOUT.  I also have a 0.1uf capcitor tied to the 3.3v line for the photoresistor circuit.  I don't have anything for the nRF24 module but I will add one tonight and see if that helps.  You can view the schematic on the first post. Thanks for the tip!

Link to post
Share on other sites

I have a 10uf 16v ceramic capacitor on the DC-DC boosters VOUT.  I also have a 0.1uf capcitor tied to the 3.3v line for the photoresistor circuit.  I don't have anything for the nRF24 module but I will add one tonight and see if that helps.  You can view the schematic on the first post. Thanks for the tip!

 

Gotcha.  I seem to recall 10uF was the minimum I needed for the nRF24 to behave, but more should hopefully be better.  It would only need to be on the DC-DC converter's VOUT or somewhere else on the Vcc net, doesn't really matter where.

Link to post
Share on other sites

Just remembered something else--what part did you use for the Inductor?  Rereading your first post I think you used the one that came with the lamp.  The schematic states that it's 10uH, but can it handle the peak current required by the boost regulator (~200mA per the TPS61097-33 datasheet, page 14)?

 

FWIW, if you need to try something different I could mail you a couple 4.7uH's that's rated 650mA I think.  I've used it in my boost regulator projects (TPS61221 ~150mA output, needs up to 400mA switching current at the outlying max).  They are surface-mount (I think 1210-size).

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...