Sunday, February 28, 2016

rev 4 soldered up and working!


Yay.  :)

Today I mostly soldered up a batch of six PCBs, but completed one to verify that everything was functional.  This one is going to a beta tester / evaluator.  The rest are mostly going to be reserved for educators that can give me feedback regarding lessons and suggestions for documentation.

Looks like I can start working with the PCB assembly house to ensure that they can produce these boards without any issues regarding my parts and layout.

Tuesday, February 23, 2016

K40 laser -- affordable, but kinda scary

There has been so much activity on G+ regarding the K40 "eBay" laser that I had to get on board.  The seller was in the US and should get it to me in less than a week.  Well, you know what?  It came in today, and here is the official unboxing.  I don't have too much to say at the moment, so here are pictures.





CE = Chinese Export
FDA = Fools Da Authorities


Busted vent duct, which I was planning on replacing anyway, plus a duct fan.  At least the duct ends sort of protect the optics.


I think I will be using some OpenBuilds extrusions to build a frame for this.  Something with protective windows, ventilation, and a place to hold the water tank for cooling off the laser.  Needs casters so I can roll it outside to run the cuts.

I hope to have some free time at work eventually, so I can get this thing running!


Monday, February 15, 2016

Charting Starbucks gift card discounts using Google Charts

Sunday, February 14, 2016

Data scraping to save money

Recently, I heard about a new company called Raise.  On the surface, they are in the business of buying used gift cards and then reselling to their customers at a discount.  I am really only interested in their service because I (unfortunately) occasionally go to Starbucks early in the morning to get breakfast.  Their turkey bacon breakfast sandwich with egg whites makes me feel like I'm going with a healthier option (instead of McDonald's), and the price is acceptable.  Raise makes the price even better, and their mobile app makes purchasing these gift cards a snap!

However, when is the right time to buy a discounted gift card?  "Buy low" is certainly the right mindset, but I have seen the discounts fluctuate from anywhere between 8% and 19% recently.  I thought it would at least be cool to be able to track gift card discounts over time so I'd be in the position to make a more informed decision when I need to get another card.

I couldn't find a Raise API online, so I opted to scrape their pages for data.  To simplify the approach, I limited the data of interest to the best discount available for a gift card, i.e. the first one on the page.  Thankfully, Raise displays all GC information without a user login, so I wouldn't have to deal with this extra level of complexity that I'm not experienced enough to handle right now.

My regex skills are rudimentary, but easily came up with a pattern that was good enough to scrape the data I wanted from the HTML source.  Now I just needed a way to post the data on a webpage.  Since I'm not a web developer, I had to come up with a really kludgy implementation that I think will work:



The app is complete and will download the Raise webpage for the Starbucks GC every hour.  It then runs my regex and scrapes the GC data from the page.  If the discount is different than the previous query (my app will query once an hour), then it will push the new value to data.sparkfun.com.

You can check out the raw data here.  There's some garbage in there from testing, so just ignore that.

https://data.sparkfun.com/streams/2J5Knq47y5cNbOrq3lj2

Next, I will be addressing the visualization part of this project.  When (if) I figure it out, I'll blog.  Hopefully, I have the ability to host Google Charts in a blog.

Are you interested in data for a different gift card?  Post a comment, and I might just add it to my query!

Wednesday, February 10, 2016

CH340G tester board is in

I'm not leaving anything to chance when sourcing ICs from China.  I can't afford to have boards assembled and then be bricks because of a dead serial converter chip.  I ended up making another simple board for testing the CH340G.


Thursday, February 4, 2016

r3 of the PICAXE board arrived!


Here it is, the latest rev of my low cost PICAXE board for kids!  Same size, but more pins than before!  When I make these in large quantities, the cost of putting components on the bottom side of the PCB is negligible, so I decided to do just that and cram in a larger PICAXE.

I was very excited to get this board soldered, so I assembled one at work, only to find that it didn't work.  When I plugged it in, the power LED came on, but I didn't get my friendly Windows chime that it makes when USB devices are recognized.  Thinking that maybe I did a bad job, I soldered up another one. That one also didn't work!  No way, I couldn't have made a mistake on the schematic, could I?  I mean, it was just a PICAXE change, a different LDO, and I added a jumper for external power.

I brought the boards home with me, hoping that I would find time tonight to diagnose the problem.  Luckily, I did find the time.  And there were a lot of problems.

The first thing I did was take a bare board and check the connections.  I found that there was a trace in my layout that shouldn't have been there.  I think that in the process of routing and rerouting, I forgot to delete an extra trace and ended up with some components shorted to ground.  Next, there was a trace missing between the CH340G and one of the 22pF capacitors.

Once I made these changes, the COM port was recognized!  Yay!  Ok, now to test my simple program from the 14M2 on the 20M2.


But it wouldn't program.  The first thing I checked was the Serial In line, and sure enough I found a problem there.  One cut and add later, I got it all working.  Phew.



I'm not sure that video uploaded properly.  You can also see it on Google+.

Wednesday, January 20, 2016

Version 2 of the PICAXE board is working

My version 2 board arrived last week from OSHpark.  I got all excited until I finished soldering everything and found that the board didn't work.  My PC wouldn't discover the COM port after plugging it in.  I found that the CH340G wasn't getting power!  Hmmm... I wonder why...


DOH!  I guess I accidentally bumped the power line before autorouting.  I fixed that problem with a simple add, only to run into another one -- the app couldn't program the PICAXE.  However, the programming tool could correctly detect the type of chip connected, as well as its firmware version.  What an interesting paradox.  I inspected the TX signal and found that processor was sending periodic data packets.  Each packet looked like it coincided perfectly with the timing of the processor detection on the application side.  I probed the RX signal and saw that there was no activity when I tried to program the processor.  In fact, the RX line was always high, and a high state is what tells the PICAXE to report its processor information, and that's why the application was able to tell what was connected.

I found it very unlikely that one input of the inverter was bad, but I replaced that chip anyway.  It didn't solve the problem.  I also changed the PICAXE for another one, but it behaved the same way.  something on the board is causing the RX line to be pulled high.

I soldered up a new board section by section, thinking that if it's a design issue, I would see the problem on another board.  I started with the LDO and inverter chips, and they behaved as expected.  I then added the serial converter and its related components.  All good.  Finally, I installed the PICAXE and voila, it worked!


I had one board left so I soldered that one.  It was also good.

I need to go back to the bad board to try to determine the cause of the problem.  I don't think it's the serial converter chip because it's on the opposite side of the inverter.  The output of the inverter is somehow pulled high.  At this point, I think I will start removing components one by one until I can isolate the problem.  I know that when I installed the inverter on this board, I had trouble soldering the SOT363 package and had some large bridges to clean up.  The solder wick was really thick and I used a lot of heat to remove the solder.  Perhaps I damaged the board...

Next up, I think I'll post some videos of bringing up the board and doing a simple breadboard project.