I want to install lights to miniature scale model of cars and bikes. I currently use external breadboard to control LEDs using DIP switches and i blink turn indicators using 555 timer.
here's my current setup:
4 X 3mm white LED (headlamps)
2 X SMD LED (pilot lamps)
2 X 5mm LED (angel eyes setup)
4 X SMD LED (turn indicators, i use 555 timer to blink them)
2 X 3mm LED (tail lamp)
2 X SMD LED (internal cockpit lamp and console light)
I want to learn microcontroller programming so i can integrate all components inside the model and use IR remote control (or maybe bluetooth of cellphone) to control all the LEDs.
I am n00b in electronics but i know basic circuit and its components, I have never worked with microcontroller before. I need some information about where to start. I searched for hours but i only found tutorials involving robotics or relay based light controller (110-220V home lights). since i want to glow only LEDs, i don't need relay i suppose?
I don't want to go into advanced robotics and such stuff.
I intend to use atmega8 uC. I don't have too much knowledge if this can handle my requirements. Any help will be highly appreciated.
You'll probably need an ArduinoMega, as the UNO only provides 14 Digital I/O pins, but you need at least 16 (one per LED)
Thanks alot for your reply.
Does adruino board mega 2560 require a programmer? or can i just hook it up with my PC via USB?
Is there any beginner friendly board with removable microcontroller (DIP type). So i can use microcontroller with perfboard?
Can i hook up two LEDs per pin? like two tail lamps that need to glow together connected to one pin of uC. If i can, I will only need 8 pins for my whole setup. 14 digital I/O pins would be enough in that case?
Do you need to individually switch EACH of those LEDs? I assume that the headlamps, for example, are either all on or off.
If you can group the LEDs, you will need fewer I/O pins, which brings the project back into Uno territory. But you may well need external transistors to provide enough current to power multiple LEDs from one pin. One Arduino pin can sink max 40mA.
If you want to fit your Arduino inside a model car then you probably want one of the small formats, or even just a bare Atmega 328 chip on your own circuit board.
This Thread about IR data transmission may be useful. I used it with an Attiny to make a receiver for an N-Gauge railway wagon. I did not have space for a PCB so everything was directly soldered to the Attiny pins.
I suggest you get an Arduino Uno to start with and learn on as it is the most standard - most things are designed for it. When you have your project working you can then miniaturize it if necessary.
Do you need to individually switch EACH of those LEDs? I assume that the headlamps, for example, are either all on or off.
What supply voltage and series resistor value do you use in your current setup?
Regards
Ray
No, i will control lights as a pair. like a pair of tail lamps, a pair of HID projector lights, a pair of reflector type lights, a pair of pilot lamps etc. So i will need only 8 individual control of these LEDs.
I use 9V battery with 220ohm resistors per two LEDs in series. current hovers around 13-14mA. Its not finalised yet, i might increase resistance to dim the LEDs as they are still too bright.
Is there any beginner friendly board with removable microcontroller (DIP type). So i can use microcontroller with perfboard?
I intend to use atmega8 uC
Don't use the atmega8. I don't know if you meant to say "atmega328 but if you didn't , you should
have.
Use the ATmega328 because ALL the arduino UNO circuit and code examples online will work with that chip because it is the chip used on the UNO.
The easiest method for a beginner is to buy an ATmega328 DIP with an OPTIBOOT bootloader preinstalled. DIPMICRO ATmega328 with OPTIBOOT bootloader and buy an FTDI BASIC (5V version)
to upload the sketches. (UNO uses surface mount FTDI chip so you need an FTDI breakout to perform that function). After installing the USB driver on your computer you will be able to upload sketches to the DIP.
See this for atmega328 DIP breadboarding instructions.
Also, you might want to consider using ATtiny85s (8-pin DIP). Without knowing the current requirements
of you leds I don't know if this chip will work for you. The same thing applies with this chip regarding the use of transistors for driving loads greater than the I/0 pins can handle.
DC Current per I/O Pin ............................................... 40.0 mA
You may want to research the boards file configuration setup for using the internal oscillators instead of
external crystal. This feature is available on both types of chip. ATMEGA328 with INTERNAL OSCILLATOR
raschemmel:
The easiest method for a beginner is to buy an ATmega328 DIP with an OPTIBOOT bootloader preinstalled.
to upload the sketches. (UNO uses surface mount FTDI chip so you need an FTDI breakout to perform that function). After installing the USB driver on your computer you will be able to upload sketches to the DIP.
Thanks for your help
I can't find ATmega328 DIP with OPTIBOOT in my country. Only ATmega328 DIP with arduino UNO bootloader is available. ATmega 328 with UNO bootloader
I am thinking about buying Arduino pro mini or arduino nano as both will fit inside 1:10 bike models as well as car models, this will eliminate the requirement of using bare DIP ATmega328 and other hassles.
Nano is bigger but features USB port. Does that mean i don't have to have the hassle of finding FTDI breakout board you said above?
I would prefer arduino pro mini if it will work with TTL board i posted above since its smaller (will leave space to integrate battery inside the body)
Will this IR receiver work with arduino pro mini or nano? HX1838 receiver NEC
or should i just buy this IR receiver and build supporting circuit myself TSOP 1738
i bought an uno R3 for building circuit and pro mini (to install inside the car model). Worked with some simple circuits and it works fine. TSOP 1738 is also detecting signals as intended. I will use NPN 2N2222 as switch to control lights so that part has been taken care of.
I want to clear a few doubts before i buy some more components.
Can i safely power arduino pro mini with 9V battery or 9V wallwart adaptor using RAW pin? or should i use an external 5V regulator and supply 5V to vcc pin?
Is it possible to play analog sound using PWM? sorry if this sound n00bish as i have zero experience with arduino. I want to install speakers inside my car models and play exhaust sound clips to simulate engine sounds. If not, what options do i have to play audio clips of engine sounds?
raschemmel:
That doesn't have the DTR signal so you would have to do a manual reset after uploading a sketch.
that was 1 month old post I got it sorted. had to hold reset button till arduino IDE starts showing 'uploading'.
My questions are:
Can i safely power arduino pro mini with 9V battery or 9V wallwart adaptor using RAW pin? or should i use an external 5V regulator and supply 5V to vcc pin?
Is it possible to play analog sound using PWM? sorry if this sound n00bish as i have zero experience with arduino. I want to install speakers inside my car models and play exhaust sound clips to simulate engine sounds. If not, what options do i have to play audio clips of engine sounds?
Yes. Easier to play more than a fraction of a second by controlling some external hardware tho, like one of these: MDFLY - Search Results for "mp3"
Record your sound, store it as file 001.mp3. Send that number to the card, it plays it back.
@Bluejets: sorry, missed your link in that usb to ttl link and attached picture.
CrossRoads:
Yes. Make sure it's DC, not AC.
Yes. Easier to play more than a fraction of a second by controlling some external hardware tho, like one of these: MDFLY - Search Results for "mp3"
Record your sound, store it as file 001.mp3. Send that number to the card, it plays it back.
How big are the models?
Around 9 inches long. Has enough room for arduino pro mini, speaker, amplifier and mp3 module.