Monday, January 30, 2023

Light Buddy 2 - The Design

 


Here is what the board looks like.  It is very simple, just a fancy way to control 6 LEDs to produce fixed (kind of) lighting effects.  No remote of any kind.

The voltage regulator, U2, will take up 16VDC and produce either 3.3VDC or 5VDC, haven't decided what voltage to run at.  The intended input is VUSB, so if it is 5VDC, it will just follow the input.  J9 is the power input (GND-VUSB-GND to help prevent incorrect connections).

J8 is a standard TTL/CMOS level RS-232 interface.  My intent is to allow the 6 outputs to be programmed in some fashion, TBD.  The problem is anyone who does this will need a RS232 to USB converter.  For me, this not a big deal, for some LEGO users, this may be a bridge to far.   So when you order it, I would program with the desired effects.  The buyer would pick from a selection of choices.  I have also considered a BT module that plugs onto J8 and J9.  Then you would use the Light Buddy Android App to update it.

The remaining parts are six N-FETs to drive the LEDs and protect the processor outputs from excessive current draw.



On the backside, the two circles is where small 1 x 1 round LEGO plates will attach to the PCB (super glue).  This allows the board to be mounted into the LEGO Model.

The processor is either PIC16F18326, PIC16F18346, PIC18F06Q40 or PIC18F06Q41 families.  They come in different memory sizes, I always start with the largest until I figure out how much I really need.

Finally, the absolute bane of my existence, connectors.  All of these are of the 2mm type.  But as you can see they are large compared to the board.  I have used smaller 1mm 2 pin connectors before, but they are very difficult to un-mate.  Everyone complains about them.  Obviously J8 doesn't need to be populated unless you intend on using the RS232 interface.  J9 could be soldered in.  That just leaves J1 for the LEDs.  They also could be soldered in, but that would make working with the LEGO model more difficult.  You should be able to plug in individual 2 pin 2mm male connectors into J1 for each LED.  I keep looking for a solution to this problem, but have not found anything yet.



Friday, January 27, 2023

Solar Shed - Update

 

We had 12" of snow and this completely covered the solar panel.  This caused the battery to completely drain.  That is the battery voltage was less than 10VDC.  Which leads me to this

  1. Probably need a cutoff relay to disconnect the battery when there is no charging voltage and the battery voltage falls below a certain value.
  2. If the battery is disconnected, then the controller needs power from somewhere else, probably a combination of the solar panel and a very large cap.
  3. Which leads to the Curiosity HPC board is not going to work.  Need a custom board that I can put to sleep to save power.  75-90mA is just too much current.

Oh well more fun designing.

 

Thursday, January 26, 2023

Light Buddy 2 - The Need

 


I have been working on a LEGO generator design for the large LEGO display.  I needed at least 5 LEDs.  4 of them generate a pulsating electric thingee, kind of like a lightning effect or an arc welding effect.  I do this with a PWM generator and then randomly change the times and pulse width.  Not perfect but it does a good job.   I needed this to be small and with some new PICs that have multiple PWMs and independent timers, I think I can get this down to a the size of a 2x4 Lego brick (15.5 x 31.25mm), although it is two sided.  The PIC controllers I am looking at are PIC16F18326, PIC16F18426, PIC18F06Q40 and PIC18F06Q41.  These are the large memory versions.  Once the code size is determined, may be able to move to smaller memory versions.  This will just give more flexibility in ordering, considering the state of IC availability has only marginally improved.

The amazing part was that the PCB vendor I am using for PCBs (PCBWAY) is selling  2 layer, 10 pieces for $5 total, $23 in shipping and 24 hour turn if in green, any other color is 5-6 days.  At those prices it is almost not worth wiring a manual proto anymore.  Could build some generic proto boards to play with.  The max size appears to be 100x100mm or just under 4x4".  And if I were to do multiple designs, the cost would be less since they will all fit in a single package.
 

