Tuesday, March 14, 2023

Light Buddy 2 Functionality

Light Buddy 2


When I built LB2, I developed some unique LED features as explained in an earlier post.  This image shows the current setup of the Windows APP.

 LB2 was originally setup as four pulsing LEDs and two "conventional" LEDs.  LED_A thru LED_D would have one of the following LED Styles

  • OFF
  • STEADY
  • PWM1
  • PWM2

Not sure if the difference between PWM1 and PWM2 will be more than different timing.

LEDs LED_1 and LED_2 being "conventional" would have the following LED Styles

  • OFF
  • STEADY
  • BURST
  • CYCLE

What you can do is add features to these LED Styles.  

STEADY - allows you to add the features SAWTOOTH and TRIANGLE.  The other two do not make much sense, the LED is always on.

BURST - allows you to add the ALWAYS ON and REPEAT ON.  In the future TRIANGLE might be added.

CYCLE - allows for all four.  The red LED on the top of dome in this video, is CYCLE STYLE with a TRIANGLE/ALWAYS ON as the selected FEATURES.  One use for this a heartbeat type effect.  A definition of the different STYLES and FEATURES can be found in this post.

I have other ideas for LED Lighting effects, just need the time to work them out.





 

 

Monday, March 13, 2023

LED Styles and Features

 This is a video I posted earlier about the functionality of Light Buddy 2 in this compact generator detail.

 

In the process of building and programming LB2, I further developed the concept of different LED styles.  In the end, it is all about turning the LED on/off and how long it is on and how long it is off.  In this process I have come up with attributes that I call LED Styles and LED Features, for lack of any better words.  Along with these Styles and Features, there is a PWM parameter that effects the brightness of the LED.  When the PWM parameter can be applied is a function of the particular controller.

LED Styles

There are ten LED Styles as described here.

  • OFF - the LED is off.
  • STEADY - the LED is on. Brightness may vary by using the PWM parameter.
  • BURST1 - the LED does a quick burst of LED on/off.  The intensity can vary with the PWM parameter.  This simulates a Laser weapon.
  • CYCLE1 - the LED cycles on and off in equal on and off periods.  Brightness may vary by using the PWM parameter.
  • PWM1 - the LED is varies in intensity as does the on and off period.  All three LED attributes are randomly varied, intensity, on time and off time.  The PWM parameter has no effect.  This simulates an arc generator or Tesla effect.
  • BURST2 - same as BURST1, just different timing.
  • CYCLE2 - same as CYCLE1, just different timing.
  • PWM2 - same as PWM1, just different timing.
  • Program - future style.  Some type of user programmability.
  • ON/OFF -  future style.

LED Features

There are four LED Features as described here.

  • Sawtooth - the LED will increase (slowly, though this is a relative term) in intensity.  When it reaches maximum intensity, it goes back to OFF immediately.  The PWM parameter has no effect.
  • Triangle - the LED will increase (slowly, though this is a relative term) in intensity.  When it reaches maximum intensity, it then will decrease in intensity until it reaches the minimum intensity.  The PWM parameter has no effect.
  • Repeat - when applied to a feature, the feature will repeat at some interval, with an off gap in between.
  • Always ON - when applied to a feature, the feature will repeat at the minimum interval.  For Sawtooth and Triangle the next cycle will start immediately.

 The features were all possible in the script language.  Though they would be cumbersome to implement especially at the fine detail the direct implementation is done at.




 

Friday, March 10, 2023

Solar Shed - Assembled

It is mostly assembled now.  First step is test the ADC inputs and make sure they are working correctly.  I built this spreadsheet.  

  • Column A is Vcc=3.29VDC and ADC size is 1024 counts
  • Column B is Battery input voltage
  • Column C is Battery voltage at the ADC input
  • Column D is the ADC counts for that voltage
  • Column E is LT1085 voltage at the ADC input (input voltage is from column B)
  • Column F is the ADC counts for that voltage
  • Column H is Solar Panel input voltage
  • Column I is Solar Panel voltage at the ADC input
  • Column J is the ADC counts for that voltage

Finally the three numbers in row 2 (0.2015, 0.2035 and 0.1286) are actual measured voltage ratios of the voltage input and what is present at the ADC input for each input. Even though I used 1% resistors, there is still +/-1% over the marked resistor values.  And to be fully transparent, even though there are unity gain low bandwidth (10KHz) OP-AMPs driving the PIC ADC, the layout probably could have been better.  It is as tight as SMT0805 resistors/capacitors would allow and is surrounded by ground plane.  But not being an Analog Guru, it is probably just OK.  Below the table You can see the layout for the three ADC inputs. (It;s late and my hand is not quite steady, s the picture is a little fuzzy)

 

