Category Archives: Battery power

Open heart surgery

image

OK, maybe not as dramatic, but it was just as vital.

With my final project deadline extended a week, I took a couple days of downtime to catch up on sleep. The all-nighters were adding up. Now I’m back and making some minor changes and a few fixes. Hopefully the thing will drive in reverse without catching on fire. If you don’t hear from me, send help.

Firmware for the not has been fleshed out and I’m looking forward to getting it coded. The loop is simple, checking the status of each input and setting a flag. That flag is passed to the three output functions, which run after the input stage. One exception is the turnaround() function, which is called by an interrupt on the whisker pin. Some output functions call themselves to complete a series of drive commands, for instance. This keeps things simple.

More to come.

Leave a comment

2015-04-23 · 20:05

All together now

image

image

image

image

Leave a comment

2015-04-20 · 21:18

Late night testing

image

Leave a comment

2015-04-20 · 01:30

Motor driver board

image

Mounting at the rear, near the motors, his board is centered around a SN754410, a quad half bridge driver. The IC includes clamping diodes, but external Schottky diodes add an extra layer of protection from potentially ruinous flyback current.

image

Leave a comment

Filed under analog, Battery power, edX, ICs, Motors, PCB design, Robots, Soldering

Power supply board

image

Power supply board for my two wheeled robot. 5 and 3.3V provided by TI LDO regulators at 3A each, and fused vbatt for the motors. PPTC rated 3A IH at 12V. Protection from over voltage condition (important when combining motors and MCUs) using crowbar circuits. Divider and space reserved for a tiny85 to monitor battery voltage.

image

Leave a comment

Filed under analog, Battery power, edX, ICs, power supply, regulators, Soldering

Crowbar circuit for over-voltage protection

image

Over-voltage protection for each rail of my project’s power supply in the form of a thyristor (silicon controlled rectifier or SCR) based crowbar circuit. The Zener breakdown voltage determines the cut off and trips the gate of the SCR, causing a short condition. The short is then handled by a fuse, protecting sensitive devices. A threshold of about 1V for the Zener diodes (4.3V for the 3.3V rail & 6.2V for the 5V rail) was selected to allow for overhead in case of transient spikes.

Leave a comment

2015-04-02 · 18:10

Power blocking front end for analog IR proximity sensor array

image

Leave a comment

2015-04-01 · 16:54

Hackable ornament: my circuit and code remix

IMG_20141115_213311320_HDR

Glowing demo with ShiftPWM and ATMega328P

After first coming across the Dangerous Prototypes Christmas ornament design in the summer, I’ve been thinking about how I might build on the design to make the light show a bit more exciting. One aspect that stuck out for me was how all 10 LEDs flash on and off at once. I decided my goal should be to have individual control over as many LEDs in the Christmas tree as possible.

IMG_20141127_033017255_HDR

Two shift registers connected to an Arduino

My first experiment solving the problem envisioned one or two 74HC595N Serial In Parallel Out shift registers. A nice glowing PWM effect is achieved through PWM via a CTC interrupt function. While I was able to wire this up with my Arduino’s Mega328, the Mega-only ShiftPWM library is too bloated for the tiny13’s 1K. Although the tiny13 Arduino core does have untested ShiftOut() functionality, the shift register idea is out, as the necessary program at my skill level puts it outside of time constraints. Although unsuitable for now, but shift registers have been added to my list of fun future projects.

Another option I considered was charlieplexing, or using the tri-state properties of MCU i/o pins to control 3 LEDs per pin, set up in an array. However, this would also mean current flowing through i/o pins. Scratch this idea,  but add it to the experiment list, as it might come in useful later.

IMG_20141202_212806289_HDR

How to groups the lights up with transistors

Ultimately, I decided to keep it simple and divide the 10 LEDs into groups of two, expanding from a single transistor switching 10 LEDs to 5 BJTs switching groups of 2 LEDs each. The same interrupt-based PWM technique as mentioned above is used on all 5 tiny13 pins. PB5/Reset is kept free for ISP access. Why not drive the LEDs directly from the tiny13 i/o pins? After all, the combined max current from the LEDs is 40mA, and the max current on a tiny13 pin is also 40mA. Good question.