This may be the next LED controller.


Wednesday, January 25, 2023

Solar Shed - Intstall

 

I kept all of the big currents (charging and SHED LEDs) on the add on PCB.  To make the A/D readings as stable as possible. I added a unity gain OP-AMP on all inputs, a 16 sample rolling average, some thought on the ground connections and ground pour on both sides of the add on PCB.  But the OP-AMPS have to powered by the development board, so minute current is flowing between the Curiosity HPC board and the daughter board.  Also during development the whole system is powered by USB, since the development board has the debugger built into the board (PIC24 16 bit).  When installed in the shed, the battery runs everything with a 5VDC LDO replacing VUSB.  That was enough of a change in the ground currents to cause the A/D readings to move a little.  Fortunately I coded all of the trip point values (Battery over voltage, Solar Input over/under voltage, etc..) as constants derived from a spread sheet.  This program takes almost 64K of FLASH because of the embedded fonts for the OLED.  So adding table look ups for converting A/D readings to voltage did not add much in comparison.

A major concern now is that the whole setup draws about 75mA when just idling.  The OLED only displays when a button is pushed.  And one LED is cycling at 50% to indicate that the main loop is running.  So I am guessing that the PIC24 implementation of the debugger is the main current draw.  I looked at the schematic and there is no clean way to cut the power.  Right now I get about 4-6 hours of some charge.  The sun is too low and the house next door is 5 feet higher and blocks the morning sun and the remainder of the day the angle is very low.  In about 6 weeks, the sun should be high enough to give more charge time and by spring it will be over 10 hours a day and very direct.  For now I will just watch the battery voltage to see what the trend is.

Tuesday, January 24, 2023

Light Buddy 1 - Operation

 

This video was taken with a standard HD Webcam (Logitech C922).  It does not do a very good job at closeups, which is why the device is slightly out of focus.  Additionally the LEDs, when on, tend to overwhelm the auto white balance.  One of these days I will get a better camera for this type of work.

This is a short video the Light Buddy 1 in demo mode.  Attached are the LEDs we sell in 1 x 1 and 1 x 2 plate format.  All of the LEDs have an integrated resistor.  Here is what is happening"

1.  The white LED in the upper left is on STEADY.

2.  The small blue LED left side center is in one of the pulsing modes.

3.  The purple LED in the lower right is in CyCLE mode then pulsing mode.

4.  The small blue LED on the lower left side is in CYCLE mode

5.  The green LED in the upper left is in STEADY then BURST mode.

Sometime later I will put together a series of videos that show the different LED modes that are possible.

 

Monday, January 23, 2023

Solar Shed - Final Testing

The Solar Shed thing is almost done.  Instead of trying to debug the final issues in the shed on the wood pile and me all twisted in a pretzel, I built up  an environment in my office.  Instead of the Solar panel I used a 24VDC power supply I had.  This allowed for testing most of the different voltage points that control the relays  and the battery charging.  Here is a summary of the voltage decision points

  • If the Solar panel voltage falls below 14 VDC, charging is disabled.  No sense in charging at this point, the panel is providing very little current.
  • If the battery voltage rises above 14.6 VDC, charging is disabled.  Don't want to over charge the battery.  Also a five minute backoff timer goes into effect.  That way the charger won't be connecting/disconnecting at the main loop revisit rate. 
  • If the LED light switch is turned on, charging is disabled.  I want only the battery to supply the LED lights.

Got the coding done.  Now over a few days of monitoring the setup in the shed, I have needed to only change some constants.  Much easier to just take the laptop out to the shed and program the board, than try to step thru code.  Between the development board base and the PCB add on I built, there are some crazy ground currents that are effecting the A/D readings.  Thus the constants needed some updating.

  

Friday, January 20, 2023

Sewing Room - Center Work Area

 

This is the starting point.  A few more views of this follow.