Then I compared these numbers against what the ADC was reading.  Finally I tweaked the Vcc number a few millivolts to get  a more consistent match of the table values to the actual ADC readings.  During this process I noticed that I had left the weak pullups on the three ADC input pins on.  After turning them off, the readings were much more consistent.

The next issue was going in and out of sleep.  Just needed to make sure that everything I turned on/off before sleep, was turned off/on after coming out of sleep.  So at least on the desk it seems to work as before.  There are a few enhancements and more testing that are needed

  • When the solar voltage is high enough, run the PIC from the solar panel.
  • Install the super cap and test it.
  • Maybe the PIC runs from the solar panel all the time and the battery only powers the LED lighting in the shed.

Ran the system in sleep all night.  Starting battery voltage at 10PM was 13.68VDC.  At 8AM the next morning the voltage was 13.51VDC.  Now in LiFePO battery system this doesnt mean much.  Unless you have a calibrated battery gas gauge IC connected, there is no way to know how much battery life was consumed.   We must remember that a LiFePO battery discharge curve is quite flat until the inflection point.  What is important is the current numbers from the previous post, the system with OLED and in SLEEP, consumed 2.25mA from the battery.  That should be equivalent to 18mA-Hr.  Fully charged (and new) the battery is rated at 9.6A-Hr.  So over night we used about 0.2% of the battery.  

I will be interested to see what the super cap does.  That will be the next test.  Still waiting for the sun to appear and the snow to melt.


 


Thursday, March 9, 2023

Cliff Wall Interior Update 1

 

Here is a rendering of the interior of the Cliff Wall for the first floor.  There is still a smaller section above that is located on the same level as the gantry on the hangers.  Here is a closeup of the area around the minifigs.

What do you do with the smooth wall behind the Minifigs and along the sides.  Across the center I placed some brackets.  To those brackets I attached a 6x12 plate.  The upper four rows are covered in black tile.  On the black tile will be a sticker of a radar/computer screen.  The bottom two rows have a 1x6 tile of BLUE and LIME to match this color accent scheme of the entire MOC. That still leaves two 6 x 5 blank panels of wall space on each end.  More brackets with clips and hooks for tools is probably the answer.

One thing that is of concern, is that the Transparent Light Blue windows are locked in place.  There is no way to get behind them and reposition minifigs or other items that might fail.  This wall of glass has to be movable without taking the entire module apart.  Especially these with cliff wall structures on the other side.

I worked on this and here is what I hope is the solution.


 

The first two pictures show the concept from a long view.  Disregard the Brick pile surrounding the MOC, just some excess Bricks from building, tear down, building, tear down, etc. etc etc. The left side uses a 1x4 hinge plate at the top and the bottom.  I then built a pillar that secured the hinge plate in place.


 

This picture shows the large screen area in the back.  The pillar on the right is the latching mechanism.  




These two pictures show a closeup of the latching mechanism.  Positioning the clips was time consuming.  Plus I have never liked stacking 1x1 plates or bricks.  Keeping them straight is difficult.  The pillar required some work to get it stable.   

Using this as a base, I went back into Studio and updated the design without part restrictions.

This shows the two pillars for the moving window.

This shows the latching mechanism.  By using part 30241b

instead of 

we get a less of the 1x1 plate issue not lining up correctly.

Is this final?  Cannot answer that question right now.  What I do like is that this arrangement gives depth to the front of the model, which is always good. But at some point I need to start building out, the end of April if fast approaching.







Wednesday, March 8, 2023

Crazy Idea or Something Cool

 

Somehow I either bought or acquired these LEDs from somewhere.  They are RGB plus white.  Regardless of how I acquired them, they very similar in package to these.

I designed a similar PCB, 8mm x 16mm or equivalent to a 1 x2 plate/tile, which is what the picture at the top of this blog post is.

This LED can do RED, GREEN, BLUE, or WHITE or any combination thereof.  Now the downside to this is it will take up to four LED control lines to do this.  What I don't know yet is how bright these are.  Some of that can be compensated for with the individual resistors.  I suspect some experimentation will be needed to balance out the color intensity.

Here are three ideas so far.

  1. In the Space Base that ability to switch between RED and WHITE (or WHITE and any RGB LED).  So a working space can be in WHITE light and then when activity is about to change, the LED will switch from WHITE to RED.  Now this can be done with two LEDs, but there is some convenience of having just one device installed.
  2. Using random PWM signals to the RGB LEDs.  This might produce a much better Tesla Effect than just using a single white LED.  
  3. Using RED and GREEN is some kind of stop and go scenario. 

As time goes by, I am sure I will think of other ideas.  While most scenarios can be done with multiple LEDs, the convenience of a single device is very strong. Also if all the LEDs are wired, then the designer will have ultimate flexibility.

 We will see what they can do a week or so.

 

Tuesday, March 7, 2023

Testing LED Functions