When approaching hackability from a design perspective, maximizing the useful life of a device is a key focus. Future needs change, and if your design lends itself to being adapted along with that change, it will continue to serve a useful purpose for a long time. Building in tolerance and redundancy above the bare minimum requirements increases resiliency to the unforeseen.

Let’s ignore for a minute the fact that a simple code change to open up all 5 pins puts the tiny IC dangerously close to its 200mA limit of VCC to GND. While the two parallel LEDs on each pin might be enough for our current purposes, what if the LEDs are replaced with a heavier load? The i/o pins would probably be okay with the 2 LEDs at the duty cycle as programmed, but the pins would surely fry driving a motor. On the other hand, the NPNs can handle 600mA of continuous collector current, and might one day the board could be repurposed to power a little robot to amble along for our amusement. Plus, they’re insanely inexpensive. BJTs FTW!

before_after_2_schematic

Original schematic with my grouped LED remix

Another concern is the ISP port, which shares the serial lines with two groups of LEDs. The 40mA demand of the LEDs could potentially disrupt the flash programming sequence or damage the programmer. Isolating the load from the serial lines keeps things safe for reprogramming the tiny13.

match footprints with printout

Pro tip: printouts can be used to match footprints

Minor design changes included moving most of the cluttered components to the back of the board, arranged in a fashion to allow for a small area for a handwritten message at the top of the board. When designing PCBs, using a block of silkscreen can be handy for writing notes on boards. The switch and battery clip were swapped for components I had available. The switch fit an existing part in Eagle (Omron 1000), which made light work of swapping out the original design’s SMD switch in favour of the through-hole I had on hand.

battery_device

Creating devices from scratch in Eagle is a 3-step process

The battery clip had no datasheet and no part that came close. Out came the caliper and a notebook, then the SMD pad size and spacing were created in Eagle’s package editor. The placement silkscreen with chamfer to indicate polarity was also created. A tip: when replacing components in Eagle’s schematic view, make sure the polarity of the new part matches your diagram. While it wouldn’t have broken the circuit, the silkscreen indicator for positive would have been reversed, creating future confusion.

The final result is a slightly larger (5 * 8 cm) remixed work, with most of the unsightly components moved to the backside. The battery clip and switch are slightly different. The code has been replaced with the interrupt software PWM implemented by funkfinger based on Atmel Application notes. The sleep function from Ian’s code rounds things off to replicate the battery saving functionality. Here is the code from the original Dangerous Prototypes ornament (hopefully those links work for you. If not, please let me know):

http://www.pastebin.ca/2883580

Here’s my frankencode:

http://www.pastebin.ca/2883549

The effect of my circuit and code remix is 5 groups of two LEDs glowing on and off, all at different rates. This produces a pleasing twinkling effect, and is sure to light up the season. As of my writing this, my DirtyPCBs order has been batched and sent to the board house. With any luck, I’ll have an update before Christmas.

Original design, bottom layer

Original design, bottom layer

Circuit remix bottom later

Circuit remix bottom later

Leave a comment

Filed under Battery power, C++, code, DIY, fabrication, Hacking, ICs, Lights, PCB design

Then there was three…

image

Remember the new PV modules I barely mentioned previously? Well, it turns out that two was much better than one. Now we shall see how three in parallel will compare. This time I’ve stuck to nonpermanent adhesive (ha ha) so it can easily be remodeled. Lesson learned from a previous module multiplexing experiment.

image

Leave a comment

Filed under Battery power, DIY, Solar Stage, Soldering

Testing under way, full sun ahead!

image

Board with test terminals in constant current phase of CC/CV charge.

After building a Solar Stage with integrated terminals on the PV and battery for connecting an ammeter, I am now collecting data relating to the solar boost output and constant current/constant voltage charge cycle.
Data will be posted once recorded and graphed.
So far, the more sensitive PV modules connected in parallel provide charging current before noon from inside a north west facing window.

Leave a comment

Filed under Battery power, Solar Stage, Soldering