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.

Wednesday, December 23, 2015

V1 boards are in!

Looks like OSHpark beat DirtyPCBs on delivery time this time around.  Now let's see if the boards work at all...  I'll start with the LED and UART test today.


Wednesday, December 9, 2015

PCBs have been submitted to the board houses!

Quick update -- I submitted my PCB to OSHpark a few days ago, and to DirtyPCBs yesterday.  We'll see what the differences are, and how quickly each service turns the boards around!

I also ordered a ton of components from Digikey, so once I have everything in hand, you can be sure to see some status updates here.

Keeping my fingers crossed, hoping that I won't need to do a rev of the board!

Saturday, December 5, 2015

First pass at PCB is done!

I've been spending a few minutes here, a few minutes there, and am close to having something to send out to OSHpark.  Here's what it looks like at the moment:


And here's what the BOM looks like right now:

DescriptionPart NumberUnit PriceDiscount Price qty 100QtyTotalDiscountedURL
PICAXE-14M2$3.39$3.191$3.39$3.19http://www.robotshop.com/en/picaxe-14m2-microcontroller-chip.html
USB-RS232 converterCH340G$0.40$0.401$0.40$0.40aliexpress
PCB$1.00$1.001$1.00$1.00OSHpark
green SMD LED160-1169-1-ND$0.30$0.131$0.30$0.13http://www.digikey.com/product-search/en?keywords=160-1169-1-ND
22pF capacitor, SMD399-8165-1-ND$0.16$0.052$0.32$0.11http://www.digikey.com/product-detail/en/C1206C220K5GACTU/399-8165-1-ND/3471888
0.1uF capacitor, SMD399-1249-1-ND$0.10$0.032$0.20$0.07http://www.digikey.com/product-search/en?keywords=399-1249-1-ND
12MHz crystal, SMDCTX888CT-ND$0.38$0.261$0.38$0.26http://www.digikey.com/product-search/en?keywords=CTX888CT-ND
22k resistor, SMDP22KACT-ND$0.10$0.011$0.10$0.01http://www.digikey.com/product-search/en?keywords=P22KACT-ND
10k resistor, SMDP10KACT-ND$0.10$0.011$0.10$0.01http://www.digikey.com/product-detail/en/ERJ-6GEYJ103V/P10KACT-ND/43118
200ohm resistor, SMDP200ECT-ND$0.10$0.021$0.10$0.02http://www.digikey.com/product-search/en?keywords=P200ECT-ND
TOTAL$6.29$5.19
I'm going to get pretty close to the $5 cost target!  After I do a quick review, I'm going to get this thing made and see how hard it is to assemble.  Hopefully, it works.  :)

Wednesday, December 2, 2015

Identifying a really cheap embedded solution that is ideal for schools

As I said in my previous post, a few dads and I are going to help out with a Maker's elective at school.  The three topics we will be covering include plumbing, woodworking, and electronics.  Of the three, I'm probably most skilled in electronics, so that's what I am going to attempt to "teach".

My goal is not going to be to make the kids experts in electronics.  Heck, I'm not an expert and just kind of hack my way through projects.  I just want them to be comfortable enough with the basics that they will be able to work on their own projects after the course is over.  In addition, I would like them to have fun and excite their curiosity so that they will WANT to pursue projects.

The basics include an explanation of voltage and current, Ohm's law, and Kirchoff's Laws.  I will need to come up with analogies to make the concepts easier to understand, as well as piece together simple demonstrations to show how the laws apply.  I would also like to give an overview of basic components, like resistors, capacitors, diodes, potentiometers, switches, and LEDs.

Blinking an LED when you press a button is nice for a "hello world" kind of electronics project, but to really capture their interest, I'm thinking that demonstrating fun things is the right way to go.  For example, I might be able to hack together demos like the following:
  • wiimote with accelerometer
  • spinning a stepper motor to drive a car
  • rotating a servo to move a Nerf cannon
  • lighting up LEDs in series to emulate a Force FX light saber
  • sound recording / playing (maybe to add to above light saber demo)
The list goes on and on... but then the question remains -- how in the world do you enable kids to create these projects?  When you think about schools and limited budgets in general, cost is a huge concern.  You also have to consider the programming hurdle for the kids, as well as what kinds of computers are available.  Are the programming tools free?  Do they work on Windows and Mac?  Can you program the board easily?

I created a matrix of products that had to be cheaper than $20, but the magic price I wanted to hit was $5.  That's a tall order, but I think I have reached a decision...