This was a collapsible cutting table on wheels, where the two sides can fold down onto the center frame.  The issue with this table was how the two extensions were supported.  A leg would slide out into the center of the extension and into a simple friction lock.  You can see it the leg in these three pictures.

In the last move, one of the legs was damaged beyond repair.  As you can see in the middle picture on the right side I built a simple H-frame with plywood cross members to support the extension against the wall.  But the wheel locks quit working long ago and the table had a tendency to migrate.  This led to some spectacular collapses of the extension against the wall.  I finally managed to secure it somewhat, though it still continued to move.

After much research into what other people were doing, the solution seemed to be Kallax bookcases. Starting with two 2 x 4 and one 2 x 2 bookcase as the endcap, I started building up a center console.

First there would be be no wheels, this would sit on a solid 2 x 4 frame.  Second we did extensive research on the correct height.  Too high or too low could be a big ergonomic issue so the goal was to get the correct height +/- 1/4 inch.  When that number was determined, I ripped the 2 x 4 lumber to the correct height.  

FULL DISCLOSURE:  I did a dry fit in the garage of everything that follows.  This allowed for drilling holes where needed and testing to make sure the fit was correct.

Here is the frame placed in the room.  Because the Kallax bookcases would run perpendicular to the wall, placement along the wall was very critical.


Because placement was critical and I needed more support, I attached this frame to the wall and the bookcase to the right.  The two spacers attaching to the bookcase on the right provided the correct placement.  I was also trying to avoid drilling into the wood floor.  This arrangement seemed to make a sturdy connection. 

Here are the bolts into the base board and the wall frame.

The next layer is a 3/4 inch piece of of plywood.  Since this is not exposed anywhere, I used a sheathing type plywood.  I then added a trim piece on the edge, just to clean up the edge and even painted a border just in case anything showed through.



Since the width of a  2 x 2 Kallax unit is not the same as two 2 x 4 Kallax units back to back, there was a little notch on the end as shown here.


Next is to lay this down onto the frame and screw it in place.  This will give the frame rigidity and provide a solid foundation for the Kallax bookcases.



Now the Kallax bookcases are installed on top of this plywood base.  If you look closely at the bookcase on the left, you can see the metal brackets that were used to tie the two bookcases together.  It needs to be noted that these bookcases are not solid.  The walls are mostly made of a corrugated interior, except around the edges.  The center area really has nothing that a screw can grip.  There is about a 1" strip around the edges where the outside frame is solid press board.  That is about the only place you can expect a screw to hold.




Before using the aforementioned brackets, I used long clamps to pull the two bookcases together and hold them in place.Then I screwed the brackets in place.




Now I install the 2 x 2 bookcase on the end.


In order to get a tight fit, I again used clamps to pull the endcap bookcase tight against the other two bookcases.  The endcap bookcase is then attached to the other two bookcases using the standard IKEA wall mounting brackets.  This will not hold in the long term because of the bookcase material.  We will put a single piece Formica type countertop that spans the distance from the wall to a few inches past the end bookcase.  All of the bookcases will be screwed into this single countertop and that will rigidly hold everything in place, as the countertop will also be attached to the wall.


Here you can notice why there was a small cutout in the base. The end bookcase width is shorter than the depth of two of the bookcases.

You can see that there is a toe kick space under the bookcases.  This allows standing up against the counter, even though the overhang on left side the countertop will allow for the use of a stool.

Once all the bookcases were tied together, I then put one long screw in each cubby area.  Here you can the screw head in the center towards the front.  The closeup picture shows that I used a large head and screwed it down until the material just started to deform.  These screws probably went through the plywood, but since nothing is underneath and the plywood is 2 inches off the floor, that really doesn't matter.

Finally at the wall end, there will there will be an open storage area under the countertop.  The plywood has one coat of white paint, but probably needs another to help seal the plywood.  Not sure how this will be used, since access is limited.


Once the countertop is installed, this will be finished!