This shows a small test jig, I put together to test the Light Buddy 2.  It was quick, but it kept moving, hence the tape.  Even with the tape, it would sometimes be hard to see the LED.  I use this mostly for developing the firmware that produces the different lighting features.  But I can see how this would be useful for someone who is working on the lighting effects before putting it in a MOC.

So I did this.


This is a small PCB with five LEDs and a 2mm connector on the backside.  I have decided going forward, all LED connections will use a 2mm spacing connector that is 2x5.  Thus I will break up the LED connections into groups of five.  The only place so far that is not true is on the Light Buddy 2, which has six LED connections and thus a 2mm connector that is 2x6.  This can still be used, it is just that one LED will not be connected.  

The reasoning was strictly financial.  The PCB fabricator is still having a $5 special on 2 layer boards.  So I can get 30 boards for that price.  The connector is about $1.  The LEDs and resistors I have.  I am in the process of ordering other PCBs again, so the shipping cost will be shared.  Mostly it is my time to build these.  

Are they useful enough for a $4 to $5 retail price.  I don't know, but I guess we will find out.  As a side note for me, these will also make great demos at shows.

 


 

Monday, March 6, 2023

Solar Shed-Close

 

I am closer to having a working system, but some further "compromises" may still be in order. 😕

The new PIC processor came in.  It did not take long to swap out the PIC18F4525 for the PIC18F46K40.  Went through some configuration issues, but finally got it working.  Since this was a minimal part design, there is no oscillator.  The PIC18F46K40 has an internal Oscillator that runs up to 64MHz.  Nothing I am doing needs that kind of speed.  Thus 8MHz was the compromise speed.  What I did do was up the SPI clock rate to 2MHz.  The MIKROE OLED C will run much faster, but that is good enough.  

Then I started working on the SLEEP routine.  I have not done any very low power work since working on the T-DUST module.  Spent a few minutes reading the data sheet on SLEEP and Watchdog Timers, as well as reviewing what I did in T-DUST.  

On the PIC18F46K40 the way it is implemented on the Solar Shed PCB, nothing runs when it goes to sleep, except the Watchdog Timer (WDT).  And in this configuration, it can only run from one of the low frequency oscillators, whose frequency is about 31KHz.  The WDT has pre-scaler that will give a maximum time of about 256 seconds or a signal about every 4 minutes.

In the main loop, the code will look at the Solar Panel voltage each time through the main loop.  If the voltage is above about 8VDC (subject to change when the system is tested), the code will continue in the main loop.  If it is below this threshold, the PIC will go start the WDT and then go to SLEEP.  When the WDT expires (about 256 seconds), the PIC will wake up.  At this point it will look at the Solar Panel voltage, and if it is above 8VDC, the code will wake up and continue with the main loop, until which time the solar panel voltage falls below 8VDC.  If the solar panel voltage is below 8VDC, the PIC will restart the WDT and go back to sleep.  At this point the SLEEP process starts all over.

I do check to make sure the WDT is the wake up source, if not, then a reset of the entire system is executed.

This led to taking current measurements.  Without making some changes, I can only measure the input to the DC-DC converter that makes the 5VDC, that then is transformed to 3.3VDC by an LDO.  So assuming 100% efficiency in the DC-DC converter, these numbers are the best one would expect.  Reality is they are somewhat worse at 5VDC.

  • Run w/o OLED on  4.5mA @12VDC = 10.8mA @5VDC
  • Run w/ OLED on 12.0mA @12VDC = 28.8mA @5VDC
  • Sleep (OLED is powered but display not on) 2.25mA @12VDC = 5.4mA @5VDC
  • Sleep (OLED module removed) 275uA @5VDC = 600uA @5VDC

There is a 7.5F super cap that is suppose to power the system through the night if the battery is too low.  At 600uA this might happen, but a 5.4mA I have my doubts.  This leaves me with three choices:

  1. Remove the OLED.  It is nice to have to see voltages, but for the 80%+ of the time no one is inside the shed, it serves no purpose.
  2. Do some cutting of traces and install a high side switch on the OLED.  Thus it is only on when voltage display is requested.  Cutting the ground traces will problematic since there is ground plane on both sides of the PCB.  Also not sure there won't be leakage through the SPI and other control pins.  This option is not appealing.😞
  3. Do nothing.  Maybe at 10.8mA, the battery will last long enough to get to the charging opportunity.

So this is a testing processing to see what happens.  Right now it is snowing, so nothing will happen until the sun comes out again.

An interesting note is what happened to the PCB when I removed the PIC18F4525 with the hot air gun and then cleaned the pads with solder wick.  The combination of the two seems to have rubbed off some of the solder mask.  Nothing is critical, but these pictures show the issue.  Not going to complain, paid $5 for five PCBs.  It is a one off.