Dev BoardCostExtra Costs / TimeSolderable?Free Programming S/WFree Dev EnvWindows?OSX?iOS?Experience?CommentsSources
MSP430 Launchpad$10NoNYYYYNSomeBringup takes timeTI
EZ430$10/$24NoNYYYYNSomeNot sure if alibaba pricing is legitAlibaba.com
Cypress PSoC$4HeadersNYYYNNNo
Cyproess
Freescale FRDM-KL25Z$15HeadersNYYYYNYesBringup takes time, but really powerful toolsDigikey
Arduino variants$15-20USB cableNYYYYNSomeI don't like ArduinoAdafruit, Sparkfun
PICaxe custom$3PCB, Headers, USB-RS232YYYYYYNoCoding is easySparkfun, Aliexpress
PIC custom?PCB, Headers, USB-RS232Y?YYYNSomeNot sure about cheap programming optionsDigikey, Aliexpress
C.H.I.P.$8LinuxNYYNNNNoDelivery date? We are also not teaching them about programming computersgetchip.com
Raspberry Pi Zero$5LinuxNYYNNNLittleImpossible to get at the moment. We aren't interested in teaching Linux hereElement14
Onion Omega$19Mini dockNYYYYNNoI have one, and the available libraries are quite limited right nowonion.io

This matrix aims to evaluate each available platform in terms of cost, ease of use, my ability to help the kids out with them, as well as accessibility to programming tools and development environments.

I have decided to go with a custom solution, and am currently designing a simple PICAXE-based PCB that includes everything a kid would need on a stick that plugs into a USB board.  It wouldn't need a voltage regulator because I would just rely on the 5V, 500mA USB port present on all computers.  The USB-RS232 converter and PICAXE are both 5V compatible.  I am currently going to go with the 14M2, which I believe will give them a reasonable amount of I/O to play with.  The PCB will include all required components, as well as female stackable headers so that the board can be plugged into a standard breadboard for prototyping.

The other nice thing here (if it works!) is that this gives the kids an opportunity to learn soldering and assemble a mixture of through-hole and surface mount components.  I am going to go with the largest surface mount packages available for each component so that it's easier for them.

If this works out, this board could be a really useful platform for future classes at our school, or at our engineering fairs.  I'll open source everything so other schools can use it as well, not that there's really anything I'm doing here except assembling the BOM and designing a PCB...

If you have any suggestions about useful electronics topics for kids, or anything else at all, please post them!

Monday, November 30, 2015

Revisiting my racing simulator rig

It has been a while since my last post!  That's because work and life have, in general, prevented me from making stuff.  However, over this Thanksgiving holiday Steam had a great sale on games, so I picked up a bunch of them.  The most exciting one was project CARS, which is a racing simulator.  Well, it turns out that 2+ years ago, I built a racing sim and never wrote about it in my blog.

The frame I built is based on one from someone named "Mr. Burns".  His post is no longer online, unfortunately, so I cannot give credit to him other than reference his alias.  It was very helpful in getting me to the point where I was just attacking the build and creating on the fly, rather than evaluating the 10 million different ways I could build a seat frame.  Thanks, Mr. Burns!



For my particular design, I broke up the frame into two sections.  The first part was the steering wheel and monitor mount, and the second was Mr. Burns' seat mount.  This separation allows me to adjust the seat distance for taller players.  The current design is really inconvenient because I have to loosen up t-nuts to separate the frames.  The steering wheel / monitor frame is also not very rigid and stable.

The rear frame is composed of a cheap APR seat (purchased from Amazon), mounted to a frame, which is then mounted on top of another frame through a shock absorber.  Most builders suggested using tie rods to prevent the seat from twisting about the shock absorber, so I added them.  The seat motion is generated by two SCN5 linear actuators, which are connected from the rear of the bottom frame to the rear of the seat frame.  This allows the simulator to generate pitch and roll motions.

The magic is in all in the software, called x-sim.  For non-commercial use, you can download it for free from x-sim.de.  The mastermind behind the software, sirnoname, authors plugins for each of the available racing sims.  These plugins basically hook into the game and can peek at memory locations that represent the car's telemetry data.  Using this data and fancy math, he's able to convert the data into physical motion.  It's brilliant, and for project CARS it works really well.  When I first built this simulator, I only played it with iRacing and Dirt 3, and never spent the time to tune the seat feedback properly.  Well, with project CARS, I am quite happy with the results without having changed a single setting.  :)

In other news, I'm also going to be helping out with a Maker's elective at school, so I will be posting again shortly about a fun little project I'm going to try to complete for the kids (and possibly for kids in other schools, if it works well enough!).